mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 18:41:34 +01:00
28 lines
514 B
Nix
28 lines
514 B
Nix
{
|
|
config,
|
|
inputs,
|
|
self,
|
|
lib,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.myConfig.sops;
|
|
in
|
|
{
|
|
imports = [ inputs.sops-nix.nixosModules.sops ];
|
|
|
|
options.myConfig.sops = {
|
|
enable = lib.mkEnableOption "";
|
|
defaultSopsFile = lib.mkOption {
|
|
type = lib.types.path;
|
|
default = "${self}/hosts/${config.networking.hostName}/secrets.yaml";
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
sops = {
|
|
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
|
inherit (cfg) defaultSopsFile;
|
|
};
|
|
};
|
|
}
|