From: Scott Worley Date: Tue, 25 Aug 2020 23:18:18 +0000 (-0700) Subject: Flake support X-Git-Tag: v1.2.2~2 X-Git-Url: http://git.scottworley.com/git-cache/commitdiff_plain/6fc1f7bacd3f9fce894df6e40887a5ec247e106a?ds=inline Flake support --- diff --git a/Changelog b/Changelog index 3814943..e74812a 100644 --- a/Changelog +++ b/Changelog @@ -1,4 +1,6 @@ ## [Unreleased] +### Added +- Flake support ## [1.2.1] - 2020-08-03 diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..fb0bf45 --- /dev/null +++ b/flake.lock @@ -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 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"; + }); + }; +}