49 lines
1.2 KiB
Nix
49 lines
1.2 KiB
Nix
{
|
|
user ? throw "user argument is required",
|
|
home ? throw "home argument is required",
|
|
}:
|
|
{
|
|
config,
|
|
inputs,
|
|
lib,
|
|
system,
|
|
...
|
|
}:
|
|
let
|
|
hmConfig = config.home-manager.users.${user};
|
|
selfPkgs = inputs.self.packages.${system};
|
|
in
|
|
{
|
|
home-manager.users.${user} = {
|
|
sops = {
|
|
secrets = {
|
|
"git/credentials/git.karaolidis.com/admin/username".sopsFile =
|
|
../../../../../../../secrets/personal/secrets.yaml;
|
|
"git/credentials/git.karaolidis.com/admin/password".sopsFile =
|
|
../../../../../../../secrets/personal/secrets.yaml;
|
|
};
|
|
|
|
templates."git/credentials" = {
|
|
content = ''
|
|
https://${hmConfig.sops.placeholder."git/credentials/git.karaolidis.com/admin/username"}:${
|
|
hmConfig.sops.placeholder."git/credentials/git.karaolidis.com/admin/password"
|
|
}@git.karaolidis.com
|
|
'';
|
|
path = "${home}/.config/git/credentials";
|
|
};
|
|
};
|
|
|
|
programs.ssh = {
|
|
matchBlocks = {
|
|
"github.com" = {
|
|
hostname = "github.com";
|
|
user = "git";
|
|
identityFile = "${home}/.ssh/ssh_personal_ed25519_key";
|
|
};
|
|
};
|
|
|
|
userKnownHostsFiles = with selfPkgs; [ ssh-known-hosts-github ];
|
|
};
|
|
};
|
|
}
|