My Nix Configuration
1{ 2 pkgs, 3 config, 4 lib, 5 ... 6}: 7let 8 cfg = config.py.users.default; 9in 10{ 11 options.py.users.default.enable = lib.mkEnableOption "Default PyroNet Users"; 12 options.py.user.name = lib.mkOption { 13 type = lib.types.str; 14 default = "thehedgehog"; 15 description = "User for deploy-rs deployments."; 16 }; 17 18 config = lib.mkIf cfg.enable { 19 users.users.pyrox = { 20 description = "Pyrox"; 21 isNormalUser = true; 22 extraGroups = [ 23 "adbusers" 24 "wheel" 25 "networkmanager" 26 "video" 27 "docker" 28 "wireshark" 29 "input" 30 ]; 31 hashedPassword = "$y$j9T$Lwu/kwfIYVH6ApPNFv5TL.$xXtWoVxOKDW0xQtw7yf2JGWP3JI6r9WIqV19W0/zrg5"; 32 shell = pkgs.fish; 33 openssh = { 34 authorizedKeys = { 35 keyFiles = [ 36 ./yubikey-new.pub 37 ./yubikey-main.pub 38 ./yubikey-back.pub 39 ./backup.pub 40 ]; 41 keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP532AB5mkNvE29MkDDY8HEf8ZdktGWiI0PzLrvbmLQe" ]; 42 }; 43 }; 44 }; 45 users.users.thehedgehog = { 46 description = "The Hedgehog"; 47 isNormalUser = true; 48 extraGroups = [ 49 "adbusers" 50 "wheel" 51 "networkmanager" 52 "video" 53 "docker" 54 "wireshark" 55 "input" 56 ]; 57 hashedPassword = "$y$j9T$Lwu/kwfIYVH6ApPNFv5TL.$xXtWoVxOKDW0xQtw7yf2JGWP3JI6r9WIqV19W0/zrg5"; 58 shell = pkgs.fish; 59 openssh = { 60 authorizedKeys = { 61 keyFiles = [ 62 ./yubikey-new.pub 63 ./yubikey-main.pub 64 ./yubikey-back.pub 65 ./backup.pub 66 ]; 67 keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP532AB5mkNvE29MkDDY8HEf8ZdktGWiI0PzLrvbmLQe" ]; 68 }; 69 }; 70 }; 71 }; 72}