]> git.scottworley.com Git - git-cache/blobdiff - flake.nix
Flake support
[git-cache] / flake.nix
diff --git a/flake.nix b/flake.nix
new file mode 100644 (file)
index 0000000..49594a7
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,25 @@
+{
+  inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-20.03"; };
+  outputs = { self, nixpkgs, }:
+    let
+
+      inherit (builtins) attrNames;
+      inherit (nixpkgs.lib) genAttrs;
+
+      for-supported-systems = genAttrs (attrNames
+        ((import (nixpkgs + "/pkgs/top-level/release.nix")
+          { }).stdenvBootstrapTools));
+
+      packages = for-supported-systems (system: {
+        git-cache = import ./. { pkgs = nixpkgs.legacyPackages."${system}"; };
+      });
+
+    in {
+      inherit packages;
+
+      defaultApp = for-supported-systems (system: {
+        type = "app";
+        program = "${packages."${system}".git-cache}/bin/git-cache";
+      });
+    };
+}