diff --git a/flake.nix b/flake.nix index 64f1f13..a24deb2 100644 --- a/flake.nix +++ b/flake.nix @@ -3,41 +3,33 @@ inputs.hyprland.url = "github:hyprwm/Hyprland"; - outputs = { - self, - hyprland, - }: let - inherit (hyprland.inputs) nixpkgs; - withPkgsFor = fn: nixpkgs.lib.genAttrs (builtins.attrNames hyprland.packages) (system: fn system nixpkgs.legacyPackages.${system}); + outputs = inputs: let + inherit (inputs.hyprland.inputs) nixpkgs; + withPkgsFor = fn: nixpkgs.lib.genAttrs (builtins.attrNames inputs.hyprland.packages) (system: fn system nixpkgs.legacyPackages.${system}); in { - packages = withPkgsFor (system: pkgs: { - borders-plus-plus = pkgs.callPackage ./borders-plus-plus { - inherit (hyprland.packages.${system}) hyprland; - stdenv = pkgs.gcc13Stdenv; - }; - csgo-vulkan-fix = pkgs.callPackage ./csgo-vulkan-fix { - inherit (hyprland.packages.${system}) hyprland; - stdenv = pkgs.gcc13Stdenv; - }; - hyprbars = pkgs.callPackage ./hyprbars { - inherit (hyprland.packages.${system}) hyprland; - stdenv = pkgs.gcc13Stdenv; - }; - hyprtrails = pkgs.callPackage ./hyprtrails { - inherit (hyprland.packages.${system}) hyprland; - stdenv = pkgs.gcc13Stdenv; - }; - hyprwinwrap = pkgs.callPackage ./hyprwinwrap { - inherit (hyprland.packages.${system}) hyprland; - stdenv = pkgs.gcc13Stdenv; - }; + packages = withPkgsFor (system: pkgs: let + hyprland = inputs.hyprland.packages.${system}.hyprland; + buildPlugin = path: extraArgs: + pkgs.callPackage path { + inherit hyprland; + inherit (hyprland) stdenv; + } + // extraArgs; + in { + borders-plus-plus = buildPlugin ./borders-plus-plus {}; + csgo-vulkan-fix = buildPlugin ./csgo-vulkan-fix {}; + hyprbars = buildPlugin ./hyprbars {}; + hyprtrails = buildPlugin ./hyprtrails {}; + hyprwinwrap = buildPlugin ./hyprwinwrap {}; }); + checks = withPkgsFor (system: pkgs: inputs.self.packages.${system}); + devShells = withPkgsFor (system: pkgs: { default = pkgs.mkShell.override {stdenv = pkgs.gcc13Stdenv;} { name = "hyprland-plugins"; - buildInputs = [hyprland.packages.${system}.hyprland]; - inputsFrom = [hyprland.packages.${system}.hyprland]; + buildInputs = [inputs.hyprland.packages.${system}.hyprland]; + inputsFrom = [inputs.hyprland.packages.${system}.hyprland]; }; }); };