From a48ae68e5c706e93d6cef68b1d699048e7dba90a Mon Sep 17 00:00:00 2001 From: Akshay Date: Wed, 24 Apr 2024 12:11:46 +0100 Subject: init --- .gitignore | 1 + flake.lock | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 .gitignore create mode 100644 flake.lock create mode 100644 flake.nix 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 @@ +{ + "nodes": { + "gnucobol-3_1_2-src": { + "flake": false, + "locked": { + "lastModified": 1608725098, + "narHash": "sha256-EUvc4MFhJJ3VduloFHfCMELAMkdQ4CQs9b64zlTUdzo=", + "type": "tarball", + "url": "https://ftp.gnu.org/gnu/gnucobol/gnucobol-3.1.2.tar.xz" + }, + "original": { + "type": "tarball", + "url": "https://ftp.gnu.org/gnu/gnucobol/gnucobol-3.1.2.tar.xz" + } + }, + "gnucobol-3_2-src": { + "flake": false, + "locked": { + "lastModified": 1690569738, + "narHash": "sha256-zYnJEoddmKl1Ds2Kg1Kz9NUjfuu/x5o7wDQmMJy/Jfc=", + "type": "tarball", + "url": "https://ftp.gnu.org/gnu/gnucobol/gnucobol-3.2.tar.xz" + }, + "original": { + "type": "tarball", + "url": "https://ftp.gnu.org/gnu/gnucobol/gnucobol-3.2.tar.xz" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1710534455, + "narHash": "sha256-huQT4Xs0y4EeFKn2BTBVYgEwJSv8SDlm82uWgMnCMmI=", + "path": "/nix/store/is9gmr40ay4smysc2dica2g8dgwxnp5d-source", + "rev": "9af9c1c87ed3e3ed271934cb896e0cdd33dae212", + "type": "path" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "gnucobol-3_1_2-src": "gnucobol-3_1_2-src", + "gnucobol-3_2-src": "gnucobol-3_2-src", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} 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