From 49da626ac536b6f63a6f803b116d7d68eaee809d Mon Sep 17 00:00:00 2001 From: Jan-Erik Rediger Date: Sun, 2 Jun 2024 00:48:38 +0200 Subject: [PATCH] add a nix devshell --- flake.lock | 127 +++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 32 ++++++++++++++ 2 files changed, 159 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..1986ecd --- /dev/null +++ b/flake.lock @@ -0,0 +1,127 @@ +{ + "nodes": { + "hare-pkgs": { + "inputs": { + "hare-src": "hare-src", + "harec-src": "harec-src", + "linux-hare-src": "linux-hare-src", + "linux-harec-src": "linux-harec-src", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1717281762, + "narHash": "sha256-NUMYwtqlN7NzDOC3wEQnYAlbZsSMkbnljE4nXdAarIo=", + "ref": "merged-pkgs", + "rev": "7c95e59ca463112e1c7b43f452dbfe864fd8468c", + "revCount": 21, + "type": "git", + "url": "ssh://forgejo@git.fnordig.de/jer/hare-mac.git" + }, + "original": { + "ref": "merged-pkgs", + "type": "git", + "url": "ssh://forgejo@git.fnordig.de/jer/hare-mac.git" + } + }, + "hare-src": { + "flake": false, + "locked": { + "lastModified": 1717279340, + "narHash": "sha256-c91H21fyzHVekAB5ePduxO8l/zZ86ov8KHa1HHC8Ywc=", + "owner": "badboy", + "repo": "harelang", + "rev": "287006499c2640c6e96b6fa5e0c99a2c193cc666", + "type": "github" + }, + "original": { + "owner": "badboy", + "repo": "harelang", + "type": "github" + } + }, + "harec-src": { + "flake": false, + "locked": { + "lastModified": 1715770447, + "narHash": "sha256-/n175ocvtzi1J+zB8+eW69YXolGFX15g9Ee0OE5jtGA=", + "owner": "badboy", + "repo": "harelang-harec", + "rev": "873311b721dca691706909964cc108139ebee0de", + "type": "github" + }, + "original": { + "owner": "badboy", + "repo": "harelang-harec", + "type": "github" + } + }, + "linux-hare-src": { + "flake": false, + "locked": { + "lastModified": 1717244404, + "narHash": "sha256-iEGez/JfWvAaHbYUQL/BeRPUH5d+xj7AyFM8CvA+oDU=", + "ref": "refs/heads/master", + "rev": "a3fd5ec812ee31a7ec4a07053518b64aaa0c3932", + "revCount": 3883, + "type": "git", + "url": "https://git.sr.ht/~sircmpwn/hare" + }, + "original": { + "type": "git", + "url": "https://git.sr.ht/~sircmpwn/hare" + } + }, + "linux-harec-src": { + "flake": false, + "locked": { + "lastModified": 1716809026, + "narHash": "sha256-z4D4MMVROoMFnqAjyWWCUdHwCfR14coGFUNdRGQktgQ=", + "ref": "refs/heads/master", + "rev": "42f9b39977ce8d94bab1655f07bb82eb08c85dda", + "revCount": 1914, + "type": "git", + "url": "https://git.sr.ht/~sircmpwn/harec" + }, + "original": { + "type": "git", + "url": "https://git.sr.ht/~sircmpwn/harec" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1716220750, + "narHash": "sha256-Lhhrd1ZBNXCbUupWGq6gRPIy1qMKEdcAXcjnwgVqe/U=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "641daa314d5bc1bca4b345da8eb08a130b109c79", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1717112898, + "narHash": "sha256-7R2ZvOnvd9h8fDd65p0JnB7wXfUvreox3xFdYWd1BnY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "6132b0f6e344ce2fe34fc051b72fb46e34f668e0", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "hare-pkgs": "hare-pkgs", + "nixpkgs": "nixpkgs_2" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..cc50c9c --- /dev/null +++ b/flake.nix @@ -0,0 +1,32 @@ +{ + description = "Hare for mac"; + + inputs = { + hare-pkgs = { + url = "git+ssh://forgejo@git.fnordig.de/jer/hare-mac.git?ref=merged-pkgs"; + }; + }; + + outputs = { nixpkgs, hare-pkgs, ... }: + let + supportedSystems = [ "x86_64-darwin" "aarch64-darwin" "x86_64-linux" "aarch64-linux" ]; + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; + in + { + devShells = forAllSystems (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + hare-pkgs' = hare-pkgs.packages.${system}; + harec = hare-pkgs'.harec; + hare = hare-pkgs'.hare; + in + { + default = pkgs.mkShell { + buildInputs = [ + harec + hare + ]; + }; + }); + }; +}