hyprland-plugins/flake.nix
Jacob Birkett 151102b7d7
flake: overlay: move packages to hyprlandPlugins namespace (#180)
* flake: inputs: follow hyprland/nixpkgs

The reason to do this instead of `inputs.hyprland.nixpkgs` or inheriting
that attribute is for the semantic meaning of having it in the
`flake.lock`. This makes it obvious that it can be overridden.

* flake: overlay: adopt nixpkgs hyprlandPlugins

I have introduced the `hyprlandPlugins` namespace to this flake's
default overlay. Derivations are moved there, in-line with Nixpkgs.

I recommend that other Hyprland plugin flake authors use the same
pattern:

```nix
overlays = {
  default = self.overlays.your-plugin-name;
  your-plugin-name = final: prev: {
    hyprlandPlugins = prev.hyprland-plugins or {} // {
      your-plugin-name = final.callPackage ./nix/default.nix {};
    };
  };
};
```

Your flake's packages output should also make use of this overlay via a
manual `nixpkgs` import, and inherit the outputs from
`pkgs.hyprlandPlugins`. This will ensure that the flake's dependency
graph is properly reflected in the derivation outputs.

* gitignore: add nix build results

* flake: inputs: update all
2024-06-11 16:05:05 +03:00

69 lines
1.8 KiB
Nix

{
description = "Official Hyprland Plugins";
inputs = {
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
nixpkgs.follows = "hyprland/nixpkgs";
systems.follows = "hyprland/systems";
};
outputs = {
self,
hyprland,
nixpkgs,
systems,
...
}: let
inherit (nixpkgs) lib;
eachSystem = lib.genAttrs (import systems);
pkgsFor = eachSystem (system:
import nixpkgs {
localSystem.system = system;
overlays = [
self.overlays.hyprland-plugins
hyprland.overlays.hyprland-packages
];
});
in {
packages = eachSystem (system: {
inherit
(pkgsFor.${system}.hyprlandPlugins)
borders-plus-plus
csgo-vulkan-fix
hyprbars
hyprexpo
hyprtrails
hyprwinwrap
;
});
overlays = {
default = self.overlays.hyprland-plugins;
hyprland-plugins = final: prev: let
inherit (final) callPackage;
in {
hyprlandPlugins = prev.hyprlandPlugins or {} // {
borders-plus-plus = callPackage ./borders-plus-plus {};
csgo-vulkan-fix = callPackage ./csgo-vulkan-fix {};
hyprbars = callPackage ./hyprbars {};
hyprexpo = callPackage ./hyprexpo {};
hyprtrails = callPackage ./hyprtrails {};
hyprwinwrap = callPackage ./hyprwinwrap {};
};
};
};
checks = eachSystem (system: self.packages.${system});
devShells = eachSystem (system:
with pkgsFor.${system}; {
default = mkShell.override {stdenv = gcc13Stdenv;} {
name = "hyprland-plugins";
buildInputs = [hyprland.packages.${system}.hyprland];
inputsFrom = [hyprland.packages.${system}.hyprland];
};
});
};
}