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

7
.gitignore vendored
View File

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

View File

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

View File

@ -1,18 +1,19 @@
{
description = "Hyprland Plugins";
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 (hyprland.inputs) nixpkgs;
inherit (nixpkgs) lib;
eachSystem = lib.genAttrs (import systems);
@ -27,7 +28,7 @@
in {
packages = eachSystem (system: {
inherit
(pkgsFor.${system})
(pkgsFor.${system}.hyprlandPlugins)
borders-plus-plus
csgo-vulkan-fix
hyprbars
@ -43,12 +44,14 @@
hyprland-plugins = final: prev: let
inherit (final) callPackage;
in {
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 {};
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 {};
};
};
};