mirror of
https://github.com/NixOS/nix.git
synced 2025-11-08 19:46:02 +01:00
flake.nix: Add nix run .#open-manual
Great for reviewing the rendered manual
This commit is contained in:
parent
7e8db2eb59
commit
b558dac7a9
1 changed files with 21 additions and 0 deletions
21
flake.nix
21
flake.nix
|
|
@ -471,6 +471,27 @@
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
apps = forAllSystems (
|
||||||
|
system:
|
||||||
|
let
|
||||||
|
pkgs = nixpkgsFor.${system}.native;
|
||||||
|
opener = if pkgs.stdenv.isDarwin then "open" else "xdg-open";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
open-manual = {
|
||||||
|
type = "app";
|
||||||
|
program = "${pkgs.writeShellScript "open-nix-manual" ''
|
||||||
|
manual_path="${self.packages.${system}.nix-manual}/share/doc/nix/manual/index.html"
|
||||||
|
if ! ${opener} "$manual_path"; then
|
||||||
|
echo "Failed to open manual with ${opener}. Manual is located at:"
|
||||||
|
echo "$manual_path"
|
||||||
|
fi
|
||||||
|
''}";
|
||||||
|
meta.description = "Open the Nix manual in your browser";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
devShells =
|
devShells =
|
||||||
let
|
let
|
||||||
makeShell = import ./packaging/dev-shell.nix { inherit lib devFlake; };
|
makeShell = import ./packaging/dev-shell.nix { inherit lib devFlake; };
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue