summaryrefslogtreecommitdiffstats
path: root/flake.nix
blob: ad3d54050972d0c406c9f94dcf4906c5d551f8d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{
  description = "A simple bash library for your scripting needs";

  inputs.flake-utils.url = "github:numtide/flake-utils";

  outputs = { self, flake-utils }:
    with flake-utils.lib;
    eachSystem allSystems (system: {

      # Convert a path to a derivation
      # This is done so we don't depend on nixpkgs
      packages.bash-lib = with builtins; derivation {
        name = "bash-lib.sh";
        src = readFile ./bash-lib.sh;
        inherit system;

        builder = "/bin/sh";
        args = [
          (toFile "builder.sh" ''
            echo "$src" > $out
          '')
        ];
      };

      defaultPackage = self.packages.${system}.bash-lib;
    });
}