diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 3951b60..f1cd0ca 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -27,10 +27,14 @@ jobs: nix run .#nixpkgs.mine.x86_64-linux.attic-client -- \ login --set-default colony https://nix-cache.nul.ie "${{ secrets.NIX_CACHE_TOKEN }}" - # - name: Check flake - # run: nix flake check + - name: Check and build flake + id: build + run: | + nix flake check + + path=$(nix build --no-link .#ci.x86-64_linux --json | jq -r .[0].outputs.out) + echo "path=$path" >> "$GITHUB_OUTPUT" - name: Push to cache run: | - path=$(nix build --no-link .#nixosConfigurations.middleman.config.system.build.toplevel --json | jq -r .[0].outputs.out) nix run .#nixpkgs.mine.x86_64-linux.attic-client -- \ - push main $path + push main ${{ steps.build.outputs.path }} diff --git a/flake.nix b/flake.nix index c7bdac1..5f2a203 100644 --- a/flake.nix +++ b/flake.nix @@ -51,8 +51,8 @@ ... }: let - inherit (builtins) mapAttrs; - inherit (lib) genAttrs recurseIntoAttrs evalModules; + inherit (builtins) mapAttrs replaceStrings; + inherit (lib) mapAttrs' nameValuePair recurseIntoAttrs evalModules; inherit (lib.flake) flattenTree eachDefaultSystem; inherit (lib.my) mkDefaultSystemsPkgs flakePackageOverlay; @@ -167,12 +167,15 @@ shell = pkgs.devshell.mkShell ./devshell; in # Stuff for each platform - { + rec { checks = flattenTree { homeConfigurations = recurseIntoAttrs (mapAttrs (_: h: h.activationPackage) (lib.filterAttrs (_: h: h.config.nixpkgs.system == system) self.homeConfigurations)); deploy = recurseIntoAttrs (pkgs.deploy-rs.lib.deployChecks self.deploy); }; + ci = + let drvs = mapAttrs' (n: v: nameValuePair (replaceStrings ["/"] ["-"] n) v) checks; in + pkgs.linkFarm "ci" drvs; packages = flattenTree (import ./pkgs { inherit lib pkgs; });