mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 16:21:34 +01:00
28 lines
587 B
Nix
28 lines
587 B
Nix
{
|
|
config,
|
|
inputs,
|
|
self,
|
|
lib,
|
|
...
|
|
}@moduleArgs:
|
|
let
|
|
cfg = config.custom.sops;
|
|
in
|
|
{
|
|
imports = [ inputs.sops-nix.homeManagerModules.sops ];
|
|
|
|
options.custom.sops = {
|
|
enable = lib.mkEnableOption "";
|
|
hostName = lib.mkOption {
|
|
type = lib.types.nonEmptyStr;
|
|
default = moduleArgs.osConfig.networking.hostName or "";
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
sops = {
|
|
age.sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ];
|
|
defaultSopsFile = "${self}/users/${config.home.username}/@${cfg.hostName}/secrets.yaml";
|
|
};
|
|
};
|
|
}
|