From 90e12ddc943e2ca7f570af27ccb5580a4ed3775b Mon Sep 17 00:00:00 2001 From: sveitser Date: Mon, 26 Aug 2024 10:14:23 +0200 Subject: [PATCH] Add shell.nix --- flake.lock | 15 +++++++++++++++ flake.nix | 4 +++- shell.nix | 13 +++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 shell.nix diff --git a/flake.lock b/flake.lock index a7cc8d2d..b6c52425 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,19 @@ { "nodes": { + "flake-compat": { + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "revCount": 57, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" + } + }, "flake-utils": { "locked": { "lastModified": 1644229661, @@ -65,6 +79,7 @@ }, "root": { "inputs": { + "flake-compat": "flake-compat", "foundry": "foundry", "nixpkgs": "nixpkgs_2" } diff --git a/flake.nix b/flake.nix index 5b9f07d8..9bbbc602 100644 --- a/flake.nix +++ b/flake.nix @@ -4,7 +4,9 @@ inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz"; inputs.foundry.url = "github:shazow/foundry.nix/monthly"; # Use monthly branch for permanent releases - outputs = { self, nixpkgs, foundry }: + inputs.flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"; # for shell.nix compatibility + + outputs = { self, nixpkgs, foundry, ... }: let supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f { diff --git a/shell.nix b/shell.nix new file mode 100644 index 00000000..9eb132a5 --- /dev/null +++ b/shell.nix @@ -0,0 +1,13 @@ +(import + ( + let + lock = builtins.fromJSON (builtins.readFile ./flake.lock); + in + fetchTarball { + url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; + sha256 = lock.nodes.flake-compat.locked.narHash; + } + ) + { + src = ./.; + }).shellNix