summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hoang <enzime@users.noreply.github.com>2024-11-03 21:52:58 +1100
committerMichael Hoang <enzime@users.noreply.github.com>2024-11-07 15:26:53 +1100
commit68637ee7dbdb194755697930c36272ad115af4a6 (patch)
tree188bbca06615d86330947c1aecc7a98da73117a2
parentc13549d7a632fc107bc8802463806fc2002c9c54 (diff)
flake: expose `jobs` from `release.nix` as a flattened attrset
-rw-r--r--.github/workflows/test.yml8
-rw-r--r--.github/workflows/update-manual.yml2
-rw-r--r--flake.nix23
-rw-r--r--release.nix6
4 files changed, 15 insertions, 24 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index bb247e9..709edd3 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -19,8 +19,8 @@ jobs:
with:
install_url: https://releases.nixos.org/nix/nix-2.18.8/install
- run: nix-build ./release.nix -I nixpkgs=channel:${{ env.CURRENT_STABLE_CHANNEL }} -I darwin=. -A tests
- - run: nix-build ./release.nix -I nixpkgs=channel:${{ env.CURRENT_STABLE_CHANNEL }} -I darwin=. -A manpages
- - run: nix-build ./release.nix -I nixpkgs=channel:${{ env.CURRENT_STABLE_CHANNEL }} -I darwin=. -A examples.simple
+ - run: nix-build ./release.nix -I nixpkgs=channel:${{ env.CURRENT_STABLE_CHANNEL }} -I darwin=. -A docs
+ - run: nix-build ./release.nix -I nixpkgs=channel:${{ env.CURRENT_STABLE_CHANNEL }} -I darwin=. -A examples
test-unstable:
runs-on: macos-13
@@ -32,8 +32,8 @@ jobs:
with:
install_url: https://releases.nixos.org/nix/nix-2.24.9/install
- run: nix-build ./release.nix -I nixpkgs=channel:nixpkgs-unstable -I darwin=. -A tests
- - run: nix-build ./release.nix -I nixpkgs=channel:nixpkgs-unstable -I darwin=. -A manpages
- - run: nix-build ./release.nix -I nixpkgs=channel:nixpkgs-unstable -I darwin=. -A examples.simple
+ - run: nix-build ./release.nix -I nixpkgs=channel:nixpkgs-unstable -I darwin=. -A docs
+ - run: nix-build ./release.nix -I nixpkgs=channel:nixpkgs-unstable -I darwin=. -A examples
install-against-stable:
runs-on: macos-13
diff --git a/.github/workflows/update-manual.yml b/.github/workflows/update-manual.yml
index 36e2fd8..19638a2 100644
--- a/.github/workflows/update-manual.yml
+++ b/.github/workflows/update-manual.yml
@@ -21,7 +21,7 @@ jobs:
- name: Build manual
run: |
- nix-build ./release.nix -I nixpkgs=channel:nixpkgs-24.05-darwin -I darwin=. -A manualHTML
+ nix build .#manualHTML --override-input nixpkgs nixpkgs/nixpkgs-24.05-darwin
- name: Push update to manual
run: |
diff --git a/flake.nix b/flake.nix
index 8d50f95..48dc312 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,9 +1,12 @@
{
- # WARNING this is very much still experimental.
description = "A collection of darwin modules";
outputs = { self, nixpkgs }: let
forAllSystems = nixpkgs.lib.genAttrs [ "aarch64-darwin" "x86_64-darwin" ];
+
+ jobs = forAllSystems (system: import ./release.nix {
+ inherit nixpkgs system;
+ });
in {
lib = {
evalConfig = import ./eval-config.nix;
@@ -55,21 +58,7 @@
description = "nix flake init -t nix-darwin";
};
- checks = forAllSystems (system: let
- simple = self.lib.darwinSystem {
- modules = [
- self.darwinModules.simple
- { nixpkgs.hostPlatform = system; }
- ];
- };
- in {
- simple = simple.system;
-
- inherit (simple.config.system.build.manual)
- optionsJSON
- manualHTML
- manpages;
- });
+ checks = forAllSystems (system: jobs.${system}.tests // jobs.${system}.examples);
packages = forAllSystems (system: let
pkgs = import nixpkgs {
@@ -80,6 +69,8 @@
default = self.packages.${system}.darwin-rebuild;
inherit (pkgs) darwin-option darwin-rebuild darwin-version darwin-uninstaller;
+
+ inherit (jobs.${system}.docs) manualHTML manpages optionsJSON;
});
};
}
diff --git a/release.nix b/release.nix
index cba4210..18fb239 100644
--- a/release.nix
+++ b/release.nix
@@ -59,9 +59,9 @@ let
}) (config: config.system.build.manual);
in {
- manualHTML = manual.manualHTML;
- manpages = manual.manpages;
- options = manual.optionsJSON;
+ docs = {
+ inherit (manual) manualHTML manpages optionsJSON;
+ };
examples.hydra = makeSystem ./modules/examples/hydra.nix;
examples.lnl = makeSystem ./modules/examples/lnl.nix;