Skip to content

Commit

Permalink
fix(agenix-rekey)!: wrong generator syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
reo101 committed Dec 25, 2023
1 parent 66ae98e commit 96defb1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
15 changes: 10 additions & 5 deletions machines/nixos/x86_64-linux/jeeves/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
inputs.hardware.nixosModules.common-gpu-amd
./disko.nix
inputs.agenix.nixosModules.default
# FIXME: agenix-rekey
inputs.agenix-rekey.nixosModules.default
./network.nix
./wireguard.nix
./jellyfin.nix
./mindustry.nix
];

# FIXME: agenix-rekey
age.rekey = {
hostPubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPopSTZ81UyKp9JSljCLp+Syk51zacjh9fLteqxQ6/aB";
masterIdentities = [ "${inputs.self}/secrets/privkey.age" ];
Expand Down Expand Up @@ -57,6 +55,11 @@
config.nix.registry;

settings = {
trusted-users = [
"root"
"jeeves"
];

experimental-features = "nix-command flakes";
auto-optimise-store = true;
};
Expand All @@ -72,9 +75,11 @@
# NOTE: made with `mkpasswd -m sha-516`
age.secrets."jeeves.user.password" = {
rekeyFile = "${inputs.self}/secrets/home/jeeves/user/password.age";
generator = {pkgs, ...}: ''
${pkgs.mkpasswd}/bin/mkpasswd -m sha-516
'';
generator = {
script = {pkgs, ...}: ''
${pkgs.mkpasswd}/bin/mkpasswd -m sha-516
'';
};
};

users = {
Expand Down
12 changes: 7 additions & 5 deletions machines/nixos/x86_64-linux/jeeves/wireguard.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
age.secrets."wireguard.private" = {
mode = "077";
rekeyFile = "${inputs.self}/secrets/home/jeeves/wireguard/private.age";
generator = {lib, pkgs, file, ...}: ''
priv=$(${pkgs.wireguard-tools}/bin/wg genkey)
${pkgs.wireguard-tools}/bin/wg pubkey <<< "$priv" > ${lib.escapeShellArg (lib.removeSuffix ".age" file + ".pub")}
echo "$priv"
'';
generator = {
script = {lib, pkgs, file, ...}: ''
priv=$(${pkgs.wireguard-tools}/bin/wg genkey)
${pkgs.wireguard-tools}/bin/wg pubkey <<< "$priv" > ${lib.escapeShellArg (lib.removeSuffix ".age" file + ".pub")}
echo "$priv"
'';
};
};

networking.firewall.allowedUDPPorts = [51820];
Expand Down

0 comments on commit 96defb1

Please sign in to comment.