|
| 1 | +# *.nix |
| 2 | +{ inputs, lib, ... }: |
| 3 | +let |
| 4 | + inherit (lib) |
| 5 | + types |
| 6 | + mkIf |
| 7 | + mkOption |
| 8 | + mkEnableOption |
| 9 | + ; |
| 10 | + # Shorthand lambda for self-documenting options under settings |
| 11 | + mkStrOption = |
| 12 | + default: |
| 13 | + mkOption { |
| 14 | + type = types.str; |
| 15 | + default = default; |
| 16 | + }; |
| 17 | + mkIntOption = |
| 18 | + default: |
| 19 | + mkOption { |
| 20 | + type = types.int; |
| 21 | + default = default; |
| 22 | + }; |
| 23 | + mkBoolOption = |
| 24 | + default: |
| 25 | + mkOption { |
| 26 | + type = types.bool; |
| 27 | + default = default; |
| 28 | + }; |
| 29 | + mkStrListOption = |
| 30 | + default: |
| 31 | + mkOption { |
| 32 | + type = types.listOf types.str; |
| 33 | + default = default; |
| 34 | + }; |
| 35 | + mkFloatOption = |
| 36 | + default: |
| 37 | + mkOption { |
| 38 | + type = types.float; |
| 39 | + default = default; |
| 40 | + }; |
| 41 | +in |
| 42 | +{ |
| 43 | + imports = [ inputs.hyprpanel.homeManagerModules.hyprpanel ]; |
| 44 | + |
| 45 | + programs.hyprpanel = { |
| 46 | + overlay.enable = true; |
| 47 | + |
| 48 | + # Enable the module. |
| 49 | + # Default: false |
| 50 | + enable = true; |
| 51 | + |
| 52 | + # Automatically restart HyprPanel with systemd. |
| 53 | + # Useful when updating your config so that you |
| 54 | + # don't need to manually restart it. |
| 55 | + # Default: false |
| 56 | + systemd.enable = true; |
| 57 | + |
| 58 | + # Add '/nix/store/.../hyprpanel' to your |
| 59 | + # Hyprland config 'exec-once'. |
| 60 | + # Default: false |
| 61 | + hyprland.enable = true; |
| 62 | + |
| 63 | + # Fix the overwrite issue with HyprPanel. |
| 64 | + # See below for more information. |
| 65 | + # Default: false |
| 66 | + overwrite.enable = true; |
| 67 | + |
| 68 | + # Import a theme from './themes/*.json'. |
| 69 | + # Default: "" |
| 70 | + # theme = "gruvbox_split"; |
| 71 | + |
| 72 | + # Override the final config with an arbitrary set. |
| 73 | + # Useful for overriding colors in your selected theme. |
| 74 | + # Default: {} |
| 75 | + # override = { |
| 76 | + # theme.bar.menus.text = "#123ABC"; |
| 77 | + # }; |
| 78 | + |
| 79 | + # Configure bar layouts for monitors. |
| 80 | + # See 'https://hyprpanel.com/configuration/panel.html'. |
| 81 | + # Default: null |
| 82 | + layout = { |
| 83 | + "bar.layouts" = { |
| 84 | + "0" = { |
| 85 | + left = [ |
| 86 | + "dashboard" |
| 87 | + "workspaces" |
| 88 | + "windowtitle" |
| 89 | + ]; |
| 90 | + middle = [ "media" ]; |
| 91 | + right = [ |
| 92 | + "volume" |
| 93 | + "network" |
| 94 | + "bluetooth" |
| 95 | + "battery" |
| 96 | + "systray" |
| 97 | + "clock" |
| 98 | + "notifications" |
| 99 | + ]; |
| 100 | + }; |
| 101 | + }; |
| 102 | + }; |
| 103 | + |
| 104 | + # Configure and theme almost all options from the GUI. |
| 105 | + # Options that require '{}' or '[]' are not yet implemented, |
| 106 | + # except for the layout above. |
| 107 | + # See 'https://hyprpanel.com/configuration/settings.html'. |
| 108 | + # Default: <same as gui> |
| 109 | + settings = { |
| 110 | + bar.launcher.autoDetectIcon = true; |
| 111 | + bar.workspaces.show_icons = true; |
| 112 | + bar.clock.format = "%a %b %d %I:%M:%S %p"; |
| 113 | + bar.clock.icon = ""; |
| 114 | + bar.clock.middleClick = ""; |
| 115 | + bar.clock.rightClick = ""; |
| 116 | + bar.clock.scrollDown = ""; |
| 117 | + bar.clock.scrollUp = ""; |
| 118 | + bar.clock.showIcon = true; |
| 119 | + bar.clock.showTime = true; |
| 120 | + |
| 121 | + menus.clock = { |
| 122 | + time = { |
| 123 | + military = true; |
| 124 | + hideSeconds = true; |
| 125 | + }; |
| 126 | + # weather.unit = "metric"; |
| 127 | + }; |
| 128 | + |
| 129 | + menus.dashboard.directories.enabled = false; |
| 130 | + menus.dashboard.stats.enable_gpu = false; |
| 131 | + |
| 132 | + theme.bar.transparent = true; |
| 133 | + |
| 134 | + theme.font = { |
| 135 | + name = "Ubuntu Nerd Font Regular"; |
| 136 | + size = "1.0rem"; |
| 137 | + }; |
| 138 | + }; |
| 139 | + }; |
| 140 | +} |
0 commit comments