diff --git a/.envrc b/.envrc index 8b94830d..6a3d32a9 100644 --- a/.envrc +++ b/.envrc @@ -1,11 +1,8 @@ #!/bin/sh -# first time -if [[ ! -d $(nix store add-path --name source --dry-run .) ]]; then - nix store add-path --name source . - (cd ./src/local && nix flake lock --update-input std) - (cd ./src/tests && nix flake lock --update-input std) -fi +# This locks subflakes to the latest commit of std +(cd ./src/local && nix flake lock --override-input std git+file://$(pwd)/../..?rev=$(git -C ../.. rev-parse HEAD)) +(cd ./src/tests && nix flake lock --override-input std git+file://$(pwd)/../..?rev=$(git -C ../.. rev-parse HEAD)) # shellcheck disable=SC1090 . "$(fetchurl "https://raw.githubusercontent.com/paisano-nix/direnv/main/lib" "sha256-IgQhKK7UHL1AfCUntJO2KCaIDJQotRnK2qC4Daxk+wI=")" diff --git a/.github/workflows/gh-pages.yaml b/.github/workflows/gh-pages.yaml index 4bbfd20b..3c8e7037 100644 --- a/.github/workflows/gh-pages.yaml +++ b/.github/workflows/gh-pages.yaml @@ -13,7 +13,7 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: nixbuild/nix-quick-install-action@v25 + - uses: nixbuild/nix-quick-install-action@v32 - name: Update subflake references run: ./.github/workflows/update-subflake.sh diff --git a/.github/workflows/std.yml b/.github/workflows/std.yml index 60edfdd7..484b6a3f 100644 --- a/.github/workflows/std.yml +++ b/.github/workflows/std.yml @@ -24,7 +24,7 @@ jobs: runs-on: ${{ inputs.runs-on }} steps: - uses: actions/checkout@v3 - - uses: nixbuild/nix-quick-install-action@v25 + - uses: nixbuild/nix-quick-install-action@v32 - name: Update subflake references run: ./.github/workflows/update-subflake.sh # - uses: DeterminateSystems/magic-nix-cache-action@main @@ -40,7 +40,7 @@ jobs: name: ${{ matrix.target.jobName }} runs-on: ${{ inputs.runs-on }} steps: - - uses: nixbuild/nix-quick-install-action@v25 + - uses: nixbuild/nix-quick-install-action@v32 # - uses: DeterminateSystems/magic-nix-cache-action@main - uses: divnix/std-action/run@main @@ -53,7 +53,7 @@ jobs: name: ${{ matrix.target.jobName }} runs-on: ${{ inputs.runs-on }} steps: - - uses: nixbuild/nix-quick-install-action@v25 + - uses: nixbuild/nix-quick-install-action@v32 # - uses: DeterminateSystems/magic-nix-cache-action@main - uses: divnix/std-action/run@main @@ -66,7 +66,7 @@ jobs: name: ${{ matrix.target.jobName }} runs-on: ${{ inputs.runs-on }} steps: - - uses: nixbuild/nix-quick-install-action@v25 + - uses: nixbuild/nix-quick-install-action@v32 - uses: actions/checkout@v3 - name: Update subflake references run: ./.github/workflows/update-subflake.sh diff --git a/.github/workflows/update-subflake.sh b/.github/workflows/update-subflake.sh index 38b6e4aa..adb8a0a0 100755 --- a/.github/workflows/update-subflake.sh +++ b/.github/workflows/update-subflake.sh @@ -1,12 +1,6 @@ # create the store path of nix store add-path --name source . -# update the subflake lockfile to the (now existing) store path -# set lastModified to 1 because unknown issues in the GH action environment -(cd ./src/local && nix flake lock --update-input std && ( - jq '.nodes.std.locked.lastModified = 1' flake.lock > flake.lock.new && rm flake.lock && mv flake.lock.new flake.lock -) && git add -f flake.lock) -(cd ./src/tests && nix flake lock --update-input std && ( - jq '.nodes.std.locked.lastModified = 1' flake.lock > flake.lock.new && rm flake.lock && mv flake.lock.new flake.lock -) &&git add -f flake.lock) -# continue normally ... +# This locks subflakes to the latest commit of std +(cd ./src/local && nix flake lock --override-input std git+file://$(pwd)/../..?rev=$(git -C ../.. rev-parse HEAD)&shallow=1) +(cd ./src/tests && nix flake lock --override-input std git+file://$(pwd)/../..?rev=$(git -C ../.. rev-parse HEAD)&shallow=1) diff --git a/flake.nix b/flake.nix index 2b1ea2be..07fcb8dd 100644 --- a/flake.nix +++ b/flake.nix @@ -4,6 +4,7 @@ # SPDX-License-Identifier: Unlicense { description = "The Nix Flakes framework for perfectionists with deadlines"; + inputs.self.shallow = true; # override downstream with inputs.std.inputs.nixpkgs.follows = ... inputs.nixpkgs.url = "github:nixos/nixpkgs/release-23.11"; inputs.lib.url = "github:nix-community/nixpkgs.lib"; @@ -70,7 +71,7 @@ inherit (fwlib') blockTypes actions dataWith flakeModule grow growOn findTargets; }; in - assert inputs.nixpkgs.lib.assertMsg ((builtins.compareVersions builtins.nixVersion "2.13") >= 0) "The truth is: you'll need a newer nix version to use Standard (minimum: v2.13)."; + assert inputs.nixpkgs.lib.assertMsg ((builtins.compareVersions builtins.nixVersion "2.23") >= 0) "The truth is: you'll need a newer nix version to use Standard (minimum: v2.23)."; (import ./dogfood.nix (inputs // { std = std // {inherit (inputs.self) narHash;};