feat: update agenix-rekey (prevents frequent store path change which caused unnecessary microvm restarts)

This commit is contained in:
oddlama 2024-03-15 17:21:55 +01:00
parent a737071162
commit d4a932923d
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
4 changed files with 108 additions and 105 deletions

6
flake.lock generated
View file

@ -53,11 +53,11 @@
"pre-commit-hooks": "pre-commit-hooks" "pre-commit-hooks": "pre-commit-hooks"
}, },
"locked": { "locked": {
"lastModified": 1708966623, "lastModified": 1710507018,
"narHash": "sha256-ClfhWvju5sJpt2l9FKCcHtyNnVtLBRjMNie066GLgyM=", "narHash": "sha256-uLiNsW8OGfj/qAUj0ckwXX+8tdNOhWvhQGdzaVtqjjY=",
"owner": "oddlama", "owner": "oddlama",
"repo": "agenix-rekey", "repo": "agenix-rekey",
"rev": "ac73aac46bc4a9474496ce3e68ed05f0c2a340ce", "rev": "5a4a617d5daf5634f058ecd0430ea20961a694b8",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -2,5 +2,6 @@ f: {
lib, lib,
config, config,
... ...
}: f { }:
f {
} }

View file

@ -2,5 +2,6 @@ f: {
lib, lib,
config, config,
... ...
}: f { }:
f {
} }

View file

@ -8,105 +8,106 @@ f: {
mkOption mkOption
types types
; ;
in f { in
options.nodes = mkOption { f {
default = {}; options.nodes = mkOption {
description = '' default = {};
''; description = ''
type = types.attrsOf (types.submodule (nodeSubmod: { '';
options = { type = types.attrsOf (types.submodule (nodeSubmod: {
name = mkOption { options = {
description = "The name of this node"; name = mkOption {
default = nodeSubmod.config._module.args.name; description = "The name of this node";
readOnly = true; default = nodeSubmod.config._module.args.name;
type = types.str; readOnly = true;
type = types.str;
};
type = mkOption {
description = "TODO";
default = "normal";
type = types.enum ["normal" "microvm" "nixos-container"];
};
parent = mkOption {
description = "TODO guests ids (topology.node.<name>.id) ensure exists";
default = [];
type = types.listOf types.str;
};
disks = mkOption {
default = {};
type = types.attrsOf (types.submodule (submod: {
options = {
name = mkOption {
description = "The name of this disk";
default = submod.config._module.args.name;
readOnly = true;
type = types.str;
};
};
}));
};
interfaces = mkOption {
description = "TODO";
default = {};
type = types.attrsOf (types.submodule (submod: {
options = {
name = mkOption {
description = "The name of this interface";
type = types.str;
readOnly = true;
default = submod.config._module.args.name;
};
mac = mkOption {
description = "The MAC address of this interface, if known.";
default = null;
type = types.nullOr types.str;
};
addresses = mkOption {
description = "The configured address(es), or a descriptive string (like DHCP).";
type = types.listOf types.str;
};
network = mkOption {
description = ''
The global name of the attached/spanned network.
If this is given, this interface can be shown in the network graph.
'';
default = null;
type = types.nullOr types.str;
};
};
}));
};
firewallRules = mkOption {
description = "TODO";
default = {};
type = types.attrsOf (types.submodule (submod: {
options = {
name = mkOption {
description = "The name of this firewall rule";
type = types.str;
readOnly = true;
default = submod.config._module.args.name;
};
contents = mkOption {
description = "A human readable summary of this rule's effects";
type = types.lines;
};
};
}));
};
}; };
}));
};
type = mkOption { config = {
description = "TODO"; # TODO: assertions = []
default = "normal"; };
type = types.enum ["normal" "microvm" "nixos-container"]; }
};
parent = mkOption {
description = "TODO guests ids (topology.node.<name>.id) ensure exists";
default = [];
type = types.listOf types.str;
};
disks = mkOption {
default = {};
type = types.attrsOf (types.submodule (submod: {
options = {
name = mkOption {
description = "The name of this disk";
default = submod.config._module.args.name;
readOnly = true;
type = types.str;
};
};
}));
};
interfaces = mkOption {
description = "TODO";
default = {};
type = types.attrsOf (types.submodule (submod: {
options = {
name = mkOption {
description = "The name of this interface";
type = types.str;
readOnly = true;
default = submod.config._module.args.name;
};
mac = mkOption {
description = "The MAC address of this interface, if known.";
default = null;
type = types.nullOr types.str;
};
addresses = mkOption {
description = "The configured address(es), or a descriptive string (like DHCP).";
type = types.listOf types.str;
};
network = mkOption {
description = ''
The global name of the attached/spanned network.
If this is given, this interface can be shown in the network graph.
'';
default = null;
type = types.nullOr types.str;
};
};
}));
};
firewallRules = mkOption {
description = "TODO";
default = {};
type = types.attrsOf (types.submodule (submod: {
options = {
name = mkOption {
description = "The name of this firewall rule";
type = types.str;
readOnly = true;
default = submod.config._module.args.name;
};
contents = mkOption {
description = "A human readable summary of this rule's effects";
type = types.lines;
};
};
}));
};
};
}));
};
config = {
# TODO: assertions = []
};
}