diff --git a/hosts/luci/nixos-config.nix b/hosts/luci/nixos-config.nix index 159340a..909c4f9 100644 --- a/hosts/luci/nixos-config.nix +++ b/hosts/luci/nixos-config.nix @@ -1,5 +1,4 @@ { ... }: { - config.modules.desktop.sway.enable = true; config.modules.gaming.steam.enable = false; config.modules.hardware.laptop.enable = true; } diff --git a/modules/home-manager/desktop/sway/default.nix b/modules/home-manager/desktop/sway/default.nix index 4ea96f4..1c0c8fe 100644 --- a/modules/home-manager/desktop/sway/default.nix +++ b/modules/home-manager/desktop/sway/default.nix @@ -123,11 +123,6 @@ in }; }; - # Avoid pixelated effect for QT application with fractionnal scaling - home.sessionVariables = { - QT_SCALE_FACTOR_ROUNDING_POLICY = "RoundPreferFloor"; - }; - qt = { enable = true; platformTheme = "gnome"; diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index 35e9b1d..a176c94 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -1,7 +1,6 @@ _: { imports = [ - ./desktop/sway ./gaming/steam ./hardware/laptop ]; diff --git a/modules/nixos/desktop/sway/default.nix b/modules/nixos/desktop/sway/default.nix deleted file mode 100644 index 5d65618..0000000 --- a/modules/nixos/desktop/sway/default.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ pkgs, lib, config, ... }: -with lib; -let - cfg = config.modules.desktop.sway; -in -{ - options.modules.desktop.sway = { - enable = mkEnableOption "Enable Steam Platform"; - }; - config = mkIf cfg.enable { - security.pam.services.swaylock = {}; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; - xdg.portal = { - enable = true; - wlr.enable = true; - # gtk portal needed to make gtk apps happy - extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; - config = { - common = { - default = [ - "gtk" - ]; - "org.freedesktop.impl.portal.ScreenCast" = "wlr"; - "org.freedesktop.impl.portal.Screenshot" = "wlr"; - }; - }; - }; - }; -} diff --git a/nixos/default.nix b/nixos/default.nix index ac970c6..190a786 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -1,19 +1,28 @@ { pkgs, lib, stateVersion, hostname, username, hostConfig, ... }: { - imports = [ # Include the results of the hardware scan. - ../hosts/${hostname}/hardware-configuration.nix - ../hosts/${hostname}/nixos-config.nix - ../modules/nixos - ./includes/hardware/bootloader.nix - ./includes/system/locales.nix - ./includes/system/flakes.nix - ./includes/system/user.nix - ./includes/system/udisks2.nix - ./includes/system/lvm.nix - ./includes/system/doas.nix - ./includes/system/neovim.nix - ./includes/system/overlay.nix - ]; + imports = + [ # Include the results of the hardware scan. + ../hosts/${hostname}/hardware-configuration.nix + ../hosts/${hostname}/nixos-config.nix + ../modules/nixos + ./includes/hardware/bootloader.nix + ./includes/system/locales.nix + ./includes/system/flakes.nix + ./includes/system/user.nix + ./includes/system/udisks2.nix + ./includes/system/lvm.nix + ./includes/system/doas.nix + ./includes/system/neovim.nix + ./includes/system/overlay.nix + ] ++ ( + if hostConfig.desktop then + [ + ./includes/desktop/swaylock.nix + ./includes/desktop/pipewire.nix + ./includes/desktop/xdg-portal.nix + ] + else [] + ); nixpkgs.config.allowUnfree = true; diff --git a/nixos/includes/desktop/pipewire.nix b/nixos/includes/desktop/pipewire.nix new file mode 100644 index 0000000..19c9744 --- /dev/null +++ b/nixos/includes/desktop/pipewire.nix @@ -0,0 +1,9 @@ +_: { + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; +} diff --git a/nixos/includes/desktop/swaylock.nix b/nixos/includes/desktop/swaylock.nix new file mode 100644 index 0000000..bc48c63 --- /dev/null +++ b/nixos/includes/desktop/swaylock.nix @@ -0,0 +1,3 @@ +_: { + security.pam.services.swaylock = {}; +} diff --git a/nixos/includes/desktop/xdg-portal.nix b/nixos/includes/desktop/xdg-portal.nix new file mode 100644 index 0000000..9d2b049 --- /dev/null +++ b/nixos/includes/desktop/xdg-portal.nix @@ -0,0 +1,18 @@ +{ pkgs, ...}: +{ + xdg.portal = { + enable = true; + wlr.enable = true; + # gtk portal needed to make gtk apps happy + extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + config = { + common = { + default = [ + "gtk" + ]; + "org.freedesktop.impl.portal.ScreenCast" = "wlr"; + "org.freedesktop.impl.portal.Screenshot" = "wlr"; + }; + }; + }; +}