aeltheos age keys and devshells

cephiroth-v2
aeltheos 2025-02-13 18:00:49 +01:00
parent 041b9fc029
commit 7f69cd5a0a
3 changed files with 14 additions and 23 deletions

View File

@ -1,10 +1,11 @@
{ pkgs }:
{ pkgs, agenix }:
pkgs.mkShell {
name = "nix";
packages = with pkgs; [
agenix
agenix.packages.x86_64-linux.default
age-plugin-yubikey
nil
nixpkgs-fmt
ssh-to-age

View File

@ -27,9 +27,7 @@
...
}:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
inputs.treefmt-nix.flakeModule
];
imports = [ inputs.treefmt-nix.flakeModule ];
systems = [ "x86_64-linux" ];
@ -85,7 +83,7 @@
};
devShells = {
default = pkgs.callPackage ./devshells/default.nix { };
default = pkgs.callPackage ./devshells/default.nix { inherit (inputs) agenix; };
};
};
};

View File

@ -4,6 +4,8 @@ let
korenstin = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIh26Ejn/syhvReixauY8i85+XD8P9RRJrPQGEyAQ07l klin@nixos";
lzebulon = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJRSBsRgd/ITK2An7q1VXoeDPbcydR3FkQjHoO+1tAAO lzebulon@archframe";
pigeonmoelleux = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHa+ptSTNG4mnGUEGSkHTNDzyUGeiMnaWS2nDvJwrYTp ratcornu@skryre";
aeltheos_0 = "age1yubikey1qvn7t9hplvnr2w8nsfezfqudz8gq3v8sq99dkdpzmm4a74rng5qgz4v6wzt";
aeltheos_1 = "age1yubikey1qwmt8heph3jg9sfva3yygphfw0nqed9hs8ndjsfw8yp86kwllearq9fylz2";
nounous = [
korenstin
@ -65,13 +67,9 @@ let
# Secrets
commonSecrets = [
"restic/client_env"
];
commonSecrets = [ "restic/client_env" ];
acmeSecrets = [
"acme/env"
];
acmeSecrets = [ "acme/env" ];
# Fonctions utilitaires
@ -80,11 +78,7 @@ let
genAttrs =
paths: groups:
builtins.foldl' (
acc: secret:
acc
// {
"secrets/${secret}.age".publicKeys = groups ++ nounous;
}
acc: secret: acc // { "secrets/${secret}.age".publicKeys = groups ++ nounous; }
) { } paths;
in
@ -98,12 +92,10 @@ in
let
key = hosts.${name};
in
genAttrs
[
"restic/${name}/base-repo"
"restic/${name}/base-password"
]
[ key ]
genAttrs [
"restic/${name}/base-repo"
"restic/${name}/base-password"
] [ key ]
)
) { } (remove "thot" hostnames)
// builtins.mapAttrs (name: value: { publicKeys = value.publicKeys ++ nounous; }) {