diff --git a/modules/nixos/archetypes/workstation/default.nix b/modules/nixos/archetypes/workstation/default.nix index 596f7bc..24de0a1 100644 --- a/modules/nixos/archetypes/workstation/default.nix +++ b/modules/nixos/archetypes/workstation/default.nix @@ -32,6 +32,7 @@ in { networking.enable = true; # Networkmanager configuration kernel.enable = true; # Kernel modifications bluetooth.enable = true; # Bluetooth support + shell.enable = true; # Shell environment configuration }; desktop.gnome.enable = true; diff --git a/modules/nixos/common/kernel/default.nix b/modules/nixos/common/kernel/default.nix index 008623b..9850bdc 100644 --- a/modules/nixos/common/kernel/default.nix +++ b/modules/nixos/common/kernel/default.nix @@ -19,7 +19,7 @@ in { options.${namespace}.common.kernel = { enable = mkEnableOption "Modify the standard kernel settings"; version = mkOption { - type = lib.types.str; + type = types.str; default = "linuxPackages_latest"; example = "linuxPackages_latest"; description = "Set the kernel version to be used by your system"; diff --git a/modules/nixos/common/shell/default.nix b/modules/nixos/common/shell/default.nix new file mode 100644 index 0000000..e4533a0 --- /dev/null +++ b/modules/nixos/common/shell/default.nix @@ -0,0 +1,34 @@ +{ + lib, + pkgs, + inputs, + + namespace, # The flake namespace, set in flake.nix. If not set, defaults to "internal". + system, # The system architecture for this host (eg. `x86_64-linux`). + target, # The Snowfall Lib target for this system (eg. `x86_64-iso`). + format, # A normalized name for the system target (eg. `iso`). + virtual, # A boolean to determine whether this system is a virtual target using nixos-generators. + systems, # An attribute map of your defined hosts. + + config, + ... +}: with lib; with lib.${namespace}; +let + cfg = config.${namespace}.common.shell; +in { + options.${namespace}.common.shell = { + enable = mkEnableOption "Modify the standard shell options"; + package = mkOption { + type = types.str; + default = "fish"; + example = "fish"; + description = "Select an appropriate shell environment (bash, fish, zsh...)"; + }; + }; + + config = mkIf cfg.enable { + environment.shells = with pkgs; [ ${cfg.package} ]; + users.defaultUserShell = pkgs.${cfg.package}; + programs.${cfg.package}.enable = true; + }; +} diff --git a/systems/x86_64-linux/puzzlevision/default.nix b/systems/x86_64-linux/puzzlevision/default.nix index c2aa4a8..1abca8a 100644 --- a/systems/x86_64-linux/puzzlevision/default.nix +++ b/systems/x86_64-linux/puzzlevision/default.nix @@ -98,11 +98,6 @@ with lib.${namespace}; # Enable support for flipper zero devices hardware.flipperzero.enable = true; - # Configure system-wide default shell. - environment.shells = with pkgs; [ fish ]; - users.defaultUserShell = pkgs.fish; - programs.fish.enable = true; - # Configure users. snowfallorg.users.jo.admin = true; @@ -111,7 +106,7 @@ with lib.${namespace}; # Configure home-manager home-manager = { - backupFileExtension = "homeManagerBackupFile69"; + backupFileExtension = "homeManagerBackupFile"; }; # Provide users with some sane default packages.