add initial pluginBuilder

This commit is contained in:
Mihai Fufezan 2023-08-16 22:28:45 +03:00
parent efd7a19069
commit 205ef4d7f8
No known key found for this signature in database
7 changed files with 83 additions and 45 deletions

44
all.nix Normal file
View File

@ -0,0 +1,44 @@
{
builder,
lib,
}:
lib.mapAttrs (n: v: builder v) {
borders-plus-plus = {
pname = "borders-plus-plus";
version = "0.1";
src = ./.;
meta = with lib; {
homepage = "https://github.com/hyprwm/hyprland-plugins";
description = "Hyprland borders-plus-plus plugin";
license = licenses.bsd3;
platforms = platforms.linux;
};
};
csgo-vulkan-fix = {
pname = "csgo-vulkan-fix";
version = "0.1";
src = ./.;
meta = with lib; {
homepage = "https://github.com/hyprwm/hyprland-plugins";
description = "Hyprland CS:GO Vulkan fix";
license = licenses.bsd3;
platforms = platforms.linux;
};
};
hyprbars = {
pname = "hyprbars";
version = "0.1";
src = ./.;
meta = with lib; {
homepage = "https://github.com/hyprwm/hyprland-plugins";
description = "Hyprland window title plugin";
license = licenses.bsd3;
platforms = platforms.linux;
};
};
}

View File

@ -1,17 +1,8 @@
{ lib: {
lib,
stdenv,
hyprland,
}:
stdenv.mkDerivation {
pname = "borders-plus-plus"; pname = "borders-plus-plus";
version = "0.1"; version = "0.1";
src = ./.; src = ./.;
inherit (hyprland) nativeBuildInputs;
buildInputs = [hyprland] ++ hyprland.buildInputs;
meta = with lib; { meta = with lib; {
homepage = "https://github.com/hyprwm/hyprland-plugins"; homepage = "https://github.com/hyprwm/hyprland-plugins";
description = "Hyprland borders-plus-plus plugin"; description = "Hyprland borders-plus-plus plugin";

View File

@ -1,17 +1,8 @@
{ lib: {
lib,
stdenv,
hyprland,
}:
stdenv.mkDerivation {
pname = "csgo-vulkan-fix"; pname = "csgo-vulkan-fix";
version = "0.1"; version = "0.1";
src = ./.; src = ./.;
inherit (hyprland) nativeBuildInputs;
buildInputs = [hyprland] ++ hyprland.buildInputs;
meta = with lib; { meta = with lib; {
homepage = "https://github.com/hyprwm/hyprland-plugins"; homepage = "https://github.com/hyprwm/hyprland-plugins";
description = "Hyprland CS:GO Vulkan fix"; description = "Hyprland CS:GO Vulkan fix";

View File

@ -7,22 +7,23 @@
self, self,
hyprland, hyprland,
}: let }: let
inherit (hyprland.inputs) nixpkgs; inherit (hyprland.inputs) nixpkgs systems;
withPkgsFor = fn: nixpkgs.lib.genAttrs (builtins.attrNames hyprland.packages) (system: fn system nixpkgs.legacyPackages.${system}); inherit (nixpkgs) lib;
inherit (import ./lib) pluginBuilder;
withPkgsFor = fn: lib.genAttrs (import systems) (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 { builder = pluginBuilder hyprland pkgs.gcc13Stdenv;
inherit (hyprland.packages.${system}) hyprland; in {
stdenv = pkgs.gcc13Stdenv; borders-plus-plus = builder (import ./borders-plus-plus lib);
}; csgo-vulkan-fix = builder (import ./csgo-vulkan-fix lib);
csgo-vulkan-fix = pkgs.callPackage ./csgo-vulkan-fix { hyprbars = builder (import ./hyprbars lib);
inherit (hyprland.packages.${system}) hyprland; });
stdenv = pkgs.gcc13Stdenv;
}; legacyPackages = withPkgsFor (system: pkgs: let
hyprbars = pkgs.callPackage ./hyprbars { builder = pluginBuilder hyprland pkgs.stdenv;
inherit (hyprland.packages.${system}) hyprland; in {
stdenv = pkgs.gcc13Stdenv; all = import ./all.nix {inherit builder lib;};
};
}); });
devShells = withPkgsFor (system: pkgs: { devShells = withPkgsFor (system: pkgs: {

View File

@ -1,17 +1,8 @@
{ lib: {
lib,
stdenv,
hyprland,
}:
stdenv.mkDerivation {
pname = "hyprbars"; pname = "hyprbars";
version = "0.1"; version = "0.1";
src = ./.; src = ./.;
inherit (hyprland) nativeBuildInputs;
buildInputs = [hyprland] ++ hyprland.buildInputs;
meta = with lib; { meta = with lib; {
homepage = "https://github.com/hyprwm/hyprland-plugins"; homepage = "https://github.com/hyprwm/hyprland-plugins";
description = "Hyprland window title plugin"; description = "Hyprland window title plugin";

17
lib/builder.nix Normal file
View File

@ -0,0 +1,17 @@
hyprland: stdenv: {
pname,
version ? "dirty",
src,
buildInputs ? [],
meta ? {},
}: let
hl = hyprland.packages.${stdenv.hostPlatform.system}.default;
in
stdenv.mkDerivation {
inherit pname version src;
inherit (hl) nativeBuildInputs;
buildInputs = hl.buildInputs ++ [hl.dev] ++ buildInputs;
inherit meta;
}

3
lib/default.nix Normal file
View File

@ -0,0 +1,3 @@
{
pluginBuilder = import ./builder.nix;
}