EDIT: Solved! Of course, as these things always go, I can spend days trying to figure something out, and once I ask for help, I manage to figure it out. The solution, in case someone stumbles upon it, was:
- Within the modules = ; section of my flake.nix, add (import ./overlays), as so:
modules = [
...
(import ./overlays)
...
];
Create the overlays/default.nix, containing:
{ config, pkgs, lib, inputs, ... }:
{
nixpkgs.overlays = [
inputs.hyprpanel.overlay.x86_64-linux
];
}
And then in my home/programs/common.nix:
...
home.packages = [
pkgs.hyprpanel
];
Original post:
Hi everyone. New NixOS user here and I’m really excited to figure this whole system out as it will, eventually, enable me to accomplish things I’ve wanted for years.
To start, I used this template as my starting point for NixOS. So far I’ve been able to adapt it to my needs and get myself going with a bunch of packages with no issues.
My current config is here if someone wouldn’t mind taking a look to see if they can guide me in the right direction.
Where I run into difficulties is trying to install packages from outside of nixpkgs, for example: hyprpanel. This package has a flake.nix file, and a default.nix. I’m not really sure what to do with those, but I expect the answer is probably nothing. I’ve included the repo in my flake.nix file:
{
...
inputs = {
# Hyprpanel
hyprpanel = {
url = "github:Jas-SinghFSU/HyprPanel";
};
...
and included that in my outputs:
...
outputs = inputs @ {
self,
nixpkgs,
home-manager,
hyprland,
hyprpanel,
spicetify-nix,
stylix,
...
}: {
...
The repository says to call the input in the overlay = section of my config.
# 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 {
# ...
}
}
However, I don’t have an overlay section in my config. I’ve tried writing that in in a number of places but at this point I’m just throwing things at a wall and hoping I get lucky, which is nearly impossible.
Could anyone point me in the right direction? I’ve read so many things that I feel like I’m even more confused now than I was before.