diff options
author | Akshay <[email protected]> | 2021-09-21 16:53:08 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2021-09-21 16:53:08 +0100 |
commit | 10438875e09b9985732e00c989a54830909f8886 (patch) | |
tree | 400234a5fd43268104c497ee4a33bbd1532f212c | |
parent | 3bd07edefd16e5d3393ce66f41965d225d61f914 (diff) |
build as flake
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | flake.lock | 27 | ||||
-rw-r--r-- | flake.nix | 48 |
3 files changed, 76 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b2be92b --- /dev/null +++ b/.gitignore | |||
@@ -0,0 +1 @@ | |||
result | |||
diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..af3204b --- /dev/null +++ b/flake.lock | |||
@@ -0,0 +1,27 @@ | |||
1 | { | ||
2 | "nodes": { | ||
3 | "nixpkgs": { | ||
4 | "locked": { | ||
5 | "lastModified": 1632176121, | ||
6 | "narHash": "sha256-N2oSOhbW38rbc53R1R8qXC/Xstht1PIsAcTzJfmCpTc=", | ||
7 | "owner": "NixOS", | ||
8 | "repo": "nixpkgs", | ||
9 | "rev": "3397f0ede9ea2ded1f8b6fa689dda71a7a67b806", | ||
10 | "type": "github" | ||
11 | }, | ||
12 | "original": { | ||
13 | "owner": "NixOS", | ||
14 | "ref": "nixos-21.05", | ||
15 | "repo": "nixpkgs", | ||
16 | "type": "github" | ||
17 | } | ||
18 | }, | ||
19 | "root": { | ||
20 | "inputs": { | ||
21 | "nixpkgs": "nixpkgs" | ||
22 | } | ||
23 | } | ||
24 | }, | ||
25 | "root": "root", | ||
26 | "version": 7 | ||
27 | } | ||
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..e96f699 --- /dev/null +++ b/flake.nix | |||
@@ -0,0 +1,48 @@ | |||
1 | { | ||
2 | |||
3 | description = "Improved text objects for {neo,}vim"; | ||
4 | |||
5 | inputs = { | ||
6 | nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.05"; | ||
7 | }; | ||
8 | |||
9 | outputs = | ||
10 | { self | ||
11 | , nixpkgs | ||
12 | , ... | ||
13 | } @ rest: | ||
14 | let | ||
15 | supportedSystems = [ "x86_64-linux" "x86_64-darwin" ]; | ||
16 | |||
17 | forAllSystems = nixpkgs.lib.genAttrs supportedSystems; | ||
18 | |||
19 | nixpkgsFor = forAllSystems (system: | ||
20 | import nixpkgs { | ||
21 | inherit system; | ||
22 | overlays = [ self.overlay ]; | ||
23 | } | ||
24 | ); | ||
25 | in | ||
26 | { | ||
27 | |||
28 | overlay = final: prev: rec { | ||
29 | better-text-objs = | ||
30 | with final; pkgs.vimUtils.buildVimPlugin { | ||
31 | pname = "better-text-objs"; | ||
32 | version = "0.1.0"; | ||
33 | src = ./.; | ||
34 | }; | ||
35 | }; | ||
36 | |||
37 | packages = forAllSystems (system: | ||
38 | { | ||
39 | inherit (nixpkgsFor."${system}") better-text-objs; | ||
40 | } | ||
41 | ); | ||
42 | |||
43 | defaultPackage = | ||
44 | forAllSystems (system: self.packages."${system}".better-text-objs); | ||
45 | |||
46 | }; | ||
47 | |||
48 | } | ||