diff --git a/machines/productivity-vm/configuration.nix b/machines/productivity-vm/configuration.nix index 042906d..74b3121 100644 --- a/machines/productivity-vm/configuration.nix +++ b/machines/productivity-vm/configuration.nix @@ -29,7 +29,6 @@ useOSProber = true; }; virtualisation.vmware.guest.enable = true; - services.greetd.enable = false; # Setup system configuration nathan = { programs = { games = false; }; @@ -42,6 +41,7 @@ setupGrub = false; nix.autoUpdate = false; harden = false; + hyprland.enableGreetd = false; }; }; # Configure networking diff --git a/modules/linux/default.nix b/modules/linux/default.nix index 338e4af..46fad6e 100644 --- a/modules/linux/default.nix +++ b/modules/linux/default.nix @@ -182,6 +182,12 @@ in { description = "Whether to setup hyprland"; type = lib.types.bool; }; + enableGreetd = mkOption { + default = config.nathan.config.isDesktop; + example = true; + description = "Whether to setup greetd"; + type = lib.types.bool; + }; }; # Virtualization configuration # All on by default if the system is a desktop diff --git a/modules/linux/hyprland.nix b/modules/linux/hyprland.nix index 5ac3f0b..8acc8b1 100644 --- a/modules/linux/hyprland.nix +++ b/modules/linux/hyprland.nix @@ -1,72 +1,78 @@ { config, lib, pkgs, inputs, ... }: let nc = config.nathan.config; in with lib; { - config = mkIf nc.hyprland.enable { - # Turn on GDM for login - services.xserver = { - enable = true; - autorun = false; - # Enable plasma for the applications - desktopManager.plasma5.enable = true; - }; - # Greetd for login - programs.regreet = { - enable = true; - settings = { GTK = { font_name = "Roboto 16"; }; }; - }; - services.greetd = { - enable = lib.mkDefault true; - settings = { default_session.command = "cage -s -- regreet"; }; - }; - # Setup drivers - hardware.opengl = { - # Enable vulkan - driSupport = true; - # Same as above, but enable 32 bit legacy support (for games) - driSupport32Bit = true; - }; - # Basic packages that are effectively required for a graphical system - environment.systemPackages = with pkgs; [ - # Greeter packages - cage - config.programs.regreet.package - gnome.adwaita-icon-theme - # GTK Theming - gtk-engine-murrine - gtk_engines - gsettings-desktop-schemas - lxappearance - kde-gtk-config - (stdenv.mkDerivation rec { - pname = "sddm-sugar-dark-theme"; - version = "1.2"; - dontBuild = true; - installPhase = '' - mkdir -p $out/share/sddm/themes - cp -aR $src $out/share/sddm/themes/sugar-dark - ''; - src = fetchFromGitHub { - owner = "MarianArlt"; - repo = "sddm-sugar-dark"; - rev = "v${version}"; - sha256 = "0gx0am7vq1ywaw2rm1p015x90b75ccqxnb1sz3wy8yjl27v82yhb"; - }; - }) - ]; - qt.platformTheme = "qt5ct"; - # Enable and configure hyperland - programs.hyprland = { - enable = true; - xwayland = { + config = mkMerge [ + (mkIf nc.hyprland.enableGreetd { + # Greetd for login + programs.regreet = { enable = true; - hidpi = false; + settings = { GTK = { font_name = "Roboto 16"; }; }; }; - }; - # Make swaylock work - # https://github.com/NixOS/nixpkgs/issues/158025 - security.pam.services.swaylock = { }; + services.greetd = { + enable = true; + settings = { default_session.command = "cage -s -- regreet"; }; + }; + environment.systemPackages = with pkgs; [ + # Greeter packages + cage + config.programs.regreet.package + gnome.adwaita-icon-theme + ]; + }) + (mkIf nc.hyprland.enable { + # Turn on GDM for login + services.xserver = { + enable = true; + autorun = false; + # Enable plasma for the applications + desktopManager.plasma5.enable = true; + }; + # Setup drivers + hardware.opengl = { + # Enable vulkan + driSupport = true; + # Same as above, but enable 32 bit legacy support (for games) + driSupport32Bit = true; + }; + # Basic packages that are effectively required for a graphical system + environment.systemPackages = with pkgs; [ + # GTK Theming + gtk-engine-murrine + gtk_engines + gsettings-desktop-schemas + lxappearance + kde-gtk-config + (stdenv.mkDerivation rec { + pname = "sddm-sugar-dark-theme"; + version = "1.2"; + dontBuild = true; + installPhase = '' + mkdir -p $out/share/sddm/themes + cp -aR $src $out/share/sddm/themes/sugar-dark + ''; + src = fetchFromGitHub { + owner = "MarianArlt"; + repo = "sddm-sugar-dark"; + rev = "v${version}"; + sha256 = "0gx0am7vq1ywaw2rm1p015x90b75ccqxnb1sz3wy8yjl27v82yhb"; + }; + }) + ]; + qt.platformTheme = "qt5ct"; + # Enable and configure hyperland + programs.hyprland = { + enable = true; + xwayland = { + enable = true; + hidpi = false; + }; + }; + # Make swaylock work + # https://github.com/NixOS/nixpkgs/issues/158025 + security.pam.services.swaylock = { }; - environment.sessionVariables = { MOZ_ENABLE_WAYLAND = "1"; }; + environment.sessionVariables = { MOZ_ENABLE_WAYLAND = "1"; }; - }; + }) + ]; }