mirror of
https://github.com/daylinmorgan/oizys.git
synced 2025-01-09 18:47:31 -06:00
even simpler implementation
This commit is contained in:
parent
0dc56dd1bc
commit
d8d2ac4c3e
1 changed files with 3 additions and 8 deletions
|
@ -7,19 +7,14 @@
|
||||||
inherit (nixpkgs.lib) hasSuffix nixosSystem genAttrs;
|
inherit (nixpkgs.lib) hasSuffix nixosSystem genAttrs;
|
||||||
inherit (nixpkgs.lib.filesystem) listFilesRecursive;
|
inherit (nixpkgs.lib.filesystem) listFilesRecursive;
|
||||||
|
|
||||||
# https://xeiaso.net/blog/nix-flakes-1-2022-02-21/
|
|
||||||
supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
|
supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
|
||||||
forAllSystems = genAttrs supportedSystems;
|
forAllSystems = f: genAttrs supportedSystems (system: f nixpkgs.legacyPackages.${system});
|
||||||
nixpkgsFor = forAllSystems (system: import nixpkgs {inherit system;});
|
|
||||||
in rec {
|
in rec {
|
||||||
shToPkg = path:
|
shToPkg = path:
|
||||||
forAllSystems (
|
forAllSystems (
|
||||||
system: let
|
pkgs: let
|
||||||
name = baseNameOf path;
|
name = baseNameOf path;
|
||||||
pkgs = nixpkgsFor.${system};
|
in {${name} = pkgs.writeScriptBin name (readFile path);}
|
||||||
in {
|
|
||||||
${name} = pkgs.writeScriptBin name (readFile path);
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
|
|
||||||
isNixFile = path: hasSuffix ".nix" path;
|
isNixFile = path: hasSuffix ".nix" path;
|
||||||
|
|
Loading…
Reference in a new issue