From 4a3d2a8ddaf4e546df360656bc54b2947bdb890b Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 3 Jan 2021 00:55:29 +0100 Subject: gkleen@sif: import --- users/root.nix | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'users/root.nix') diff --git a/users/root.nix b/users/root.nix index 95fe37c4..c6e7d712 100644 --- a/users/root.nix +++ b/users/root.nix @@ -1,7 +1,30 @@ -{ flake, lib, config, hostName, ... }: -{ - users.users.root = lib.mkIf (flake.nixosModules.accounts ? "gkleen@${hostName}") { +{ flake, lib, config, hostName, userName, pkgs, ... }: +let + haveGKleen = flake.nixosModules.accounts ? "gkleen@${hostName}"; +in { + imports = with flake.nixosModules.userProfiles.${userName}; [ + zsh tmux utils + ]; + + users.users.${userName} = lib.mkIf haveGKleen { inherit (config.users.users."gkleen") hashedPassword shell; openssh.authorizedKeys.keyFiles = config.users.users."gkleen".openssh.authorizedKeys.keyFiles; }; + + home-manager.users.${userName} = { + programs = lib.mkIf haveGKleen { + inherit (config.home-manager.users.gkleen.programs) git ssh gpg; + }; + + services = { + gpg-agent = { + enable = true; + enableSshSupport = true; + extraConfig = '' + pinentry-program ${pkgs.pinentry-curses}/bin/pinentry + grab + ''; + }; + }; + }; } -- cgit v1.2.3