mirror of
https://github.com/ellmau/nixos.git
synced 2025-12-19 09:29:36 +01:00
Add machine specific git stuff to home manager config
This commit is contained in:
parent
e928835dc7
commit
a49b068c07
@ -65,7 +65,7 @@ with lib; {
|
||||
config =
|
||||
let
|
||||
cfg = config.elss.users;
|
||||
inherit (elss.withConfig config) mapAdmins mapUsers mapAllUsersAndRoot;
|
||||
inherit (elss.withConfig config) mapAdmins mapUsers mapAllUsersAndRoot mapAllUsers;
|
||||
|
||||
getMeta = login:
|
||||
builtins.getAttr login cfg.meta;
|
||||
@ -87,6 +87,27 @@ with lib; {
|
||||
extraGroups = [ ];
|
||||
openssh.authorizedKeys.keys = meta.publicKeys;
|
||||
};
|
||||
|
||||
mkGitUser = login:
|
||||
let meta = getMeta login;
|
||||
in
|
||||
{
|
||||
programs.git = {
|
||||
userEmail = meta.mailAddress;
|
||||
userName = meta.description;
|
||||
extraConfig ={
|
||||
gpg = lib.mkIf meta.git.gpgsm {
|
||||
format = "x509";
|
||||
program = "${pkgs.gnupg}/bin/gpgsm";
|
||||
};
|
||||
user = {
|
||||
signingKey = meta.git.key;
|
||||
signByDefault = meta.git.signDefault;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
in
|
||||
mkIf (cfg.enable)
|
||||
{
|
||||
@ -118,5 +139,6 @@ with lib; {
|
||||
(mapUsers mkUser)
|
||||
];
|
||||
};
|
||||
home-manager.users = (mapAllUsers mkGitUser);
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user