Skip to content

Commit

Permalink
Merge pull request #1149 from Enzime/push-lorzxpskntmx
Browse files Browse the repository at this point in the history
flake: expose docs on Linux as well
  • Loading branch information
Enzime authored Nov 9, 2024
2 parents 3224bb2 + 2ff55ab commit 814f2c2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
15 changes: 9 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
description = "A collection of darwin modules";

outputs = { self, nixpkgs }: let
forAllSystems = nixpkgs.lib.genAttrs [ "aarch64-darwin" "x86_64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs [ "aarch64-darwin" "x86_64-darwin" "aarch64-linux" "x86_64-linux" ];
forDarwinSystems = nixpkgs.lib.genAttrs [ "aarch64-darwin" "x86_64-darwin" ];

jobs = forAllSystems (system: import ./release.nix {
inherit nixpkgs system;

nix-darwin = self;
});
in {
lib = {
Expand Down Expand Up @@ -58,9 +61,11 @@
description = "nix flake init -t nix-darwin";
};

checks = forAllSystems (system: jobs.${system}.tests // jobs.${system}.examples);
checks = forDarwinSystems (system: jobs.${system}.tests // jobs.${system}.examples);

packages = forAllSystems (system: let
packages = forAllSystems (system: {
inherit (jobs.${system}.docs) manualHTML manpages optionsJSON;
} // (nixpkgs.lib.optionalAttrs (nixpkgs.lib.hasSuffix "darwin" system) (let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
Expand All @@ -69,8 +74,6 @@
default = self.packages.${system}.darwin-rebuild;

inherit (pkgs) darwin-option darwin-rebuild darwin-version darwin-uninstaller;

inherit (jobs.${system}.docs) manualHTML manpages optionsJSON;
});
})));
};
}
11 changes: 11 additions & 0 deletions release.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{ nixpkgs ? <nixpkgs>
# Adapted from https://github.com/NixOS/nixpkgs/blob/e818264fe227ad8861e0598166cf1417297fdf54/pkgs/top-level/release.nix#L11
, nix-darwin ? { }
, system ? builtins.currentSystem
, supportedSystems ? [ "x86_64-darwin" "aarch64-darwin" ]
, scrubJobs ? true
Expand Down Expand Up @@ -56,6 +58,15 @@ let

manual = buildFromConfig ({ lib, config, ... }: {
system.stateVersion = lib.mkDefault config.system.maxStateVersion;

system.darwinVersionSuffix = let
shortRev = nix-darwin.shortRev or nix-darwin.dirtyShortRev or null;
in
lib.mkIf (shortRev != null) ".${shortRev}";
system.darwinRevision = let
rev = nix-darwin.rev or nix-darwin.dirtyRev or null;
in
lib.mkIf (rev != null) rev;
}) (config: config.system.build.manual);

in {
Expand Down

0 comments on commit 814f2c2

Please sign in to comment.