Added a Nix Flake and support for running from the Nix Store (#47)

* Added a Nix Flake and support for running from the Nix Store

* Removed variable imports since they're brough in at the top level.

* Removed redundan imports and remove unused files (moved to temp).

---------

Co-authored-by: Jas Singh <jaskiratpal.singh@outlook.com>
This commit is contained in:
Chi
2024-08-04 08:11:34 +01:00
committed by GitHub
parent a6d6a34ea7
commit 624b3e2ad0
34 changed files with 760 additions and 860 deletions

View File

@@ -42,6 +42,8 @@ Arch (AUR):
yay -S grimblast gpu-screen-recorder hyprpicker python-gpustat aylurs-gtk-shell-git
```
For NixOS/Home-Manager, see [NixOS & Home-Manager instructions](#nixos--home-manager).
## Instructions
### AGS
@@ -69,6 +71,70 @@ Or you can add it to your Hyprland config (hyprland.conf) to auto-start with:
exec-once = ags
```
### NixOS & Home-Manager
Alternatively, if you're using NixOS and/or Home-Manager, you can setup AGS using the provided Nix Flake. First, add the repository to your Flake's inputs, and enable the overlay.
```nix
# flake.nix
{
inputs.hyprpanel.url = "github:Jas-SinghFSU/HyprPanel";
# ...
outputs = { self, nixpkgs, ... }@inputs:
let
# ...
system = "x86_64-linux"; # change to whatever your system should be.
pkgs = import nixpkgs {
inherit system;
# ...
overlays = [
inputs.hyprpanel.overlay.${system}
];
};
in {
# ...
}
}
```
Once you've set up the overlay, you can reference HyprPanel with `pkgs.hyprpanel` as if it were any other Nix package. This means you can reference it as a NixOS system/user package, a Home-Manager user package, or as a direct reference in your Hyprland configuration (if your configuration is managed by Home-Manager). The first three methods will add it to your `$PATH` (first globally, second two user-only), however the final will not.
```nix
# configuration.nix
# install it as a system package
environment.systemPackages = with pkgs; [
# ...
hyprpanel
# ...
];
# or install it as a user package
users.users.<username>.packages = with pkgs; [
# ...
hyprpanel
# ...
];
# home.nix
# install it as a user package with home-manager
home.packages = with pkgs; [
# ...
hyprpanel
# ...
];
# or reference it directly in your Hyprland configuration
wayland.windowManager.hyprland.settings.exec-once = ''
# ...
${pkgs.hyprpanel}/bin/hyprpanel
# ...
'';
```
### Notifications
HyprPanel handles notifications through the AGS built-in notification service. If you're already using a notification daemon such as Dunst or Mako, you may have to stop them to prevent conflicts with HyprPanel.