From b65ddebc66c64bda084e0425c903f14bd52394e5 Mon Sep 17 00:00:00 2001 From: Ayman Boukraa Date: Wed, 4 Mar 2026 20:31:12 +0100 Subject: [PATCH] refactor: wayland module, move emacs path to emacs.nix, neovim to base --- home/base.nix | 2 ++ home/modules/emacs.nix | 6 +++--- home/modules/wayland.nix | 19 +++++++++++++++++++ home/profiles/desktop.nix | 25 ++----------------------- home/profiles/notebook.nix | 23 +---------------------- home/profiles/server.nix | 7 ++++--- 6 files changed, 31 insertions(+), 51 deletions(-) create mode 100644 home/modules/wayland.nix diff --git a/home/base.nix b/home/base.nix index 1f48cc0..5dd38d0 100644 --- a/home/base.nix +++ b/home/base.nix @@ -10,6 +10,8 @@ ./modules/starship.nix ./modules/git.nix ./modules/env.nix + ./modules/neovim.nix + ./modules/wayland.nix ]; home.packages = with pkgs; [ ripgrep diff --git a/home/modules/emacs.nix b/home/modules/emacs.nix index 11c54a8..f112b38 100644 --- a/home/modules/emacs.nix +++ b/home/modules/emacs.nix @@ -1,6 +1,8 @@ { pkgs, ... }: - { + home.sessionPath = [ + "$HOME/.config/emacs/bin" + ]; home.packages = with pkgs; [ ripgrep fd @@ -11,13 +13,11 @@ shellcheck shfmt ]; - # Symlink doom config into place xdg.configFile."doom" = { source = ../../config/doom; recursive = true; }; - # Emacs daemon service pointing directly to system Emacs systemd.user.services.emacs = { Unit = { diff --git a/home/modules/wayland.nix b/home/modules/wayland.nix new file mode 100644 index 0000000..951ad6e --- /dev/null +++ b/home/modules/wayland.nix @@ -0,0 +1,19 @@ +{ lib, config, ... }: +{ + options.myConfig.wayland.enable = lib.mkEnableOption "Wayland desktop environment"; + + config = lib.mkIf config.myConfig.wayland.enable { + systemd.user.sessionVariables = { + TERMINAL = "kitty"; + EDITOR = "emacsclient -c -a nvim"; + VISUAL = "emacsclient -c -a nvim"; + ELECTRON_OZONE_PLATFORM_HINT = "auto"; + NIXOS_OZONE_WL = "1"; + MOZ_ENABLE_WAYLAND = "1"; + QT_QPA_PLATFORM = "wayland"; + GDK_BACKEND = "wayland"; + SDL_VIDEODRIVER = "wayland"; + _JAVA_AWT_WM_NONREPARENTING = "1"; + }; + }; +} diff --git a/home/profiles/desktop.nix b/home/profiles/desktop.nix index 8b84462..3a10105 100644 --- a/home/profiles/desktop.nix +++ b/home/profiles/desktop.nix @@ -1,28 +1,7 @@ { pkgs, ... }: { - imports = [ - ../modules/kitty.nix - ../modules/neovim.nix - ../modules/emacs.nix - ../modules/niri.nix - ../modules/dms.nix - ]; - home.sessionPath = [ - "$HOME/.config/emacs/bin" - ]; - systemd.user.sessionVariables = { - TERMINAL = "kitty"; - EDITOR = "emacsclient -c -a nvim"; - VISUAL = "emacsclient -c -a nvim"; - ELECTRON_OZONE_PLATFORM_HINT = "auto"; - NIXOS_OZONE_WL = "1"; - MOZ_ENABLE_WAYLAND = "1"; - QT_QPA_PLATFORM = "wayland"; - GDK_BACKEND = "wayland"; - SDL_VIDEODRIVER = "wayland"; - _JAVA_AWT_WM_NONREPARENTING = "1"; - }; + myConfig.wayland.enable = true; home.packages = with pkgs; [ - # add desktop-specific packages here + # desktop specific packages ]; } diff --git a/home/profiles/notebook.nix b/home/profiles/notebook.nix index 36448d9..a32fa95 100644 --- a/home/profiles/notebook.nix +++ b/home/profiles/notebook.nix @@ -1,27 +1,6 @@ { pkgs, ... }: { - imports = [ - ../modules/kitty.nix - ../modules/neovim.nix - ../modules/emacs.nix - ../modules/niri.nix - ../modules/dms.nix - ]; - home.sessionPath = [ - "$HOME/.config/emacs/bin" - ]; - systemd.user.sessionVariables = { - TERMINAL = "kitty"; - EDITOR = "emacsclient -c -a nvim"; - VISUAL = "emacsclient -c -a nvim"; - ELECTRON_OZONE_PLATFORM_HINT = "auto"; - NIXOS_OZONE_WL = "1"; - MOZ_ENABLE_WAYLAND = "1"; - QT_QPA_PLATFORM = "wayland"; - GDK_BACKEND = "wayland"; - SDL_VIDEODRIVER = "wayland"; - _JAVA_AWT_WM_NONREPARENTING = "1"; - }; + myConfig.wayland.enable = true; home.packages = with pkgs; [ powertop acpi diff --git a/home/profiles/server.nix b/home/profiles/server.nix index 103a3ba..69b4b35 100644 --- a/home/profiles/server.nix +++ b/home/profiles/server.nix @@ -1,8 +1,9 @@ { pkgs, ... }: - { - # Minimal — no GUI packages + imports = [ +# + ]; home.packages = with pkgs; [ - neovim + # server specific packages ]; }