Non stop entertainment! The wackiest NixOS configuration to-date. thevoid.cafe/projects/puzzlevision
nixos flake flake-parts dotfiles home-manager nix

🔧 Add new profile home utility module

thevoid.cafe 61e11829 e21be976

verified
+54
+12
homes/x86_64-linux/jo/default.nix
··· 15 15 ./desktop/gnome 16 16 ]; 17 17 18 + # Flake module configurations 18 19 puzzlevision = { 20 + ## User profile information 21 + profile = { 22 + fullName = "Jo"; 23 + email = "me@thevoid.cafe"; 24 + sshKeyFile = "${config.home.homeDirectory}/.ssh/id_ed25519"; 25 + }; 26 + 27 + ## Active system themes 19 28 themes.catppuccin.enable = true; 29 + 30 + ## CLI tools and apps 20 31 cli.direnv.enable = true; 21 32 cli.git = { 22 33 enable = true; ··· 24 35 }; 25 36 }; 26 37 38 + # Configuration of wakatime secret file 27 39 sops.secrets.wakatime-cfg = { 28 40 format = "binary"; 29 41 sopsFile = ./secrets/wakatime.cfg;
+42
modules/home/profile/default.nix
··· 1 + { 2 + lib, 3 + self, 4 + config, 5 + ... 6 + }: 7 + let 8 + inherit (self) namespace mkOpt; 9 + inherit (lib) types; 10 + 11 + cfg = config.${namespace}.profile; 12 + username = config.home.username; 13 + in 14 + { 15 + options.${namespace}.profile = { 16 + username = 17 + mkOpt types.str username 18 + "The user's username, to be consumed by other modules. Defaults to the home-manager username."; 19 + fullName = 20 + mkOpt types.str username 21 + "The user's full name, to be consumed by other modules. Defaults to the home-manager username."; 22 + email = 23 + mkOpt (types.nullOr types.str) null 24 + "The user's primary E-Mail address, to be consumed by other modules."; 25 + sshKeyFile = 26 + mkOpt (types.nullOr types.str) null 27 + "The user's primary SSH key location, to be consumed by other modules."; 28 + }; 29 + 30 + config = { 31 + assertions = [ 32 + { 33 + assertion = cfg.email != null; 34 + message = "${namespace}.profile.email must be set!"; 35 + } 36 + { 37 + assertion = cfg.sshKeyFile != null; 38 + message = "${namespace}.profile.sshKey must be set!"; 39 + } 40 + ]; 41 + }; 42 + }