Feat/sops nix #12

Merged
finn.markwitz merged 16 commits from feat/sops-nix into main 2026-09-14 13:06:46 +02:00
7 changed files with 89 additions and 2 deletions
Showing only changes of commit 3ab8bfbb91 - Show all commits
+3 -1
View File
@@ -1 +1,3 @@
AGENTS.md
AGENTS.md
*.dec
keys.txt
+17
View File
@@ -0,0 +1,17 @@
keys:
- &admin_finn age1a0v442ct2qfjcdhyktn25spw02yq4fl08plrrvuradwwxzsle4mq8thln4
- &host_mibook age1n3uqtee5ymykrls6k04dznq50cwmj99hw7ny83yxjndt4y2ncf5qhjwa2p
# - &host_jupiter age1... # TODO: Phase 9, see docs/secrets.md
creation_rules:
- path_regex: ^secrets/mibook\.yaml$
key_groups:
- age:
- *admin_finn
- *host_mibook
# - path_regex: ^secrets/jupiter\.yaml$ # TODO: Phase 9
# key_groups:
# - age: [ *admin_finn, *host_jupiter ]
# - path_regex: ^secrets/common\.yaml$ # TODO: Phase 9
# key_groups:
# - age: [ *admin_finn, *host_mibook, *host_jupiter ]
Generated
+22 -1
View File
@@ -264,7 +264,28 @@
"nixos-generators": "nixos-generators",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_3",
"nixpkgs-unstable": "nixpkgs-unstable"
"nixpkgs-unstable": "nixpkgs-unstable",
"sops-nix": "sops-nix"
}
},
"sops-nix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1788337237,
"narHash": "sha256-gkSH8VUtCo6hnysNmb9DbTuDepH2t5pv+QWjP75xKAk=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "fbf759290e0cb0a98dfc813a4eb7d53ad1dacb57",
"type": "github"
},
"original": {
"owner": "Mic92",
"repo": "sops-nix",
"type": "github"
}
}
},
+13
View File
@@ -11,6 +11,10 @@
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
@@ -36,6 +40,15 @@
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
};
devShells.default = pkgs.mkShell {
packages = with pkgs; [
sops
age
ssh-to-age
nixfmt
];
};
};
systems = [ "x86_64-linux" ];
+2
View File
@@ -4,6 +4,7 @@ let
nixpkgs
nixpkgs-unstable
nixos-hardware
sops-nix
#hyprland
;
nixosSystem = nixpkgs.lib.makeOverridable nixpkgs.lib.nixosSystem;
@@ -40,6 +41,7 @@ let
];
}
../modules
sops-nix.nixosModules.sops
# ../profiles
];
defaultModules = baseModules ++ customModules;
+1
View File
@@ -3,5 +3,6 @@
./modules.nix
./network.nix
./nix.nix
./sops.nix
./users.nix
]
+31
View File
@@ -0,0 +1,31 @@
# sops-nix plumbing — applied to every machine.
# See docs/secrets.md for the day-to-day workflow.
{
config,
lib,
pkgs,
...
}:
{
# Each host defaults to its own secrets/<hostname>.yaml. Override per-secret
# with sops.secrets.<name>.sopsFile for shared files.
sops.defaultSopsFile = lib.mkDefault (../../secrets + "/${config.networking.hostName}.yaml");
sops.defaultSopsFormat = "yaml";
sops.validateSopsFiles = true;
# Decrypt with the host's own SSH host key, converted to age.
# Explicit rather than inheriting the openssh-derived default, so this does
# not silently break if services.openssh is ever disabled.
sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
sops.age.generateKey = false;
# Age only. The default here is the RSA host key imported as a GPG key,
# which is deprecated and an extra failure surface.
sops.gnupg.sshKeyPaths = [ ];
environment.systemPackages = with pkgs; [
sops
age
ssh-to-age
];
}