mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 17:31: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
|
|
@ -9,7 +9,12 @@
|
|||
userEmail = "sebastian.stork@pm.me";
|
||||
extraConfig.init.defaultBranch = "main";
|
||||
};
|
||||
|
||||
programs.lazygit.enable = true;
|
||||
|
||||
sops.secrets.github-ssh-key.path = "${config.home.homeDirectory}/.ssh/github";
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
matchBlocks."github.com".identityFile = "~/.ssh/github";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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