]> git.scottworley.com Git - git-cache/commitdiff
Flake support
authorScott Worley <scottworley@scottworley.com>
Tue, 25 Aug 2020 23:18:18 +0000 (16:18 -0700)
committerScott Worley <scottworley@scottworley.com>
Tue, 25 Aug 2020 23:20:32 +0000 (16:20 -0700)
Changelog
flake.lock [new file with mode: 0644]
flake.nix [new file with mode: 0644]

index 3814943081fb4dd265cc266ca87e5f313d38621f..e74812a90b311e1f2712cbf3e031bded549d44cc 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -1,4 +1,6 @@
 ## [Unreleased]
 ## [Unreleased]
+### Added
+- Flake support
 
 
 ## [1.2.1] - 2020-08-03
 
 
 ## [1.2.1] - 2020-08-03
diff --git a/flake.lock b/flake.lock
new file mode 100644 (file)
index 0000000..fb0bf45
--- /dev/null
@@ -0,0 +1,27 @@
+{
+  "nodes": {
+    "nixpkgs": {
+      "locked": {
+        "lastModified": 1598238449,
+        "narHash": "sha256-Oj4lmzeOhiQgqcEpeXkwANkCstiCDOtevCgg6GlcDh4=",
+        "owner": "NixOS",
+        "repo": "nixpkgs",
+        "rev": "14006b724f3d1f25ecf38238ee723d38b0c2f4ce",
+        "type": "github"
+      },
+      "original": {
+        "owner": "NixOS",
+        "ref": "nixos-20.03",
+        "repo": "nixpkgs",
+        "type": "github"
+      }
+    },
+    "root": {
+      "inputs": {
+        "nixpkgs": "nixpkgs"
+      }
+    }
+  },
+  "root": "root",
+  "version": 7
+}
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";
+      });
+    };
+}