diff --git a/flake.nix b/flake.nix index 87c5b45..1e6978c 100644 --- a/flake.nix +++ b/flake.nix @@ -18,6 +18,11 @@ in rec { inherit stateVersion; hostname = "mrmeeseeks"; username = "ephase"; + hostConfig = { + gaming = true; + desktop = true; + laptop = false; + }; }; modules = [ ./nixos/default.nix diff --git a/modules/home/desktop/default.nix b/modules/home/desktop/default.nix index 4bbeed4..6cd20bc 100644 --- a/modules/home/desktop/default.nix +++ b/modules/home/desktop/default.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, hostConfig, ... }: { home.packages = with pkgs; [ emojione diff --git a/modules/home/desktop/sway/default.nix b/modules/home/desktop/sway/default.nix index 2bfe550..d014055 100644 --- a/modules/home/desktop/sway/default.nix +++ b/modules/home/desktop/sway/default.nix @@ -1,5 +1,7 @@ -{ ... }: -{ +{ hostConfig, ... }: +let + cfg = hostConfig; +in { imports = [ ./sway.nix ./mako.nix @@ -7,5 +9,9 @@ ./swaylock.nix ./swayidle.nix ./fuzzel.nix - ]; + ] ++ ( + if hostConfig.laptop then + [ ./kanshi.nix ] + else [] + ); } diff --git a/nixos/default.nix b/nixos/default.nix index 3bfcf83..cc46503 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -1,5 +1,4 @@ -{ config, pkgs, lib, stateVersion, hostname, username, ... }: - +{ config, pkgs, lib, stateVersion, hostname, username, hostConfig, ... }: { imports = [ # Include the results of the hardware scan. @@ -12,15 +11,32 @@ ./includes/system/lvm.nix ./includes/system/doas.nix ./includes/system/neovim.nix - ./includes/desktop/swaylock.nix - ./includes/desktop/pipewire.nix - ./includes/desktop/xdg-portal.nix - ./includes/gaming/steam.nix - ]; - + ] ++ ( + if hostConfig.desktop then + [ + ./includes/desktop/swaylock.nix + ./includes/desktop/pipewire.nix + ./includes/desktop/xdg-portal.nix + ] + else [] + ) ++ ( + if hostConfig.gaming then + [ + ./includes/gaming/steam.nix + ] + else [] + ) ++ ( + if hostConfig.laptop then + [ + ./includes/hardware/iwd.nix + ] + else [] + ); + + nixpkgs.config.allowUnfree = true; - + boot.kernelPackages = pkgs.linuxPackages_latest; networking.hostName = hostname; @@ -39,20 +55,26 @@ ]; home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - users.${username} = { - home.stateVersion = stateVersion; - programs.home-manager.enable = true; - imports = [ - ../modules/home/desktop - ../modules/home/webcord.nix - ../modules/home/cli - ../modules/home/firefox - ../modules/home/foot.nix - ../modules/home/lutris.nix - ../modules/home/zathura.nix - ]; + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = { + inherit hostConfig; + }; + users.${username} = { + home.stateVersion = stateVersion; + programs.home-manager.enable = true; + imports = [ + ../modules/home/desktop + ../modules/home/webcord.nix + ../modules/home/cli + ../modules/home/firefox + ../modules/home/foot.nix + ../modules/home/zathura.nix + ] ++ ( + if hostConfig.gaming then + [ ../modules/home/lutris.nix ] + else [] + ); }; }; diff --git a/nixos/includes/hardware/iwd.nix b/nixos/includes/hardware/iwd.nix new file mode 100644 index 0000000..6dd5746 --- /dev/null +++ b/nixos/includes/hardware/iwd.nix @@ -0,0 +1,3 @@ +{ + networking.wireless.iwd.enable = true; +}