Skip to content

Commit

Permalink
Merge pull request #6 from benvonh/master
Browse files Browse the repository at this point in the history
Add Home Manager module quick guide
  • Loading branch information
orangci authored Dec 24, 2024
2 parents 79d2fda + b3c8d09 commit bd9d48d
Showing 1 changed file with 112 additions and 0 deletions.
112 changes: 112 additions & 0 deletions docs/getting_started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,118 @@ Once you've set up the overlay, you can reference HyprPanel with `pkgs.hyprpanel

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

#### Home Manager module

If you want to configure HyprPanel with the Home Manager module instead, read from this section.

First, as with the overlay method, add HyprPanel to your flake.
```nix
# flake.nix
{
inputs = {
hyprpanel.url = "github:jas-singhfsu/hyprpanel";
# Good practice to ensure packages in HyprPanel
# are the same version as your system packages
# like when running `swww` from a keybind.
hyprpanel.inputs.nixpkgs.follows = "nixpkgs";
};
# ...
}
```

Next, import the Home Manager module and configure it as you wish.
Below is an example of some of the options that are available.
```nix
# *.nix
{ inputs, ... }:
{
imports = [ inputs.hyprpanel.homeManagerModules.hyprpanel ];
programs.hyprpanel = {
# Enable the module.
# Default: false
enable = true;
# Automatically restart HyprPanel with systemd.
# Useful when updating your config so that you
# don't need to manually restart it.
# Default: false
systemd.enable = true;
# Add '/nix/store/.../hyprpanel' to the
# 'exec-once' in your Hyprland config.
# Default: false
hyprland.enable = true;
# Fix the overwrite issue with HyprPanel.
# See below for more information.
# Default: false
overwrite.enable = true;
# Import a specific theme from './themes/*.json'.
# Default: ""
theme = "gruvbox_split";
# Configure bar layouts for monitors.
# See 'https://hyprpanel.com/configuration/panel.html'.
# Default: null
layout = {
"bar.layouts" = {
"0" = {
left = [ "dashboard" "workspaces" ];
middle = [ "media" ];
right = [ "volume" "systray" "notifications" ];
};
};
};
# Configure and theme *most* of the options from the GUI.
# See './nix/module.nix:103'.
# Default: <same as gui>
settings = {
bar.launcher.autoDetectIcon = true;
bar.workspaces.show_icons = true;
menus.clock = {
time = {
military = true;
hideSeconds = true;
};
weather.unit = "metric";
};
menus.dashboard.directories.enabled = false;
menus.dashboard.stats.enable_gpu = true;
theme.bar.transparent = true;
theme.font = {
name = "CaskaydiaCove NF";
size = "16px";
};
};
};
}
```
:warning: **Caveat**: Currently, updating the configuration through the GUI will
overwrite the `config.json` file by deleting it and creating a new one in its
place. This causes an error with Home Manager as the config must be a symlink to
the current generation for Home Manager to properly update it. A shorthand fix
is to delete `config.json` if it is NOT a symlink which can be handled for you
with the module by setting the `overwrite.enable` option. An obvious caveat to
this is that you can no longer save the configurations set from the GUI. The
recommended workflow is to keep track of the differences and apply it later
in the module.

TL;DR - You can use the GUI but changes will be overwritten after activating
a new Home Manager build. Keep track of what you like and update the module.
See `./nix/module.nix` for all available options. One way to do this is to
make a copy of `~/.config/hyprpanel/config.json` and do a `vimdiff` with the
copy and the newly overwritten `config.json`.


### Installing HyprPanel

To install HyprPanel, you can run the following commands:
Expand Down

0 comments on commit bd9d48d

Please sign in to comment.