diff options
author | Akshay <[email protected]> | 2024-04-24 12:11:46 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2024-04-24 12:11:46 +0100 |
commit | a48ae68e5c706e93d6cef68b1d699048e7dba90a (patch) | |
tree | ae247b28604dc6d89a857bb51a417978bacb9b8a |
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | flake.lock | 52 | ||||
-rw-r--r-- | flake.nix | 52 |
3 files changed, 105 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4d77fea --- /dev/null +++ b/.gitignore | |||
@@ -0,0 +1 @@ | |||
result-bin | |||
diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..2ed3944 --- /dev/null +++ b/flake.lock | |||
@@ -0,0 +1,52 @@ | |||
1 | { | ||
2 | "nodes": { | ||
3 | "gnucobol-3_1_2-src": { | ||
4 | "flake": false, | ||
5 | "locked": { | ||
6 | "lastModified": 1608725098, | ||
7 | "narHash": "sha256-EUvc4MFhJJ3VduloFHfCMELAMkdQ4CQs9b64zlTUdzo=", | ||
8 | "type": "tarball", | ||
9 | "url": "https://ftp.gnu.org/gnu/gnucobol/gnucobol-3.1.2.tar.xz" | ||
10 | }, | ||
11 | "original": { | ||
12 | "type": "tarball", | ||
13 | "url": "https://ftp.gnu.org/gnu/gnucobol/gnucobol-3.1.2.tar.xz" | ||
14 | } | ||
15 | }, | ||
16 | "gnucobol-3_2-src": { | ||
17 | "flake": false, | ||
18 | "locked": { | ||
19 | "lastModified": 1690569738, | ||
20 | "narHash": "sha256-zYnJEoddmKl1Ds2Kg1Kz9NUjfuu/x5o7wDQmMJy/Jfc=", | ||
21 | "type": "tarball", | ||
22 | "url": "https://ftp.gnu.org/gnu/gnucobol/gnucobol-3.2.tar.xz" | ||
23 | }, | ||
24 | "original": { | ||
25 | "type": "tarball", | ||
26 | "url": "https://ftp.gnu.org/gnu/gnucobol/gnucobol-3.2.tar.xz" | ||
27 | } | ||
28 | }, | ||
29 | "nixpkgs": { | ||
30 | "locked": { | ||
31 | "lastModified": 1710534455, | ||
32 | "narHash": "sha256-huQT4Xs0y4EeFKn2BTBVYgEwJSv8SDlm82uWgMnCMmI=", | ||
33 | "path": "/nix/store/is9gmr40ay4smysc2dica2g8dgwxnp5d-source", | ||
34 | "rev": "9af9c1c87ed3e3ed271934cb896e0cdd33dae212", | ||
35 | "type": "path" | ||
36 | }, | ||
37 | "original": { | ||
38 | "id": "nixpkgs", | ||
39 | "type": "indirect" | ||
40 | } | ||
41 | }, | ||
42 | "root": { | ||
43 | "inputs": { | ||
44 | "gnucobol-3_1_2-src": "gnucobol-3_1_2-src", | ||
45 | "gnucobol-3_2-src": "gnucobol-3_2-src", | ||
46 | "nixpkgs": "nixpkgs" | ||
47 | } | ||
48 | } | ||
49 | }, | ||
50 | "root": "root", | ||
51 | "version": 7 | ||
52 | } | ||
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..d53099c --- /dev/null +++ b/flake.nix | |||
@@ -0,0 +1,52 @@ | |||
1 | # mostly lifted from https://github.com/xddxdd/nur-packages, converted into a standalone flake | ||
2 | { | ||
3 | description = "GNU cobol compiler"; | ||
4 | |||
5 | inputs = { | ||
6 | gnucobol-3_2-src = { | ||
7 | url = "https://ftp.gnu.org/gnu/gnucobol/gnucobol-3.2.tar.xz"; | ||
8 | flake = false; | ||
9 | }; | ||
10 | gnucobol-3_1_2-src = { | ||
11 | url = "https://ftp.gnu.org/gnu/gnucobol/gnucobol-3.1.2.tar.xz"; | ||
12 | flake = false; | ||
13 | }; | ||
14 | }; | ||
15 | |||
16 | outputs = | ||
17 | { self | ||
18 | , nixpkgs | ||
19 | , gnucobol-3_2-src | ||
20 | , gnucobol-3_1_2-src | ||
21 | }: | ||
22 | let | ||
23 | supportedSystems = [ "x86_64-linux" ]; | ||
24 | forAllSystems = nixpkgs.lib.genAttrs supportedSystems; | ||
25 | nixpkgsFor = forAllSystems (system: import nixpkgs { | ||
26 | inherit system; | ||
27 | overlays = [ self.overlays.default ]; | ||
28 | }); | ||
29 | in | ||
30 | { | ||
31 | overlays.default = final: prev: { | ||
32 | gnucobol-3_1_2 = | ||
33 | final.gnu-cobol.overrideAttrs { | ||
34 | src = gnucobol-3_1_2-src; | ||
35 | doInstallCheck = false; | ||
36 | }; | ||
37 | |||
38 | gnucobol-3_2 = | ||
39 | final.gnu-cobol.overrideAttrs { | ||
40 | src = gnucobol-3_2-src; | ||
41 | doInstallCheck = false; | ||
42 | }; | ||
43 | }; | ||
44 | |||
45 | packages = forAllSystems (system: { | ||
46 | inherit (nixpkgsFor."${system}") gnucobol-3_1_2 gnucobol-3_2; | ||
47 | }); | ||
48 | |||
49 | defaultPackage = forAllSystems (system: self.packages."${system}".gnucobol-3_2); | ||
50 | }; | ||
51 | } | ||
52 | |||