diff --git a/hosts/callisto/configuration.nix b/hosts/callisto/configuration.nix index a959887..b0f7f6e 100755 --- a/hosts/callisto/configuration.nix +++ b/hosts/callisto/configuration.nix @@ -27,7 +27,7 @@ theming = { enable = true; }; - desktop.greeter.enable = true; + desktop.enable = true; }; boot = { @@ -200,9 +200,6 @@ programs.dconf.enable = true; - programs.hyprland.enable = true; - # programs.hyprland.package = inputs.stablepkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system}.hyprland; - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave diff --git a/hosts/callisto/default.nix b/hosts/callisto/default.nix index 97308b1..b6d3f08 100644 --- a/hosts/callisto/default.nix +++ b/hosts/callisto/default.nix @@ -12,7 +12,7 @@ ../../modules/linux/fonts ../../modules/linux/greeter ../../modules/linux/core - ../../modules/linux/desktop-portal + ../../modules/linux/desktop-environment ../../modules/linux/stylix ../../overlays { diff --git a/modules/linux/desktop-environment/default.nix b/modules/linux/desktop-environment/default.nix new file mode 100644 index 0000000..4ad3246 --- /dev/null +++ b/modules/linux/desktop-environment/default.nix @@ -0,0 +1,30 @@ +{ + pkgs, + lib, + config, + ... +}: +let + cfg = config.liminalOS.desktop; +in +{ + options.liminalOS.desktop = { + enable = lib.mkEnableOption "liminalOS desktop environment with Hyprland and other utilities"; + hyprland.enable = lib.mkOption { + type = lib.types.bool; + default = cfg.enable; + description = '' + Whether to enable Hyprland. Sets up a default configuration at the system and user level, and installs xdg-desktop-portal-gtk. + ''; + }; + }; + + config = lib.mkIf cfg.enable { + xdg.portal = lib.mkIf cfg.hyprland.enable { + enable = true; + extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + }; + + programs.hyprland.enable = cfg.hyprland.enable; + }; +} diff --git a/modules/linux/desktop-portal/default.nix b/modules/linux/desktop-portal/default.nix deleted file mode 100644 index 80d4975..0000000 --- a/modules/linux/desktop-portal/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ pkgs, ... }: -{ - xdg.portal = { - enable = true; - extraPortals = with pkgs; [ xdg-desktop-portal-gtk ]; - }; -}