diff --git a/.gitea/workflows/update-clan-core-for-checks.yml b/.gitea/workflows/update-clan-core-for-checks.yml deleted file mode 100644 index ed37eedff..000000000 --- a/.gitea/workflows/update-clan-core-for-checks.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: "Update pinned clan-core for checks" -on: - repository_dispatch: - workflow_dispatch: - schedule: - - cron: "51 2 * * *" -jobs: - update-pinned-clan-core: - runs-on: nix - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Update clan-core for checks - run: nix run .#update-clan-core-for-checks - - name: Create pull request - env: - CI_BOT_TOKEN: ${{ secrets.CI_BOT_TOKEN }} - run: | - export GIT_AUTHOR_NAME=clan-bot GIT_AUTHOR_EMAIL=clan-bot@clan.lol GIT_COMMITTER_NAME=clan-bot GIT_COMMITTER_EMAIL=clan-bot@clan.lol - git commit -am "Update pinned clan-core for checks" - - # Use shared PR creation script - export PR_BRANCH="update-clan-core-for-checks" - export PR_TITLE="Update Clan Core for Checks" - export PR_BODY="This PR updates the pinned clan-core flake input that is used for checks." - - ./.gitea/workflows/create-pr.sh diff --git a/checks/flake-module.nix b/checks/flake-module.nix index b5580ead2..69c43aadd 100644 --- a/checks/flake-module.nix +++ b/checks/flake-module.nix @@ -2,6 +2,7 @@ self, lib, inputs, + privateInputs ? { }, ... }: let @@ -156,7 +157,7 @@ in ''; clan-core-for-checks = pkgs.runCommand "clan-core-for-checks" { } '' - cp -r ${pkgs.callPackage ./clan-core-for-checks.nix { }} $out + cp -r ${privateInputs.clan-core-for-checks} $out chmod -R +w $out cp ${../flake.lock} $out/flake.lock diff --git a/checks/flash/flake-module.nix b/checks/flash/flake-module.nix index 25dbd76ac..f6b1bdc03 100644 --- a/checks/flash/flake-module.nix +++ b/checks/flash/flake-module.nix @@ -2,6 +2,7 @@ config, self, lib, + privateInputs, ... }: { @@ -80,7 +81,7 @@ # Some distros like to automount disks with spaces machine.succeed('mkdir -p "/mnt/with spaces" && mkfs.ext4 /dev/vdb && mount /dev/vdb "/mnt/with spaces"') - machine.succeed("clan flash write --debug --flake ${self.checks.x86_64-linux.clan-core-for-checks} --yes --disk main /dev/vdb test-flash-machine-${pkgs.hostPlatform.system}") + machine.succeed("clan flash write --debug --flake ${privateInputs.clan-core-for-checks} --yes --disk main /dev/vdb test-flash-machine-${pkgs.hostPlatform.system}") ''; } { inherit pkgs self; }; }; diff --git a/checks/installation/flake-module.nix b/checks/installation/flake-module.nix index b02a30b24..e5349f4b9 100644 --- a/checks/installation/flake-module.nix +++ b/checks/installation/flake-module.nix @@ -1,6 +1,7 @@ { self, lib, + privateInputs, ... }: @@ -151,7 +152,7 @@ let closureInfo = pkgs.closureInfo { rootPaths = [ - self.checks.x86_64-linux.clan-core-for-checks + privateInputs.clan-core-for-checks self.clanInternals.machines.${pkgs.hostPlatform.system}.test-install-machine-with-system.config.system.build.toplevel self.clanInternals.machines.${pkgs.hostPlatform.system}.test-install-machine-with-system.config.system.build.initialRamdisk self.clanInternals.machines.${pkgs.hostPlatform.system}.test-install-machine-with-system.config.system.build.diskoScript @@ -207,7 +208,7 @@ # Prepare test flake and Nix store flake_dir = prepare_test_flake( temp_dir, - "${self.checks.x86_64-linux.clan-core-for-checks}", + "${privateInputs.clan-core-for-checks}", "${closureInfo}" ) @@ -271,7 +272,7 @@ # Prepare test flake and Nix store flake_dir = prepare_test_flake( temp_dir, - "${self.checks.x86_64-linux.clan-core-for-checks}", + "${privateInputs.clan-core-for-checks}", "${closureInfo}" ) diff --git a/checks/morph/flake-module.nix b/checks/morph/flake-module.nix index cd8cfc4b0..b0076b6e8 100644 --- a/checks/morph/flake-module.nix +++ b/checks/morph/flake-module.nix @@ -1,5 +1,6 @@ { self, + privateInputs, ... }: { @@ -54,7 +55,7 @@ testScript = '' start_all() actual.fail("cat /etc/testfile") - actual.succeed("env CLAN_DIR=${self.checks.x86_64-linux.clan-core-for-checks} clan machines morph test-morph-template --i-will-be-fired-for-using-this --debug --name test-morph-machine") + actual.succeed("env CLAN_DIR=${privateInputs.clan-core-for-checks} clan machines morph test-morph-template --i-will-be-fired-for-using-this --debug --name test-morph-machine") assert actual.succeed("cat /etc/testfile") == "morphed" ''; } { inherit pkgs self; }; diff --git a/devFlake/flake.lock b/devFlake/flake.lock index 5a08868af..7e282fa32 100644 --- a/devFlake/flake.lock +++ b/devFlake/flake.lock @@ -1,5 +1,23 @@ { "nodes": { + "clan-core-for-checks": { + "flake": false, + "locked": { + "lastModified": 1754918666, + "narHash": "sha256-OHtVG9jX7FmwkB57w/nBR+Eek+a5HLT7Y72DwXUBLFo=", + "ref": "main", + "rev": "1524dc963eb4ffc5cbf14c46316844ef51e63471", + "shallow": true, + "type": "git", + "url": "https://git.clan.lol/clan/clan-core" + }, + "original": { + "ref": "main", + "shallow": true, + "type": "git", + "url": "https://git.clan.lol/clan/clan-core" + } + }, "flake-utils": { "inputs": { "systems": [ @@ -104,6 +122,7 @@ }, "root": { "inputs": { + "clan-core-for-checks": "clan-core-for-checks", "flake-utils": "flake-utils", "nixpkgs-dev": "nixpkgs-dev", "nuschtos": "nuschtos", diff --git a/devFlake/flake.nix b/devFlake/flake.nix index 7ce911c3b..dda6483d3 100644 --- a/devFlake/flake.nix +++ b/devFlake/flake.nix @@ -15,5 +15,8 @@ inputs.systems.url = "github:nix-systems/default"; + inputs.clan-core-for-checks.url = "git+https://git.clan.lol/clan/clan-core?ref=main&shallow=1"; + inputs.clan-core-for-checks.flake = false; + outputs = inputs: inputs; } diff --git a/pkgs/flake-module.nix b/pkgs/flake-module.nix index 046ca8882..28b4f18b1 100644 --- a/pkgs/flake-module.nix +++ b/pkgs/flake-module.nix @@ -27,7 +27,6 @@ editor = pkgs.callPackage ./editor/clan-edit-codium.nix { }; classgen = pkgs.callPackage ./classgen { }; zerotierone = pkgs.callPackage ./zerotierone { }; - update-clan-core-for-checks = pkgs.callPackage ./update-clan-core-for-checks { }; }; }; } diff --git a/pkgs/update-clan-core-for-checks/default.nix b/pkgs/update-clan-core-for-checks/default.nix deleted file mode 100644 index 744d0b33f..000000000 --- a/pkgs/update-clan-core-for-checks/default.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ - writeShellApplication, - git, - jq, - nix-prefetch-git, -}: -writeShellApplication { - name = "update-clan-core-for-checks"; - runtimeInputs = [ - git - jq - nix-prefetch-git - ]; - text = '' - reporoot=$(git rev-parse --show-toplevel) - if [ -z "$reporoot" ]; then - echo "Not in a git repository. Please run this script from the root of the repository." - exit 1 - fi - cd "$reporoot" - # get latest commit of clan-core - json=$(nix-prefetch-git "$(pwd)") - sha256=$(jq -r '.sha256' <<< "$json") - rev=$(jq -r '.rev' <<< "$json") - - cat > ./checks/clan-core-for-checks.nix <