From 14d8fba7690258800e05874ea957e55192d1eb90 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Mon, 5 Aug 2024 14:49:37 +0100 Subject: [PATCH] Enable xserver so X11 forwarding works properly Enable autoLogin with sddm/plasma Move some environment variable definitions around --- flake.nix | 2 +- system/desktop/default.nix | 14 +++----------- system/desktop/plasma.nix | 14 ++++++++++---- system/desktop/sway.nix | 5 ++++- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/flake.nix b/flake.nix index 5a74e585..5eef335f 100644 --- a/flake.nix +++ b/flake.nix @@ -113,7 +113,7 @@ package = pkgs.nixVersions.latest; settings.trusted-users = [ username ]; }; - services.greetd.settings.initial_session.user = username; + services.displayManager.autoLogin.user = username; programs.${loginShell} = lib.mkIf (loginShell != "bash") { enable = true; }; users.users.${username} = { shell = pkgs.${loginShell}; diff --git a/system/desktop/default.nix b/system/desktop/default.nix index a288f465..97530d0c 100644 --- a/system/desktop/default.nix +++ b/system/desktop/default.nix @@ -1,18 +1,10 @@ -{ - config, - lib, - pkgs, - ... -}: +{ pkgs, ... }: { nixpkgs.config.chromium.commandLineArgs = "--enable-features=UseOzonePlatform --ozone-platform=wayland"; system.autoUpgrade.operation = "boot"; hardware.bluetooth.enable = true; environment = { - sessionVariables = { - NIXOS_OZONE_WL = "1"; - QT_QPA_PLATFORM = lib.mkIf config.programs.sway.enable "wayland"; - }; + sessionVariables.NIXOS_OZONE_WL = "1"; systemPackages = with pkgs; [ libsecret libnotify @@ -55,7 +47,7 @@ }; }; xserver = { - enable = false; + enable = true; xkb = { layout = "gb"; variant = ""; diff --git a/system/desktop/plasma.nix b/system/desktop/plasma.nix index f1048447..1aa576ae 100644 --- a/system/desktop/plasma.nix +++ b/system/desktop/plasma.nix @@ -1,11 +1,17 @@ { pkgs, ... }: { imports = [ ./default.nix ]; - environment.plasma6.excludePackages = with pkgs.kdePackages; [ plasma-browser-integration ]; + environment = { + plasma6.excludePackages = with pkgs.kdePackages; [ plasma-browser-integration ]; + sessionVariables.QT_QPA_PLATFORM = "wayland"; + }; services = { - displayManager.sddm = { - enable = true; - wayland.enable = true; + displayManager = { + autoLogin.enable = true; + sddm = { + enable = true; + wayland.enable = true; + }; }; desktopManager.plasma6 = { enable = true; diff --git a/system/desktop/sway.nix b/system/desktop/sway.nix index 44348235..45db7f54 100644 --- a/system/desktop/sway.nix +++ b/system/desktop/sway.nix @@ -2,7 +2,10 @@ { imports = [ ./default.nix ]; environment = { - sessionVariables.GRIM_DEFAULT_DIR = "$HOME/Pictures/Grim"; + sessionVariables = { + QT_QPA_PLATFORM = "wayland"; + GRIM_DEFAULT_DIR = "$HOME/Pictures/Grim"; + }; systemPackages = with pkgs; [ wtype wl-clipboard