-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
15 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,41 +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) }} | ||
|
||
name: build ${{ matrix.pkg }} | ||
runs-on: ${{ matrix.os }} | ||
- uses: jlumbroso/[email protected] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: DeterminateSystems/nix-installer-action@v9 | ||
with: | ||
extra-conf: | | ||
auto-optimise-store = true | ||
- name: setup cachix | ||
- name: Setup Cachix | ||
uses: cachix/cachix-action@v13 | ||
with: | ||
name: uku3lig | ||
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} | ||
|
||
- name: build | ||
run: nix build -L --accept-flake-config .#${{ matrix.pkg }} | ||
- name: Build | ||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
]; | ||
} |