Skip to content

Commit

Permalink
ci: test against stable nixos/home-manager
Browse files Browse the repository at this point in the history
  • Loading branch information
getchoo committed May 21, 2024
1 parent 52bd457 commit 10cbf90
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 6 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ jobs:
name: Test Modules
runs-on: ubuntu-latest

strategy:
matrix:
test: [unstable, stable]

steps:
- uses: actions/checkout@v4

Expand All @@ -46,5 +50,10 @@ jobs:
uses: DeterminateSystems/magic-nix-cache-action@v6

- name: Run VM
env:
TEST: ${{ matrix.test }}
run: |
nix build --print-build-logs --show-trace ./dev#checks.x86_64-linux.module-vm-test
nix build \
--print-build-logs \
--show-trace \
"./dev#checks.x86_64-linux.module-test-$TEST"
40 changes: 39 additions & 1 deletion dev/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 18 additions & 4 deletions dev/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@

inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
nixpkgs-stable.url = "nixpkgs/release-23.11";

home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};

home-manager-stable = {
url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs-stable";
};
};

outputs = { self, nixpkgs, home-manager }:
outputs = { self, nixpkgs, nixpkgs-stable, home-manager, home-manager-stable }:
let
systems = [
"x86_64-linux"
Expand All @@ -19,7 +25,12 @@
"aarch64-darwin"
];

forAllSystems = fn: nixpkgs.lib.genAttrs systems (system: fn nixpkgs.legacyPackages.${system});
nixpkgsFor = nixpkgs.lib.genAttrs systems (system: {
unstable = nixpkgs.legacyPackages.${system};
stable = nixpkgs-stable.legacyPackages.${system};
});

forAllSystems = fn: nixpkgs.lib.genAttrs systems (system: fn nixpkgsFor.${system}.unstable);
in
{
apps = forAllSystems ({ lib, pkgs, ... }: {
Expand All @@ -40,8 +51,11 @@
};
});

checks = forAllSystems ({ lib, pkgs, ... }: lib.optionalAttrs pkgs.stdenv.isLinux {
module-vm-test = pkgs.callPackage ../test.nix { inherit home-manager; };
checks = forAllSystems ({ lib, pkgs, system, ... }: lib.optionalAttrs pkgs.stdenv.isLinux {
module-test-unstable = pkgs.callPackage ../test.nix { inherit home-manager; };
module-test-stable = nixpkgsFor.${system}.stable.callPackage ../test.nix {
home-manager = home-manager-stable;
};
});

formatter = forAllSystems (pkgs: pkgs.nixpkgs-fmt);
Expand Down

0 comments on commit 10cbf90

Please sign in to comment.