From 3a3d1e6cdf63cf77aa7cf7f6c74c78a1cd277fa1 Mon Sep 17 00:00:00 2001 From: punkfairie Date: Mon, 26 May 2025 16:07:17 -0700 Subject: [PATCH] feat: niri --- hosts/nyx/default.nix | 2 + modules/home/profiles.nix | 2 +- modules/home/shell/default.nix | 2 + .../home/shell/niri.nix | 46 +++++++++++-------- modules/nixos/shell/niri.nix | 2 + .../homes/x86_64-linux/marley@nyx/default.nix | 14 ------ 6 files changed, 33 insertions(+), 35 deletions(-) rename snowflake/modules/home/wayland/niri/default.nix => modules/home/shell/niri.nix (87%) delete mode 100644 snowflake/homes/x86_64-linux/marley@nyx/default.nix diff --git a/hosts/nyx/default.nix b/hosts/nyx/default.nix index 09cd4b8..f4e54f1 100644 --- a/hosts/nyx/default.nix +++ b/hosts/nyx/default.nix @@ -22,6 +22,8 @@ in { }; home-manager.users."${name}" = { + marleyos.shell.niri.monitors = ["DP-1" "HDMI-A-1"]; + home.stateVersion = "24.05"; }; diff --git a/modules/home/profiles.nix b/modules/home/profiles.nix index b78652b..6c09c4d 100644 --- a/modules/home/profiles.nix +++ b/modules/home/profiles.nix @@ -19,7 +19,7 @@ in { # # Graphical Desktop - - - - - - - - - - - - - - - - - - - - - - - - - - - - (lib.optionalAttrs cfg.desktop { - shell.wayland = enabled; + shell.niri = enabled; }) # # diff --git a/modules/home/shell/default.nix b/modules/home/shell/default.nix index 7b59eae..50ef8fa 100644 --- a/modules/home/shell/default.nix +++ b/modules/home/shell/default.nix @@ -3,7 +3,9 @@ ./stylix.nix ./xorg.nix + ./wayland.nix + ./niri.nix ./gtk.nix ./qt.nix diff --git a/snowflake/modules/home/wayland/niri/default.nix b/modules/home/shell/niri.nix similarity index 87% rename from snowflake/modules/home/wayland/niri/default.nix rename to modules/home/shell/niri.nix index 4a83be1..5278f56 100644 --- a/snowflake/modules/home/wayland/niri/default.nix +++ b/modules/home/shell/niri.nix @@ -1,12 +1,18 @@ { - lib, + marleylib, config, + osConfig, + lib, + pkgs, ... }: let - cfg = config.marleyos.wayland.niri; + inherit (marleylib.module) mkEnableOption' enabled; + + cfg = config.marleyos.shell.niri; + osCfg = osConfig.marleyos.shell.niri; in { - options.marleyos.wayland.niri = { - enable = lib.mkEnableOption "niri"; + options.marleyos.shell.niri = { + enable = mkEnableOption' "niri" osCfg.enable; monitors = lib.mkOption { type = with lib.types; nullOr (listOf str); @@ -15,20 +21,19 @@ in { }; }; - config = lib.mkIf cfg.enable { + config = lib.mkIf (cfg.enable && pkgs.stdenv.isLinux) { marleyos = { - wayland.enable = true; - - programs = { - waybar.enable = true; - wlogout.enable = true; - fuzzel.enable = true; - xwayland-satellite.enable = true; - }; - services = { - swaybg.enable = true; - swaync.enable = true; - }; + shell.wayland = enabled; + # programs = { + # waybar = enabled; + # wlogout = enabled; + # fuzzel = enabled; + # xwayland-satellite = enabled; + # }; + # services = { + # swaybg = enabled; + # swaync = enabled; + # }; }; programs.niri = { @@ -48,7 +53,7 @@ in { ### Startup Programs ### spawn-at-startup = let - inherit (config.marleyos) apps; + inherit (config.marleycfg) apps; in [ {command = ["sh" "-c" "${lib.getExe apps.terminal} -e tmux new -s main -A"];} (cmd (lib.getExe apps.browser)) @@ -95,7 +100,7 @@ in { }; ### Screenshots ### - screenshot-path = "~/pictures/screenshots/%Y-%m-%d %H-%M-%S.png"; + screenshot-path = "~/${config.xdg.userDirs.pictures}/screenshots/%Y-%m-%d %H-%M-%S.png"; ### Workspaces ### workspaces = { @@ -128,6 +133,7 @@ in { title = "^Picture-in-Picture$"; } {title = "^Picture in picture$";} + {title = "Bitwarden";} ]; open-floating = true; } @@ -164,7 +170,7 @@ in { "Ctrl+Alt+Delete".action = quit; "Mod+Shift+Slash".action = show-hotkey-overlay; - "Mod+Return".action = spawn (lib.getExe config.marleyos.apps.terminal); + "Mod+Return".action = spawn (lib.getExe config.marleycfg.apps.terminal); "Mod+R".action = spawn (lib.getExe config.programs.fuzzel.package); "Mod+H".action = focus-column-or-monitor-left; diff --git a/modules/nixos/shell/niri.nix b/modules/nixos/shell/niri.nix index e4d8674..069d7aa 100644 --- a/modules/nixos/shell/niri.nix +++ b/modules/nixos/shell/niri.nix @@ -11,6 +11,8 @@ in { imports = [inputs.niri-flake.nixosModules.niri]; config = lib.mkIf cfg.enable { + marleyos.shell.hyprlock.enable = true; + programs.niri = { enable = true; }; diff --git a/snowflake/homes/x86_64-linux/marley@nyx/default.nix b/snowflake/homes/x86_64-linux/marley@nyx/default.nix deleted file mode 100644 index ae4cc0d..0000000 --- a/snowflake/homes/x86_64-linux/marley@nyx/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{lib, ...}: let - inherit (lib.marleyos) enabled; -in { - marleyos = { - bundles.desktop = enabled; - - wayland.niri = { - enable = true; - monitors = ["DP-1" "HDMI-A-1"]; - }; - }; - - home.stateVersion = "24.05"; -}