diff options
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 52 |
1 files changed, 52 insertions, 0 deletions
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 | |||