nix machine / user configurations
at terra 2.1 kB view raw
1{ 2 pkgs, 3 lib, 4 tlib, 5 config, 6 ... 7}@globalAttrs: 8let 9 l = lib // builtins; 10 11 nixosConfig = globalAttrs.config; 12 13 signKeyText = builtins.readFile ../../secrets/yusdacra.key.pub; 14in 15{ 16 users.users.firewatch = { 17 isNormalUser = true; 18 createHome = true; 19 home = "/home/firewatch"; 20 extraGroups = l.flatten [ 21 "wheel" 22 "adbusers" 23 "nix-build-key-access" 24 (l.optional nixosConfig.virtualisation.docker.enable "docker") 25 ]; 26 shell = pkgs.zsh; 27 hashedPassword = "$6$spzqhAyJfhHy$iHgLBlhjGn1l8PnbjJdWTn1GPvcjMqYNKUzdCe/7IrX6sHNgETSr/Nfpdmq9FCXLhrAfwHOd/q/8SvfeIeNX4/"; 28 }; 29 environment.shells = with pkgs; [ 30 bashInteractive 31 zsh 32 ]; 33 programs = { 34 # cuz nixos complains 35 zsh.enable = true; 36 }; 37 home-manager.users.firewatch = 38 { 39 config, 40 pkgs, 41 inputs, 42 secrets, 43 ... 44 }: 45 let 46 personal = import ../../personal.nix; 47 name = personal.name; 48 email = personal.emails.primary; 49 in 50 { 51 imports = 52 let 53 modulesToEnable = l.flatten [ 54 [ 55 "zoxide" 56 "zsh" 57 "fzf" 58 "starship" 59 "direnv" 60 ] 61 # dev stuff 62 [ 63 "helix" 64 "git" 65 "ssh" 66 ] 67 ]; 68 in 69 l.flatten [ 70 ../../modules/persist/null.nix 71 (tlib.prefixStrings "${inputs.self}/users/modules/" modulesToEnable) 72 ]; 73 74 settings.enable = false; 75 76 home = { 77 homeDirectory = nixosConfig.users.users.firewatch.home; 78 packages = with pkgs; [ 79 # Programs 80 nix-output-monitor 81 ]; 82 file.".ssh/authorized_keys".text = '' 83 ${signKeyText} 84 ''; 85 }; 86 87 programs = { 88 command-not-found.enable = nixosConfig.programs.command-not-found.enable; 89 git = { 90 userName = name; 91 userEmail = email; 92 extraConfig = { 93 gpg.format = "ssh"; 94 commit.gpgsign = true; 95 user.signingkey = signKeyText; 96 }; 97 }; 98 }; 99 }; 100}