Flake for my NixOS devices

use bwc9876.dev for email

bwc9876.dev 89c7f370 c729b21a

verified
+93 -72
+3 -3
flake.lock
··· 47 47 ] 48 48 }, 49 49 "locked": { 50 - "lastModified": 1770388745, 51 - "narHash": "sha256-tmAONUMNHnlkozNcMR1kZJ/68OGea5wS56vl6vaUS5U=", 50 + "lastModified": 1770551880, 51 + "narHash": "sha256-+cS5yXWsSLiK36+PP/+dcQdxpXSclx2d65p7l6Dis+A=", 52 52 "owner": "catppuccin", 53 53 "repo": "nix", 54 - "rev": "5e9efb97caeffea3bf248023b6d8b68e63b839b9", 54 + "rev": "db4dfe3f2a80e9c33492d839accd49f75c7324c2", 55 55 "type": "github" 56 56 }, 57 57 "original": {
+90 -69
homeModules/user-bean.nix
··· 8 8 { 9 9 options.cow.bean = { 10 10 enable = lib.mkEnableOption "Bean user presets"; 11 + username = lib.mkOption { 12 + type = lib.types.str; 13 + description = "username"; 14 + default = "bean"; 15 + }; 16 + name = lib.mkOption { 17 + type = lib.types.str; 18 + description = "Friendly name of user"; 19 + default = "Ben C"; 20 + }; 11 21 pubkey = lib.mkOption { 12 22 type = lib.types.nullOr lib.types.str; 13 23 description = "Public key to accept for bean"; 14 24 default = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKsVzdJra+x5aEuwTjL1FBOiMh9bftvs8QwsM1xyEbdd"; 15 25 }; 26 + email = lib.mkOption { 27 + type = lib.types.str; 28 + # TODO: Tangled supports DIDs instead... 29 + description = "Email to use for Git operations"; 30 + default = lib.join "@bwc9876" [ 31 + "ben" 32 + ".dev" 33 + ]; 34 + }; 16 35 }; 17 36 18 - config = lib.mkIf config.cow.bean.enable { 19 - # My Personal config using most of my HM modules 20 - 21 - home = { 22 - file.".ssh/authorized_keys".text = lib.mkIf (config.cow.bean.pubkey != null) '' 23 - ${config.cow.bean.pubkey} bean 24 - ''; 25 - username = lib.mkDefault "bean"; 26 - homeDirectory = lib.mkDefault "/home/bean"; 27 - }; 37 + config = 38 + let 39 + conf = config.cow.bean; 40 + in 41 + lib.mkIf conf.enable { 42 + # My Personal config using most of my HM modules 28 43 29 - programs.jujutsu.settings = { 30 - user = { 31 - name = "Ben C"; 32 - email = "bwc9876@gmail.com"; 33 - }; 34 - git = { 35 - sign-on-push = true; 36 - }; 37 - signing = { 38 - behavior = "drop"; 39 - backend = "ssh"; 40 - key = lib.mkIf (config.cow.bean.pubkey != null) config.cow.bean.pubkey; 44 + home = { 45 + file.".ssh/authorized_keys".text = lib.mkIf (conf.pubkey != null) '' 46 + ${conf.pubkey} ${conf.username} 47 + ''; 48 + username = lib.mkDefault conf.username; 49 + homeDirectory = lib.mkDefault "/home/${conf.username}"; 41 50 }; 42 - }; 43 51 44 - programs.git = { 45 - signing = lib.mkIf (config.cow.bean.pubkey != null) { 46 - format = "ssh"; 47 - signByDefault = true; 48 - }; 49 - settings = { 52 + programs.jujutsu.settings = { 50 53 user = { 51 - email = "bwc9876@gmail.com"; 52 - name = "Ben C"; 53 - signingKey = lib.mkIf (config.cow.bean.pubkey != null) config.cow.bean.pubkey; 54 + inherit (conf) name email; 55 + }; 56 + git = { 57 + sign-on-push = true; 58 + }; 59 + signing = { 60 + behavior = "drop"; 61 + backend = "ssh"; 62 + key = lib.mkIf (conf.pubkey != null) conf.pubkey; 54 63 }; 55 64 }; 56 - }; 57 65 58 - home.packages = lib.mkIf config.cow.gdi.enable ( 59 - with pkgs; 60 - [ 61 - zoom-us 62 - tuxpaint 63 - ] 64 - ); 66 + programs.git = { 67 + signing = lib.mkIf (conf.pubkey != null) { 68 + format = "ssh"; 69 + signByDefault = true; 70 + }; 71 + settings = { 72 + user = { 73 + inherit (conf) name email; 74 + signingKey = lib.mkIf (conf.pubkey != null) conf.pubkey; 75 + }; 76 + }; 77 + }; 65 78 66 - home.sessionVariables = { 67 - "EDITOR" = "nvim"; 68 - }; 79 + home.packages = lib.mkIf config.cow.gdi.enable ( 80 + with pkgs; 81 + [ 82 + zoom-us 83 + tuxpaint 84 + ] 85 + ); 69 86 70 - xdg.mimeApps.defaultApplications = lib.mkIf config.cow.gdi.enable { 71 - "image/svg+xml" = "org.inkscape.Inkscape.desktop"; 72 - "image/*" = "org.gnome.Loupe.desktop"; 73 - }; 87 + home.sessionVariables = { 88 + "EDITOR" = "nvim"; 89 + }; 74 90 75 - cow = { 76 - libraries.enable = true; 77 - imperm.keepLibraries = true; 78 - pictures = { 79 - enable = true; 80 - pfp = ../res/pictures/cow.png; 81 - bg = ../res/pictures/background.png; 91 + xdg.mimeApps.defaultApplications = lib.mkIf config.cow.gdi.enable { 92 + "image/svg+xml" = "org.inkscape.Inkscape.desktop"; 93 + "image/*" = "org.gnome.Loupe.desktop"; 82 94 }; 83 - nushell = { 84 - enable = true; 85 - commandNotFound = true; 86 - }; 87 - neovim.enable = true; 88 - htop.enable = true; 89 - starship.enable = true; 90 - dev.enable = true; 91 - jj.enable = true; 92 - comma.enable = true; 93 - cat.enable = true; 95 + 96 + cow = { 97 + libraries.enable = true; 98 + imperm.keepLibraries = true; 99 + pictures = { 100 + enable = true; 101 + pfp = ../res/pictures/cow.png; 102 + bg = ../res/pictures/background.png; 103 + }; 104 + nushell = { 105 + enable = true; 106 + commandNotFound = true; 107 + }; 108 + neovim.enable = true; 109 + htop.enable = true; 110 + starship.enable = true; 111 + dev.enable = true; 112 + jj.enable = true; 113 + comma.enable = true; 114 + cat.enable = true; 94 115 95 - keepassxc = { 96 - enable = true; 97 - dbPath = lib.mkDefault "${config.xdg.userDirs.documents}/Keepass/DB/Database.kdbx"; 116 + keepassxc = { 117 + enable = true; 118 + dbPath = lib.mkDefault "${config.xdg.userDirs.documents}/Keepass/DB/Database.kdbx"; 119 + }; 98 120 }; 99 121 }; 100 - }; 101 122 }