diff options
| author | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-08-02 18:18:07 +0530 |
|---|---|---|
| committer | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-08-02 18:18:07 +0530 |
| commit | 2e0f6163f61cb1e4195f1a08ad1148e57a4f5843 (patch) | |
| tree | c844351a0d22cb8a68d84b91630612b9c486abca /modules/desktop | |
| parent | d213c8b40f891bd83f2977f89b25ca341ee01ca4 (diff) | |
| download | home-manager-config-2e0f6163f61cb1e4195f1a08ad1148e57a4f5843.tar.gz home-manager-config-2e0f6163f61cb1e4195f1a08ad1148e57a4f5843.zip | |
feat: Added package option to each module, darkman service
- Added package options to each module which defines the
package/derivation that should be used in all other modules
- Added a systemd oneshot service that autosets darkman to dark mode
- Removed the prompt from rofi
Diffstat (limited to 'modules/desktop')
| -rw-r--r-- | modules/desktop/darkman/default.nix | 28 | ||||
| -rw-r--r-- | modules/desktop/hyprland/keybindings.nix | 2 | ||||
| -rw-r--r-- | modules/desktop/rofi/default.nix | 10 | ||||
| -rw-r--r-- | modules/desktop/rofi/theme.mustache.rasi | 217 | ||||
| -rw-r--r-- | modules/desktop/waybar/default.nix | 9 |
5 files changed, 141 insertions, 125 deletions
diff --git a/modules/desktop/darkman/default.nix b/modules/desktop/darkman/default.nix index 4aef68d..9dc7ef9 100644 --- a/modules/desktop/darkman/default.nix +++ b/modules/desktop/darkman/default.nix @@ -7,12 +7,15 @@ }: { options.desktop.darkman = { - enable = lib.mkEnableOption "Enables darkman automatic dark/light mode switching." // { - default = true; + package = lib.mkOption { + type = lib.types.package; + readOnly = true; + default = config.services.darkman.package; + description = "The darkman package to use."; }; }; - config = lib.mkIf (config.desktop.enable && config.desktop.darkman.enable) { + config = lib.mkIf config.desktop.enable { services.darkman = { enable = true; settings = { @@ -32,8 +35,21 @@ }; # Always dark by default - home.activation.forceDarkman = lib.hm.dag.entryAfter [ "writeBoundary" ] '' - ${pkgs.darkman}/bin/darkman set dark || true - ''; + systemd.user.services.darkman-set-theme = { + Unit = { + Description = "Set Darkman to dark on graphical session startup"; + PartOf = [ "graphical-session.target" ]; + After = [ "graphical-session.target" ]; + }; + + Service = { + Type = "oneshot"; + ExecStart = "${lib.getExe config.desktop.darkman.package} set dark"; + }; + + Install = { + WantedBy = [ "graphical-session.target" ]; + }; + }; }; } diff --git a/modules/desktop/hyprland/keybindings.nix b/modules/desktop/hyprland/keybindings.nix index 1ac1d9a..3bc5ad3 100644 --- a/modules/desktop/hyprland/keybindings.nix +++ b/modules/desktop/hyprland/keybindings.nix @@ -38,7 +38,7 @@ in (bindMouse "mouse:272" "hl.dsp.window.drag()") # mainMod + LMB drag: move (bindMouse "mouse:273" "hl.dsp.window.resize()") # mainMod + RMB drag: resize - (lib.optionals config.desktop.rofi.enable [ + (lib.optionals config.desktop.enable [ (bind "R" (execLua "${lib.getExe config.desktop.rofi.package} -show drun")) ]) (lib.optionals config.terminal.kitty.enable [ diff --git a/modules/desktop/rofi/default.nix b/modules/desktop/rofi/default.nix index 797cbe9..d40ccbb 100644 --- a/modules/desktop/rofi/default.nix +++ b/modules/desktop/rofi/default.nix @@ -5,20 +5,17 @@ }: { options.desktop.rofi = { - enable = lib.mkEnableOption "Enables rofi launcher." // { - default = true; - }; package = lib.mkOption { type = lib.types.package; + readOnly = true; + default = config.programs.rofi.finalPackage; description = "The rofi package to use."; }; }; config = lib.mkIf config.desktop.enable { - desktop.rofi.package = lib.mkDefault config.programs.rofi.finalPackage; - programs.rofi = { - enable = config.desktop.rofi.enable; + enable = true; theme = "${config.scheme { template = builtins.readFile ./theme.mustache.rasi; extension = ".rasi"; @@ -27,7 +24,6 @@ modi = "drun"; show-icons = true; drun-display-format = "{name}"; - display-drun = "Launch"; sort = true; }; }; diff --git a/modules/desktop/rofi/theme.mustache.rasi b/modules/desktop/rofi/theme.mustache.rasi index 0dd08f8..9d161ec 100644 --- a/modules/desktop/rofi/theme.mustache.rasi +++ b/modules/desktop/rofi/theme.mustache.rasi @@ -21,166 +21,161 @@ */ * { - base00: #{{base00}}; - base01: #{{base01}}; - base02: #{{base02}}; - base03: #{{base03}}; - base04: #{{base04}}; - base05: #{{base05}}; - base06: #{{base06}}; - base07: #{{base07}}; - base08: #{{base08}}; - base09: #{{base09}}; - base0A: #{{base0A}}; - base0B: #{{base0B}}; - base0C: #{{base0C}}; - base0D: #{{base0D}}; - base0E: #{{base0E}}; - base0F: #{{base0F}}; - - background: @base00; - background-color: transparent; - foreground: @base07; - - border-color: @base07; - separatorcolor: @base02; - - selected-normal-background: @base00; - selected-normal-foreground: @base07; - selected-active-background: @base00; - selected-active-foreground: @base07; - selected-urgent-background: @base00; - selected-urgent-foreground: @base0F; - - normal-background: @base00; - normal-foreground: @base03; - active-background: @base00; - active-foreground: @base07; - urgent-background: @base00; - urgent-foreground: @base08; - - font: "FiraCode Nerd Font Bold 18"; + base00: #{{base00}}; + base01: #{{base01}}; + base02: #{{base02}}; + base03: #{{base03}}; + base04: #{{base04}}; + base05: #{{base05}}; + base06: #{{base06}}; + base07: #{{base07}}; + base08: #{{base08}}; + base09: #{{base09}}; + base0A: #{{base0A}}; + base0B: #{{base0B}}; + base0C: #{{base0C}}; + base0D: #{{base0D}}; + base0E: #{{base0E}}; + base0F: #{{base0F}}; + + background: @base00; + background-color: transparent; + foreground: @base07; + + border-color: @base07; + separatorcolor: @base02; + + selected-normal-background: @base00; + selected-normal-foreground: @base07; + selected-active-background: @base00; + selected-active-foreground: @base07; + selected-urgent-background: @base00; + selected-urgent-foreground: @base0F; + + normal-background: @base00; + normal-foreground: @base03; + active-background: @base00; + active-foreground: @base07; + urgent-background: @base00; + urgent-foreground: @base08; + + font: "FiraCode Nerd Font Bold 18"; } window { - background-color: @background; - border: 1px; - border-color: @border-color; - padding: 0; - width: 800px; - location: center; - anchor: center; + background-color: @background; + border: 1px; + border-color: @border-color; + padding: 0; + width: 800px; + location: center; + anchor: center; } mainbox { - background-color: transparent; - padding: 12px; - spacing: 12px; - children: [ "inputbar", "listview" ]; + background-color: transparent; + padding: 12px; + spacing: 12px; + children: [ "inputbar", "listview", "message" ]; } inputbar { - background-color: @background; - text-color: @foreground; - border: 1px; - border-color: @border-color; - padding: 10px 14px; - spacing: 10px; - children: [ "prompt", "entry" ]; - font: @font; -} - -prompt { - background-color: transparent; - text-color: @base0D; - font: @font; + background-color: @background; + text-color: @foreground; + border: 1px; + border-color: @border-color; + padding: 10px 14px; + spacing: 10px; + children: [ "entry" ]; + font: @font; } entry { - background-color: transparent; - text-color: @foreground; - placeholder: "Search…"; - placeholder-color: @base03; - cursor: text; - font: @font; + background-color: transparent; + text-color: @foreground; + placeholder: "Search…"; + placeholder-color: @base03; + cursor: text; + font: @font; } listview { - background-color: transparent; - columns: 1; - lines: 8; - spacing: 4px; - cycle: true; - dynamic: true; - scrollbar: false; - fixed-height: false; + background-color: transparent; + columns: 1; + lines: 8; + spacing: 4px; + cycle: true; + dynamic: true; + scrollbar: false; + fixed-height: false; } element { - background-color: transparent; - text-color: @normal-foreground; - padding: 8px 10px; - spacing: 10px; - orientation: horizontal; + background-color: transparent; + text-color: @normal-foreground; + padding: 8px 10px; + spacing: 10px; + orientation: horizontal; } element normal.normal { - background-color: @normal-background; - text-color: @normal-foreground; + background-color: @normal-background; + text-color: @normal-foreground; } element normal.active { - background-color: @active-background; - text-color: @active-foreground; + background-color: @active-background; + text-color: @active-foreground; } element normal.urgent { - background-color: @urgent-background; - text-color: @urgent-foreground; + background-color: @urgent-background; + text-color: @urgent-foreground; } element selected.normal { - background-color: @selected-normal-background; - text-color: @selected-normal-foreground; + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; } element selected.active { - background-color: @selected-active-background; - text-color: @selected-active-foreground; + background-color: @selected-active-background; + text-color: @selected-active-foreground; } element selected.urgent { - background-color: @selected-urgent-background; - text-color: @selected-urgent-foreground; + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; } element-icon { - background-color: transparent; - size: 36px; - vertical-align: 0.5; + background-color: transparent; + size: 36px; + vertical-align: 0.5; } element-text { - background-color: transparent; - text-color: inherit; - vertical-align: 0.5; - horizontal-align: 0.0; + background-color: transparent; + text-color: inherit; + vertical-align: 0.5; + horizontal-align: 0.0; } message { - background-color: @base01; - padding: 8px 12px; + background-color: @base00; + padding: 8px 12px; } textbox { - background-color: transparent; - text-color: @foreground; + background-color: transparent; + text-color: @foreground; + font: "FiraCode Nerd Font Bold 14"; } error-message { - background-color: @base00; - text-color: @base08; - border: 1.5px; - border-color: @base08; - padding: 10px; + background-color: @base00; + text-color: @base08; + border: 1.5px; + border-color: @base08; + padding: 10px; } diff --git a/modules/desktop/waybar/default.nix b/modules/desktop/waybar/default.nix index 9872086..927d76f 100644 --- a/modules/desktop/waybar/default.nix +++ b/modules/desktop/waybar/default.nix @@ -5,6 +5,15 @@ ... }: { + options.desktop.waybar = { + package = lib.mkOption { + type = lib.types.package; + readOnly = true; + default = config.programs.waybar.package; + description = "The waybar package to use."; + }; + }; + config = lib.mkIf config.desktop.enable { programs.waybar = { enable = true; |
