Nix: simplify building, add checks

This commit is contained in:
Mihai Fufezan 2024-01-28 23:51:54 +02:00
parent 597e29a501
commit 7b5b82f666
No known key found for this signature in database

View file

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