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/gkleen/default.nix | 34 +++++++++++++++++++++++++++++++++- users/root.nix | 29 ++++++++++++++++++++++++++--- 2 files changed, 59 insertions(+), 4 deletions(-) (limited to 'users') diff --git a/users/gkleen/default.nix b/users/gkleen/default.nix index f74701a5..26f7a1d4 100644 --- a/users/gkleen/default.nix +++ b/users/gkleen/default.nix @@ -1,5 +1,9 @@ -{ userName, pkgs, customUtils, lib, ... }: +{ flake, userName, pkgs, customUtils, lib, ... }: { + imports = with flake.nixosModules.userProfiles.${userName}; [ + zsh tmux utils + ]; + users.users.${userName} = { description = "Gregor Kleen"; extraGroups = [ "wheel" "networkmanager" "lp" "dialout" "audio" "video" "xmpp" "mail" "ssh" "vboxusers" "libvirtd" "wireshark" "games"]; @@ -12,4 +16,32 @@ openssh.authorizedKeys.keyFiles = lib.attrValues (customUtils.recImport rec { dir = ./authorized-keys; _import = name: _base: dir + "/${name}"; }); hashedPassword = "$6$rounds=500000$dOMgCU7DAk$yQFYGOURTEt12387LIYBnFKSWmtwXMUk1LJWnV0m7OFt.y2TnxQn2abdGA5dhwG9EmMB5wZGXf4J5F71c746C/"; }; + + home-manager.users.${userName} = { + programs = { + git = { + enable = true; + userEmail = "gkleen@yggdrasil.li"; + userName = "Gregor Kleen"; + delta.enable = true; + extraConfig = { + pull.rebase = false; + }; + }; + + ssh = { + enable = true; + controlMaster = "auto"; + controlPersist = "30m"; + serverAliveInterval = 6; + hashKnownHosts = true; + extraConfig = '' + IdentitiesOnly true + ServerAliveCountMax 10 + ''; + }; + + gpg.enable = true; + }; + }; } 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