From 17c78add1a8f0d08283c3175baf1bcd3d4a35511 Mon Sep 17 00:00:00 2001 From: Ayman Boukraa Date: Wed, 4 Mar 2026 19:38:02 +0100 Subject: [PATCH] feat: add niri and dms theme modules --- flake.nix | 7 -- home/base.nix | 2 + home/modules/dms.nix | 71 +++++++++++++++++ home/modules/niri.nix | 181 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 254 insertions(+), 7 deletions(-) create mode 100644 home/modules/dms.nix create mode 100644 home/modules/niri.nix diff --git a/flake.nix b/flake.nix index 1744930..a5d0a80 100644 --- a/flake.nix +++ b/flake.nix @@ -1,15 +1,12 @@ { description = "Ayman's Home Manager configuration"; - inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; - home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; }; - outputs = { nixpkgs, home-manager, ... }: let mkHome = { system, modules }: @@ -20,7 +17,6 @@ in { homeConfigurations = { - "ayman@archThinkpad" = mkHome { system = "x86_64-linux"; modules = [ @@ -28,7 +24,6 @@ ./home/profiles/notebook.nix ]; }; - "ayman@desktop" = mkHome { system = "x86_64-linux"; modules = [ @@ -36,7 +31,6 @@ ./home/profiles/desktop.nix ]; }; - "ayman@homelab-01" = mkHome { system = "x86_64-linux"; modules = [ @@ -44,7 +38,6 @@ ./home/profiles/server.nix ]; }; - }; }; } diff --git a/home/base.nix b/home/base.nix index ba00a07..90e1dbc 100644 --- a/home/base.nix +++ b/home/base.nix @@ -16,6 +16,8 @@ ./modules/git.nix ./modules/emacs.nix ./modules/env.nix + ./modules/dms.nix + ./modules/niri.nix ]; home.packages = with pkgs; [ diff --git a/home/modules/dms.nix b/home/modules/dms.nix new file mode 100644 index 0000000..85623f1 --- /dev/null +++ b/home/modules/dms.nix @@ -0,0 +1,71 @@ +{ config, lib, ... }: +let + c = config.theme.colors; + + dmsTheme = { + id = "gruvbox"; + name = "Gruvbox"; + version = "1.0.0"; + author = "ayman"; + description = "Gruvbox Dark Medium from theme.nix"; + dark = { + primary = c.green_b; + primaryContainer = c.green; + secondary = c.yellow; + surfaceText = c.fg; + surfaceVariantText = c.fg2; + backgroundText = c.fg; + outline = c.gray; + error = c.red_b; + warning = c.orange_b; + info = c.blue_b; + }; + light = { + primary = c.green; + primaryContainer = c.green_b; + secondary = c.yellow_b; + surfaceText = c.bg; + surfaceVariantText = c.bg1; + backgroundText = c.bg; + outline = c.bg4; + error = c.red; + warning = c.orange; + info = c.blue; + }; + variants = { + default = "medium"; + options = [ + { + id = "medium"; + name = "Medium"; + dark = { + primaryText = c.bg0_h; + surface = c.bg0_h; + surfaceVariant = c.bg; + surfaceTint = c.bg1; + background = c.bg; + surfaceContainer = c.bg0_s; + surfaceContainerHigh = c.bg1; + surfaceContainerHighest = c.bg2; + }; + light = { + primaryText = c.fg; + surface = c.fg; + surfaceVariant = c.fg1; + surfaceTint = c.fg2; + background = c.fg1; + surfaceContainer = c.fg2; + surfaceContainerHigh = c.fg3; + surfaceContainerHighest = c.fg4; + }; + } + ]; + }; + }; +in +{ + home.file.".config/DankMaterialShell/themes/gruvbox/theme.json" = { + text = builtins.toJSON dmsTheme; + force = true; + }; +} diff --git a/home/modules/niri.nix b/home/modules/niri.nix new file mode 100644 index 0000000..de3aa44 --- /dev/null +++ b/home/modules/niri.nix @@ -0,0 +1,181 @@ +{ config, lib, ... }: +let + c = config.theme.colors; +in +{ + home.file.".config/niri/config.kdl" = { + force = true; + text = '' + config-notification { + disable-failed + } + + gestures { + hot-corners { + off + } + } + + input { + keyboard { + xkb { } + numlock + } + touchpad { + tap + natural-scroll + } + mouse { } + trackpoint { } + } + + layout { + background-color "transparent" + center-focused-column "never" + preset-column-widths { + proportion 0.33333 + proportion 0.5 + proportion 0.66667 + } + default-column-width { proportion 0.5; } + border { + off + width 4 + active-color "#707070" + inactive-color "#d0d0d0" + urgent-color "${c.red_b}" + } + shadow { + softness 30 + spread 5 + offset x=0 y=5 + color "#0007" + } + struts { } + } + + layer-rule { + match namespace="^quickshell$" + place-within-backdrop true + } + + overview { + workspace-shadow { + off + } + } + + environment { + XDG_CURRENT_DESKTOP "niri" + } + + hotkey-overlay { + skip-at-startup + } + + prefer-no-csd + screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png" + + animations { + workspace-switch { + spring damping-ratio=0.80 stiffness=523 epsilon=0.0001 + } + window-open { + duration-ms 150 + curve "ease-out-expo" + } + window-close { + duration-ms 150 + curve "ease-out-quad" + } + horizontal-view-movement { + spring damping-ratio=0.85 stiffness=423 epsilon=0.0001 + } + window-movement { + spring damping-ratio=0.75 stiffness=323 epsilon=0.0001 + } + window-resize { + spring damping-ratio=0.85 stiffness=423 epsilon=0.0001 + } + config-notification-open-close { + spring damping-ratio=0.65 stiffness=923 epsilon=0.001 + } + screenshot-ui-open { + duration-ms 200 + curve "ease-out-quad" + } + overview-open-close { + spring damping-ratio=0.85 stiffness=800 epsilon=0.0001 + } + } + + window-rule { + match app-id=r#"^org\.wezfurlong\.wezterm$"# + default-column-width {} + } + window-rule { + match app-id=r#"^org\.gnome\."# + draw-border-with-background false + geometry-corner-radius 12 + clip-to-geometry true + } + window-rule { + match app-id=r#"^gnome-control-center$"# + match app-id=r#"^pavucontrol$"# + match app-id=r#"^nm-connection-editor$"# + default-column-width { proportion 0.5; } + open-floating false + } + window-rule { + match app-id=r#"^gnome-calculator$"# + match app-id=r#"^galculator$"# + match app-id=r#"^blueman-manager$"# + match app-id=r#"^org\.gnome\.Nautilus$"# + match app-id=r#"^xdg-desktop-portal$"# + open-floating true + } + window-rule { + match app-id=r#"^steam$"# title=r#"^notificationtoasts_\d+_desktop$"# + default-floating-position x=10 y=10 relative-to="bottom-right" + open-focused false + } + window-rule { + match app-id=r#"^org\.wezfurlong\.wezterm$"# + match app-id="Alacritty" + match app-id="zen" + match app-id="com.mitchellh.ghostty" + match app-id="kitty" + draw-border-with-background false + } + window-rule { + match app-id=r#"firefox$"# title="^Picture-in-Picture$" + match app-id="zoom" + open-floating true + } + window-rule { + match app-id=r#"org.quickshell$"# + open-floating true + } + + recent-windows { + binds { + Alt+Tab { next-window scope="output"; } + Alt+Shift+Tab { previous-window scope="output"; } + Alt+grave { next-window filter="app-id"; } + Alt+Shift+grave { previous-window filter="app-id"; } + } + } + + debug { + honor-xdg-activation-with-invalid-serial + } + + include "dms/colors.kdl" + include "dms/layout.kdl" + include "dms/alttab.kdl" + include "dms/binds.kdl" + include "dms/outputs.kdl" + include "dms/cursor.kdl" + ''; + }; +}