mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-22 00:21:34 +01:00
Manage github ssh-keys with sops
This commit is contained in:
parent
c1cba95e02
commit
ae4a2e5b72
10 changed files with 92 additions and 11 deletions
|
|
@ -4,7 +4,7 @@
|
|||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
}@moduleArgs:
|
||||
{
|
||||
imports = [ inputs.sops-nix.homeManagerModules.sops ];
|
||||
|
||||
|
|
@ -13,7 +13,12 @@
|
|||
config = lib.mkIf config.myConfig.sops.enable {
|
||||
sops = {
|
||||
age.sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ];
|
||||
defaultSopsFile = "${self}/users/${config.home.username}/secrets.yaml";
|
||||
defaultSopsFile =
|
||||
let
|
||||
hostName = moduleArgs.osConfig.networking.hostName or "";
|
||||
hostDir = if hostName != "" then "/@" + hostName else "";
|
||||
in
|
||||
"${self}/users/${config.home.username}${hostDir}/secrets.yaml";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue