Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add github CI #5

Merged
merged 4 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Build & Test (nix)"

# FIXME: This build is too large and runs out of space
# on github runners.
# on:
# pull_request:
# push:
# branches:
# - master

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Run the Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Check
run: |
nix flake check
21 changes: 21 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -132,5 +132,26 @@
];
};
};

nixosMachines = forAllSystems (
system: let
# Filter the configurations to those that match the current system
matchingSystemConfigurations = nixpkgs.lib.filterAttrs (_: c: c.pkgs.system == system) self.nixosConfigurations;

# Map each matching configuration to its top-level system derivation
toplevelDerivations = nixpkgs.lib.mapAttrs (_: c: c.config.system.build.toplevel) matchingSystemConfigurations;
in
toplevelDerivations
);

checks =
forAllSystems (
system:
{
}
# Add all our homemanager configurations
// (nixpkgs.lib.mapAttrs (_: c: c.activationPackage) (nixpkgs.lib.filterAttrs (_: c: c.pkgs.system == system) self.homeConfigurations))
)
// self.nixosMachines;
};
}