From 516b73ca957545968cdd19b8ac26fe4d8d439d84 Mon Sep 17 00:00:00 2001 From: Brynley Llewellyn-Roux Date: Wed, 18 Sep 2024 14:17:57 +1000 Subject: [PATCH] feat: added indirect input --- flake.lock | 116 +++++------------------------------------------------ flake.nix | 69 +++++++++++++++---------------- 2 files changed, 44 insertions(+), 141 deletions(-) diff --git a/flake.lock b/flake.lock index a9491cb..b2c4339 100644 --- a/flake.lock +++ b/flake.lock @@ -5,47 +5,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_2": { - "inputs": { - "systems": "systems_2" - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_3": { - "inputs": { - "systems": "systems_3" - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "type": "github" }, "original": { @@ -66,58 +30,30 @@ "original": { "owner": "NixOS", "repo": "nixpkgs", + "rev": "3f33387a5c85d94b305062a4f97d5b2899094efa", "type": "github" } }, "nixpkgs-matrix": { "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs", - "polykey-cli": "polykey-cli" - }, - "locked": { - "lastModified": 1718671111, - "narHash": "sha256-7mgQvoUeAUeLkCh+wub8JNTT6x7onmIFyT90FT4uw88=", - "owner": "matrixai", - "repo": "nixpkgs-matrix", - "rev": "f00e00b892026a8588c9c01edde195585303ee84", - "type": "github" - }, - "original": { - "owner": "matrixai", - "repo": "nixpkgs-matrix", - "type": "github" - } - }, - "polykey-cli": { - "inputs": { - "flake-utils": "flake-utils_3", - "nixpkgs": [ - "nixpkgs-matrix", - "nixpkgs" - ] + "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1718605364, - "narHash": "sha256-1JVAPfZ3s47ehaAaDY22UIAeYcxlB/5CSY4VYHPKf34=", + "lastModified": 1727848059, + "narHash": "sha256-ClOH2O/IMe3x8F735//QVIQVIPeTik9Fjn0P0n7JLYg=", "owner": "MatrixAI", - "repo": "Polykey-CLI", - "rev": "5973090c8fab456d048bac93b378af712dc5590f", + "repo": "nixpkgs-matrix", + "rev": "4df49ebd2f7c72195ea9e2414e9a968693c68600", "type": "github" }, "original": { - "owner": "MatrixAI", - "repo": "Polykey-CLI", - "type": "github" + "id": "nixpkgs-matrix", + "type": "indirect" } }, "root": { "inputs": { "flake-utils": "flake-utils", - "nixpkgs": [ - "nixpkgs-matrix", - "nixpkgs" - ], "nixpkgs-matrix": "nixpkgs-matrix" } }, @@ -135,36 +71,6 @@ "repo": "default", "type": "github" } - }, - "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_3": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index af1b296..07a7058 100644 --- a/flake.nix +++ b/flake.nix @@ -1,47 +1,44 @@ { inputs = { - nixpkgs.url = "github:nixos/nixpkgs"; - nixpkgs.follows = "nixpkgs-matrix/nixpkgs"; - nixpkgs-matrix.url = "github:matrixai/nixpkgs-matrix"; + nixpkgs-matrix = { + type = "indirect"; + id = "nixpkgs-matrix"; + inputs.nixpkgs.url = + "github:NixOS/nixpkgs?rev=e69e710edfed397959507bcee120ec8a9c7ff03e"; + }; flake-utils.url = "github:numtide/flake-utils"; }; - outputs = { nixpkgs, flake-utils, ... }: + outputs = { nixpkgs-matrix, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system: let - pkgs = import nixpkgs { inherit system; }; + pkgs = nixpkgs-matrix.legacyPackages.${system}; - shell = { ci ? false }: with pkgs; mkShell { - nativeBuildInputs = [ - nodejs_20 - shellcheck - gitAndTools.gh - ]; - NIX_DONT_SET_RPATH = true; - NIX_NO_SELF_RPATH = true; - shellHook = '' - echo "Entering $(npm pkg get name)" - set -o allexport - . ./.env - set +o allexport - set -v - ${ - lib.optionalString ci - '' - set -o errexit - set -o nounset - set -o pipefail - shopt -s inherit_errexit - '' - } - mkdir --parents "$(pwd)/tmp" - export PATH="$(pwd)/dist/bin:$(npm root)/.bin:$PATH" - npm install --ignore-scripts - set +v - ''; - }; - in - { + shell = { ci ? false }: + with pkgs; + mkShell { + nativeBuildInputs = [ nodejs_20 shellcheck gitAndTools.gh ]; + NIX_DONT_SET_RPATH = true; + NIX_NO_SELF_RPATH = true; + shellHook = '' + echo "Entering $(npm pkg get name)" + set -o allexport + . ./.env + set +o allexport + set -v + ${lib.optionalString ci '' + set -o errexit + set -o nounset + set -o pipefail + shopt -s inherit_errexit + ''} + mkdir --parents "$(pwd)/tmp" + export PATH="$(pwd)/dist/bin:$(npm root)/.bin:$PATH" + npm install --ignore-scripts + set +v + ''; + }; + in { devShells = { default = shell { ci = false; }; ci = shell { ci = true; };