make styx a "build styx" function

This commit is contained in:
Daylin Morgan 2024-01-26 12:00:05 -06:00
parent c87b8487ed
commit ab7ee89eda
Signed by: daylin
GPG Key ID: C1E52E7DD81DF79F
2 changed files with 5 additions and 5 deletions

View File

@ -35,10 +35,10 @@
... ...
}: let }: let
lib = import ./lib {inherit inputs nixpkgs;}; lib = import ./lib {inherit inputs nixpkgs;};
inherit (lib) findModules mapHosts shToPkg; inherit (lib) findModules mapHosts buildStyx;
in { in {
nixosModules = findModules ./modules; nixosModules = findModules ./modules;
nixosConfigurations = mapHosts ./hosts; nixosConfigurations = mapHosts ./hosts;
packages = shToPkg ./styx; packages = buildStyx {};
}; };
} }

View File

@ -11,11 +11,11 @@
in rec { in rec {
forAllSystems = f: genAttrs supportedSystems (system: f nixpkgs.legacyPackages.${system}); forAllSystems = f: genAttrs supportedSystems (system: f nixpkgs.legacyPackages.${system});
shToPkg = path: buildStyx = _:
forAllSystems ( forAllSystems (
pkgs: let pkgs: let
name = baseNameOf path; name = baseNameOf ../styx;
in {${name} = pkgs.writeScriptBin name (readFile path);} in {${name} = pkgs.writeScriptBin name (readFile ../styx);}
); );
isNixFile = path: hasSuffix ".nix" path; isNixFile = path: hasSuffix ".nix" path;