diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 98b9361..716cd04 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,32 +4,28 @@ on: push: jobs: - eval: - name: eval flake + build: runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.eval.outputs.matrix }} - steps: - - uses: actions/checkout@v4 - - uses: DeterminateSystems/nix-installer-action@v9 - - - name: evaluate packages - id: eval - run: echo "matrix=$(nix eval --json .#ghaMatrix)" >> "$GITHUB_OUTPUT" - - build: - needs: eval - strategy: - matrix: ${{ fromJson(needs.eval.outputs.matrix) }} + - uses: easimon/maximize-build-space@v10 + with: + root-reserve-mb: 2048 + remove-dotnet: 'true' + remove-android: 'true' + remove-haskell: 'true' - name: build ${{ matrix.pkg }} - runs-on: ${{ matrix.os }} + - name: we making it out of the cursed stuff with this one + run: | + mkdir -p "${GITHUB_WORKSPACE}/nix" + sudo mount --bind "${GITHUB_WORKSPACE}/nix" /nix - steps: - uses: actions/checkout@v4 + - uses: DeterminateSystems/nix-installer-action@v9 + with: + extra-conf: | + auto-optimise-store = true - name: setup cachix uses: cachix/cachix-action@v13 @@ -37,8 +33,12 @@ jobs: name: uku3lig authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} + - name: how + run: df -h + - name: build - run: nix build -L --accept-flake-config .#${{ matrix.pkg }} + run: | + nix run --inputs-from . --override-input nixpkgs nixpkgs github:Mic92/nix-fast-build -- --no-nom --skip-cached --option accept-flake-config true --flake '.#hydraJobs' deploy: needs: build diff --git a/parts/ci.nix b/parts/ci.nix index cc90dc2..30c8fa6 100644 --- a/parts/ci.nix +++ b/parts/ci.nix @@ -1,45 +1,11 @@ { self, - inputs, + lib, ... }: { - perSystem = { - lib, - pkgs, - system, - ... - }: { - packages = let - overlay = lib.fix (final: (import ../exprs/overlay.nix final pkgs)); - - # do not include a package if it's not available on the system or if it's broken - isValid = _: v: - lib.elem pkgs.system (v.meta.platforms or [pkgs.system]) && !(v.meta.broken or false); - in - lib.filterAttrs isValid overlay; + flake.hydraJobs = let + mapCfgsToDerivs = lib.mapAttrs (_: cfg: cfg.activationPackage or cfg.config.system.build.toplevel); + in { + nixosConfigurations = mapCfgsToDerivs self.nixosConfigurations; }; - - flake.ghaMatrix.include = let - inherit (inputs.nixpkgs) lib; - - platforms = { - "x86_64-linux" = { - os = "ubuntu-latest"; - }; - }; - in - lib.pipe platforms [ - builtins.attrNames # get systems - (systems: lib.getAttrs systems self.packages) # get packages of each system - (lib.mapAttrs (_: builtins.attrNames)) # keep only the name of each package - - # map each package in each system to an attrset - (lib.mapAttrsToList (system: - builtins.map (pkg: { - inherit (platforms.${system}) os; - pkg = "packages.${system}.${pkg}"; - }))) - - lib.flatten - ]; }