diff options
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..ad3d540 --- /dev/null +++ b/flake.nix | |||
@@ -0,0 +1,27 @@ | |||
1 | { | ||
2 | description = "A simple bash library for your scripting needs"; | ||
3 | |||
4 | inputs.flake-utils.url = "github:numtide/flake-utils"; | ||
5 | |||
6 | outputs = { self, flake-utils }: | ||
7 | with flake-utils.lib; | ||
8 | eachSystem allSystems (system: { | ||
9 | |||
10 | # Convert a path to a derivation | ||
11 | # This is done so we don't depend on nixpkgs | ||
12 | packages.bash-lib = with builtins; derivation { | ||
13 | name = "bash-lib.sh"; | ||
14 | src = readFile ./bash-lib.sh; | ||
15 | inherit system; | ||
16 | |||
17 | builder = "/bin/sh"; | ||
18 | args = [ | ||
19 | (toFile "builder.sh" '' | ||
20 | echo "$src" > $out | ||
21 | '') | ||
22 | ]; | ||
23 | }; | ||
24 | |||
25 | defaultPackage = self.packages.${system}.bash-lib; | ||
26 | }); | ||
27 | } | ||