From a48ae68e5c706e93d6cef68b1d699048e7dba90a Mon Sep 17 00:00:00 2001 From: Akshay Date: Wed, 24 Apr 2024 12:11:46 +0100 Subject: init --- flake.nix | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 flake.nix (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..d53099c --- /dev/null +++ b/flake.nix @@ -0,0 +1,52 @@ +# mostly lifted from https://github.com/xddxdd/nur-packages, converted into a standalone flake +{ + description = "GNU cobol compiler"; + + inputs = { + gnucobol-3_2-src = { + url = "https://ftp.gnu.org/gnu/gnucobol/gnucobol-3.2.tar.xz"; + flake = false; + }; + gnucobol-3_1_2-src = { + url = "https://ftp.gnu.org/gnu/gnucobol/gnucobol-3.1.2.tar.xz"; + flake = false; + }; + }; + + outputs = + { self + , nixpkgs + , gnucobol-3_2-src + , gnucobol-3_1_2-src + }: + let + supportedSystems = [ "x86_64-linux" ]; + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; + nixpkgsFor = forAllSystems (system: import nixpkgs { + inherit system; + overlays = [ self.overlays.default ]; + }); + in + { + overlays.default = final: prev: { + gnucobol-3_1_2 = + final.gnu-cobol.overrideAttrs { + src = gnucobol-3_1_2-src; + doInstallCheck = false; + }; + + gnucobol-3_2 = + final.gnu-cobol.overrideAttrs { + src = gnucobol-3_2-src; + doInstallCheck = false; + }; + }; + + packages = forAllSystems (system: { + inherit (nixpkgsFor."${system}") gnucobol-3_1_2 gnucobol-3_2; + }); + + defaultPackage = forAllSystems (system: self.packages."${system}".gnucobol-3_2); + }; +} + -- cgit v1.2.3