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
This commit is contained in:
Jacob Birkett 2024-06-11 06:05:05 -07:00 committed by GitHub
parent 69073371f4
commit 151102b7d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 44 additions and 32 deletions

5
.gitignore vendored
View file

@ -31,4 +31,9 @@
*.out *.out
*.app *.app
# Editors
.vscode/ .vscode/
# Nix
result
result-man

View file

@ -16,11 +16,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1713612213, "lastModified": 1717181720,
"narHash": "sha256-zJboXgWNpNhKyNF8H/3UYzWkx7w00TOCGKi3cwi+tsw=", "narHash": "sha256-yv+QZWsusu/NWjydkxixHC2g+tIJ9v+xkE2EiVpJj6g=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprcursor", "repo": "hyprcursor",
"rev": "cab4746180f210a3c1dd3d53e45c510e309e90e1", "rev": "9e27a2c2ceb1e0b85bd55b0afefad196056fe87c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -39,11 +39,11 @@
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
"lastModified": 1714915839, "lastModified": 1717970802,
"narHash": "sha256-HwrMGeMtYD2AXanipPSSzmc8IGZQsFVDotScXYztHNg=", "narHash": "sha256-kFnaAmte/N1mrbHEQyrwDu9+laZzVAi4N2nQodCNfgg=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "589f758d947cb4e8b888d2da00076a9fb0a6d521", "rev": "1423707dbefc0329e80895451903a77ab684f7ea",
"revCount": 4614, "revCount": 4789,
"submodules": true, "submodules": true,
"type": "git", "type": "git",
"url": "https://github.com/hyprwm/Hyprland" "url": "https://github.com/hyprwm/Hyprland"
@ -68,11 +68,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1714869498, "lastModified": 1691753796,
"narHash": "sha256-vbLVOWvQqo4n1yvkg/Q70VTlPbMmTiCQfNTgcWDCfJM=", "narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprland-protocols", "repo": "hyprland-protocols",
"rev": "e06482e0e611130cd1929f75e8c1cf679e57d161", "rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -93,11 +93,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1713121246, "lastModified": 1716473782,
"narHash": "sha256-502X0Q0fhN6tJK7iEUA8CghONKSatW/Mqj4Wappd++0=", "narHash": "sha256-+qLn4lsHU6iL3+HTo1gTQ1tWzet8K9h+IfVemzEQZj8=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprlang", "repo": "hyprlang",
"rev": "78fcaa27ae9e1d782faa3ff06c8ea55ddce63706", "rev": "87d5d984109c839482b88b4795db073eb9ed446f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -118,11 +118,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1714755542, "lastModified": 1717784906,
"narHash": "sha256-D0pg+ZRwrt4lavZ97Ca8clsgbPA3duLj8iEM7riaIFY=", "narHash": "sha256-YxmfxHfWed1fosaa7fC1u7XoKp1anEZU+7Lh/ojRKoM=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprwayland-scanner", "repo": "hyprwayland-scanner",
"rev": "1270ebaa539e56d61b708c24b072b09cbbd3a828", "rev": "0f30f9eca6e404130988554accbb64d1c9ec877d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -133,11 +133,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1714253743, "lastModified": 1717602782,
"narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=", "narHash": "sha256-pL9jeus5QpX5R+9rsp3hhZ+uplVHscNJh8n8VpqscM0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "58a1abdbae3217ca6b702f03d3b35125d88a2994", "rev": "e8057b67ebf307f01bdcc8fba94d94f75039d1f6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -150,6 +150,10 @@
"root": { "root": {
"inputs": { "inputs": {
"hyprland": "hyprland", "hyprland": "hyprland",
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [ "systems": [
"hyprland", "hyprland",
"systems" "systems"
@ -188,11 +192,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1714060055, "lastModified": 1716290197,
"narHash": "sha256-j43TS9wv9luaAlpxcxw0sjxkbcc2mGANVR2RYgo3RCw=", "narHash": "sha256-1u9Exrc7yx9qtES2brDh7/DDZ8w8ap1nboIOAtCgeuM=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland", "repo": "xdg-desktop-portal-hyprland",
"rev": "0fe840441e43da12cd7865ed9aa8cdc35a8da85a", "rev": "91e48d6acd8a5a611d26f925e51559ab743bc438",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -1,18 +1,19 @@
{ {
description = "Hyprland Plugins"; description = "Official Hyprland Plugins";
inputs = { inputs = {
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
nixpkgs.follows = "hyprland/nixpkgs";
systems.follows = "hyprland/systems"; systems.follows = "hyprland/systems";
}; };
outputs = { outputs = {
self, self,
hyprland, hyprland,
nixpkgs,
systems, systems,
... ...
}: let }: let
inherit (hyprland.inputs) nixpkgs;
inherit (nixpkgs) lib; inherit (nixpkgs) lib;
eachSystem = lib.genAttrs (import systems); eachSystem = lib.genAttrs (import systems);
@ -27,7 +28,7 @@
in { in {
packages = eachSystem (system: { packages = eachSystem (system: {
inherit inherit
(pkgsFor.${system}) (pkgsFor.${system}.hyprlandPlugins)
borders-plus-plus borders-plus-plus
csgo-vulkan-fix csgo-vulkan-fix
hyprbars hyprbars
@ -43,12 +44,14 @@
hyprland-plugins = final: prev: let hyprland-plugins = final: prev: let
inherit (final) callPackage; inherit (final) callPackage;
in { in {
borders-plus-plus = callPackage ./borders-plus-plus {}; hyprlandPlugins = prev.hyprlandPlugins or {} // {
csgo-vulkan-fix = callPackage ./csgo-vulkan-fix {}; borders-plus-plus = callPackage ./borders-plus-plus {};
hyprbars = callPackage ./hyprbars {}; csgo-vulkan-fix = callPackage ./csgo-vulkan-fix {};
hyprexpo = callPackage ./hyprexpo {}; hyprbars = callPackage ./hyprbars {};
hyprtrails = callPackage ./hyprtrails {}; hyprexpo = callPackage ./hyprexpo {};
hyprwinwrap = callPackage ./hyprwinwrap {}; hyprtrails = callPackage ./hyprtrails {};
hyprwinwrap = callPackage ./hyprwinwrap {};
};
}; };
}; };