Skip to content

Commit bd9d48d

Browse files
authored
Merge pull request #6 from benvonh/master
Add Home Manager module quick guide
2 parents 79d2fda + b3c8d09 commit bd9d48d

File tree

1 file changed

+112
-0
lines changed

1 file changed

+112
-0
lines changed

docs/getting_started/installation.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,118 @@ Once you've set up the overlay, you can reference HyprPanel with `pkgs.hyprpanel
205205

206206
**Make sure to** place `pkgs.hyprpanel` in `environment.systemPackages` or `home.packages`.
207207

208+
#### Home Manager module
209+
210+
If you want to configure HyprPanel with the Home Manager module instead, read from this section.
211+
212+
First, as with the overlay method, add HyprPanel to your flake.
213+
```nix
214+
# flake.nix
215+
{
216+
inputs = {
217+
hyprpanel.url = "github:jas-singhfsu/hyprpanel";
218+
# Good practice to ensure packages in HyprPanel
219+
# are the same version as your system packages
220+
# like when running `swww` from a keybind.
221+
hyprpanel.inputs.nixpkgs.follows = "nixpkgs";
222+
};
223+
224+
# ...
225+
}
226+
```
227+
228+
Next, import the Home Manager module and configure it as you wish.
229+
Below is an example of some of the options that are available.
230+
```nix
231+
# *.nix
232+
{ inputs, ... }:
233+
{
234+
imports = [ inputs.hyprpanel.homeManagerModules.hyprpanel ];
235+
236+
programs.hyprpanel = {
237+
238+
# Enable the module.
239+
# Default: false
240+
enable = true;
241+
242+
# Automatically restart HyprPanel with systemd.
243+
# Useful when updating your config so that you
244+
# don't need to manually restart it.
245+
# Default: false
246+
systemd.enable = true;
247+
248+
# Add '/nix/store/.../hyprpanel' to the
249+
# 'exec-once' in your Hyprland config.
250+
# Default: false
251+
hyprland.enable = true;
252+
253+
# Fix the overwrite issue with HyprPanel.
254+
# See below for more information.
255+
# Default: false
256+
overwrite.enable = true;
257+
258+
# Import a specific theme from './themes/*.json'.
259+
# Default: ""
260+
theme = "gruvbox_split";
261+
262+
# Configure bar layouts for monitors.
263+
# See 'https://hyprpanel.com/configuration/panel.html'.
264+
# Default: null
265+
layout = {
266+
"bar.layouts" = {
267+
"0" = {
268+
left = [ "dashboard" "workspaces" ];
269+
middle = [ "media" ];
270+
right = [ "volume" "systray" "notifications" ];
271+
};
272+
};
273+
};
274+
275+
# Configure and theme *most* of the options from the GUI.
276+
# See './nix/module.nix:103'.
277+
# Default: <same as gui>
278+
settings = {
279+
bar.launcher.autoDetectIcon = true;
280+
bar.workspaces.show_icons = true;
281+
282+
menus.clock = {
283+
time = {
284+
military = true;
285+
hideSeconds = true;
286+
};
287+
weather.unit = "metric";
288+
};
289+
290+
menus.dashboard.directories.enabled = false;
291+
menus.dashboard.stats.enable_gpu = true;
292+
293+
theme.bar.transparent = true;
294+
295+
theme.font = {
296+
name = "CaskaydiaCove NF";
297+
size = "16px";
298+
};
299+
};
300+
};
301+
}
302+
```
303+
:warning: **Caveat**: Currently, updating the configuration through the GUI will
304+
overwrite the `config.json` file by deleting it and creating a new one in its
305+
place. This causes an error with Home Manager as the config must be a symlink to
306+
the current generation for Home Manager to properly update it. A shorthand fix
307+
is to delete `config.json` if it is NOT a symlink which can be handled for you
308+
with the module by setting the `overwrite.enable` option. An obvious caveat to
309+
this is that you can no longer save the configurations set from the GUI. The
310+
recommended workflow is to keep track of the differences and apply it later
311+
in the module.
312+
313+
TL;DR - You can use the GUI but changes will be overwritten after activating
314+
a new Home Manager build. Keep track of what you like and update the module.
315+
See `./nix/module.nix` for all available options. One way to do this is to
316+
make a copy of `~/.config/hyprpanel/config.json` and do a `vimdiff` with the
317+
copy and the newly overwritten `config.json`.
318+
319+
208320
### Installing HyprPanel
209321

210322
To install HyprPanel, you can run the following commands:

0 commit comments

Comments
 (0)