diff --git a/homes/x86_64-linux/cholli@workvm/default.nix.bak b/homes/x86_64-linux/cholli@workvm/default.nix.bak new file mode 100644 index 0000000..f353ce6 --- /dev/null +++ b/homes/x86_64-linux/cholli@workvm/default.nix.bak @@ -0,0 +1,24 @@ +{ + lib, + pkgs, + config, + ... +}: +# User information gathered by Snowfall Lib is available. +let + name = config.snowfallorg.user.name; + home = config.snowfallorg.user.home.directory; +in { + home = { + packages = with pkgs; [neovim]; + + sessionVariables = {EDITOR = "nvim";}; + + shellAliases = { + vim = "nvim"; + vimdiff = "nvim -d"; + }; + + stateVersion = "23.11"; + }; +} diff --git a/modules/home/apps/cli-apps/kitty/default.nix b/modules/home/apps/cli-apps/kitty/default.nix new file mode 100644 index 0000000..f5724a3 --- /dev/null +++ b/modules/home/apps/cli-apps/kitty/default.nix @@ -0,0 +1,20 @@ +{ + lib, + config, + pkgs, + ... +}: +with lib; +with lib.wyrdgard; let + cfg = config.wyrdgard.apps.cli-apps.kitty; +in { + options.wyrdgard.cli-apps.kitty = { + enable = mkEnableOption "Kity"; + }; + + config = mkIf cfg.enable { + home.packages = with pkgs; [ + kitty + ]; + }; +} diff --git a/modules/home/user/default.nix b/modules/home/user/default.nix new file mode 100644 index 0000000..2943609 --- /dev/null +++ b/modules/home/user/default.nix @@ -0,0 +1,52 @@ +{ + lib, + config, + pkgs, + osConfig ? {}, + ... +}: let + inherit (lib) types mkIf mkDefault mkMerge; + inherit (lib.wyrdgard) mkOpt; + + cfg = config.wyrdgard.user; + + is-linux = pkgs.stdenv.isLinux; + is-darwin = pkgs.stdenv.isDarwin; + + home-directory = + if cfg.name == null + then null + else if is-darwin + then "/Users/${cfg.name}" + else "/home/${cfg.name}"; +in { + options.wyrdgard.user = { + enable = mkOpt types.bool true "Whether to configure the user account."; + name = mkOpt (types.nullOr types.str) (config.wyrdgard.user.name or "cholli") "The user account."; + + fullName = mkOpt types.str "Christoph Hollizeck" "The full name of the user."; + email = mkOpt types.str "christoph.hollizeck@hey.com" "The email of the user."; + + home = mkOpt (types.nullOr types.str) home-directory "The user's home directory."; + }; + + config = mkIf cfg.enable (mkMerge [ + { + assertions = [ + { + assertion = cfg.name != null; + message = "wyrdgard.user.name must be set"; + } + { + assertion = cfg.home != null; + message = "wyrdgard.user.home must be set"; + } + ]; + + home = { + username = mkDefault cfg.name; + homeDirectory = mkDefault cfg.home; + }; + } + ]); +}