mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 15:11:34 +01:00
Compare commits
3 commits
de16ca49e8
...
1170bbf857
| Author | SHA1 | Date | |
|---|---|---|---|
| 1170bbf857 | |||
| 21b4e04613 | |||
| 10362bd42b |
13 changed files with 21 additions and 33 deletions
|
|
@ -10,13 +10,13 @@
|
||||||
{
|
{
|
||||||
packages.sops-config =
|
packages.sops-config =
|
||||||
let
|
let
|
||||||
adminKey = "age1mpq8m4p7dnxh5ze3fh7etd2k6sp85zdnmp9te3e9chcw4pw07pcq960zh5";
|
adminPublicKey = "age1mpq8m4p7dnxh5ze3fh7etd2k6sp85zdnmp9te3e9chcw4pw07pcq960zh5";
|
||||||
|
|
||||||
mkCreationRule = sopsCfg: {
|
mkCreationRule = sopsCfg: {
|
||||||
path_regex = sopsCfg.secretsFile;
|
path_regex = self.lib.relativePath sopsCfg.secretsFile;
|
||||||
key_groups = lib.singleton {
|
key_groups = lib.singleton {
|
||||||
age = [
|
age = [
|
||||||
adminKey
|
adminPublicKey
|
||||||
sopsCfg.agePublicKey
|
sopsCfg.agePublicKey
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,7 @@
|
||||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||||
|
|
||||||
custom = {
|
custom = {
|
||||||
sops = {
|
sops.enable = true;
|
||||||
enable = true;
|
|
||||||
agePublicKey = "age18x6herevmcuhcmeh47ll6p9ck9zk4ga6gfxwlc8yl49rwjxm7qusylwfgc";
|
|
||||||
};
|
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
loader.systemd-boot.enable = true;
|
loader.systemd-boot.enable = true;
|
||||||
|
|
|
||||||
1
hosts/desktop/keys/age.pub
Normal file
1
hosts/desktop/keys/age.pub
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
age18x6herevmcuhcmeh47ll6p9ck9zk4ga6gfxwlc8yl49rwjxm7qusylwfgc
|
||||||
|
|
@ -10,10 +10,7 @@
|
||||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||||
|
|
||||||
custom = {
|
custom = {
|
||||||
sops = {
|
sops.enable = true;
|
||||||
enable = true;
|
|
||||||
agePublicKey = "age1sywwrwse76x8yskrsfpwk38fu2cmyx5s9qkf2pgc68cta0vj9psql7dp6e";
|
|
||||||
};
|
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
loader.systemd-boot.enable = true;
|
loader.systemd-boot.enable = true;
|
||||||
|
|
|
||||||
1
hosts/laptop/keys/age.pub
Normal file
1
hosts/laptop/keys/age.pub
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
age1sywwrwse76x8yskrsfpwk38fu2cmyx5s9qkf2pgc68cta0vj9psql7dp6e
|
||||||
|
|
@ -16,10 +16,7 @@
|
||||||
custom = {
|
custom = {
|
||||||
persistence.enable = true;
|
persistence.enable = true;
|
||||||
|
|
||||||
sops = {
|
sops.enable = true;
|
||||||
enable = true;
|
|
||||||
agePublicKey = "age1dv6uwnlv7d5dq63y2gwdajel3uyxxxjy07nsyth63fx2hgn3fvsqz94994";
|
|
||||||
};
|
|
||||||
|
|
||||||
boot.loader.grub.enable = true;
|
boot.loader.grub.enable = true;
|
||||||
|
|
||||||
|
|
|
||||||
1
hosts/vps-monitor/keys/age.pub
Normal file
1
hosts/vps-monitor/keys/age.pub
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
age1dv6uwnlv7d5dq63y2gwdajel3uyxxxjy07nsyth63fx2hgn3fvsqz94994
|
||||||
|
|
@ -16,10 +16,7 @@
|
||||||
custom = {
|
custom = {
|
||||||
persistence.enable = true;
|
persistence.enable = true;
|
||||||
|
|
||||||
sops = {
|
sops.enable = true;
|
||||||
enable = true;
|
|
||||||
agePublicKey = "age1e9a0jj0t5mwep4zgaplsuw57750g0sv5uujvx56ad0te0rle0e0q6ywu69";
|
|
||||||
};
|
|
||||||
|
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
|
||||||
|
|
|
||||||
1
hosts/vps-private/keys/age.pub
Normal file
1
hosts/vps-private/keys/age.pub
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
age1e9a0jj0t5mwep4zgaplsuw57750g0sv5uujvx56ad0te0rle0e0q6ywu69
|
||||||
|
|
@ -16,10 +16,7 @@
|
||||||
custom = {
|
custom = {
|
||||||
persistence.enable = true;
|
persistence.enable = true;
|
||||||
|
|
||||||
sops = {
|
sops.enable = true;
|
||||||
enable = true;
|
|
||||||
agePublicKey = "age1j47wr83tg4t8sdjcyarwvvrt8qzjrgw2fa2e4nufffdev89t8prsu7lxnh";
|
|
||||||
};
|
|
||||||
|
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
|
||||||
|
|
|
||||||
1
hosts/vps-public/keys/age.pub
Normal file
1
hosts/vps-public/keys/age.pub
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
age1j47wr83tg4t8sdjcyarwvvrt8qzjrgw2fa2e4nufffdev89t8prsu7lxnh
|
||||||
|
|
@ -42,11 +42,11 @@ in
|
||||||
default = if cfg.routableAddress != null then 47141 else null;
|
default = if cfg.routableAddress != null then 47141 else null;
|
||||||
};
|
};
|
||||||
|
|
||||||
pubPath = lib.mkOption {
|
publicKeyPath = lib.mkOption {
|
||||||
type = lib.types.path;
|
type = lib.types.path;
|
||||||
default = "${self}/hosts/${hostname}/keys/nebula.pub";
|
default = "${self}/hosts/${hostname}/keys/nebula.pub";
|
||||||
};
|
};
|
||||||
certPath = lib.mkOption {
|
certificatePath = lib.mkOption {
|
||||||
type = lib.types.path;
|
type = lib.types.path;
|
||||||
default = "${self}/hosts/${hostname}/keys/nebula.crt";
|
default = "${self}/hosts/${hostname}/keys/nebula.crt";
|
||||||
};
|
};
|
||||||
|
|
@ -69,7 +69,7 @@ in
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
ca = ./ca.crt;
|
ca = ./ca.crt;
|
||||||
cert = cfg.certPath;
|
cert = cfg.certificatePath;
|
||||||
key = config.sops.secrets."nebula/host-key".path;
|
key = config.sops.secrets."nebula/host-key".path;
|
||||||
|
|
||||||
listen.port = cfg.routablePort;
|
listen.port = cfg.routablePort;
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,6 @@
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.custom.sops;
|
cfg = config.custom.sops;
|
||||||
|
|
||||||
absoluteSecretsPath = "${self}/${cfg.secretsFile}";
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [ inputs.sops.nixosModules.sops ];
|
imports = [ inputs.sops.nixosModules.sops ];
|
||||||
|
|
@ -17,15 +15,15 @@ in
|
||||||
enable = lib.mkEnableOption "";
|
enable = lib.mkEnableOption "";
|
||||||
agePublicKey = lib.mkOption {
|
agePublicKey = lib.mkOption {
|
||||||
type = lib.types.nonEmptyStr;
|
type = lib.types.nonEmptyStr;
|
||||||
default = "";
|
default = "${self}/hosts/${config.networking.hostName}/keys/age.pub" |> lib.readFile |> lib.trim;
|
||||||
};
|
};
|
||||||
secretsFile = lib.mkOption {
|
secretsFile = lib.mkOption {
|
||||||
type = lib.types.nonEmptyStr;
|
type = lib.types.path;
|
||||||
default = "hosts/${config.networking.hostName}/secrets.json";
|
default = "${self}/hosts/${config.networking.hostName}/secrets.json";
|
||||||
};
|
};
|
||||||
secrets = lib.mkOption {
|
secrets = lib.mkOption {
|
||||||
type = lib.types.anything;
|
type = lib.types.anything;
|
||||||
default = absoluteSecretsPath |> lib.readFile |> lib.strings.fromJSON;
|
default = cfg.secretsFile |> lib.readFile |> lib.strings.fromJSON;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -34,7 +32,7 @@ in
|
||||||
age.sshKeyPaths = [
|
age.sshKeyPaths = [
|
||||||
"${lib.optionalString config.custom.persistence.enable "/persist"}/etc/ssh/ssh_host_ed25519_key"
|
"${lib.optionalString config.custom.persistence.enable "/persist"}/etc/ssh/ssh_host_ed25519_key"
|
||||||
];
|
];
|
||||||
defaultSopsFile = absoluteSecretsPath;
|
defaultSopsFile = cfg.secretsFile;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue