1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00
nix-darwin/modules/nix/nix-darwin.nix
Daiderd Jordan 86fe053806
darwin: include nix in PATH
This makes rollbacks more reliable, previously you had to fix your PATH
before calling darwin-rebuild. This works now:

$ /nix/var/nix/profiles/system-866-link/sw/bin/darwin-rebuild switch -G 866
2018-01-14 22:24:36 +01:00

41 lines
798 B
Nix

{ config, pkgs, ... }:
let
inherit (pkgs) stdenv;
writeProgram = name: env: src:
pkgs.substituteAll ({
inherit name src;
dir = "bin";
isExecutable = true;
} // env);
darwin-option = writeProgram "darwin-option"
{
inherit (config.system) profile;
inherit (stdenv) shell;
}
../../pkgs/nix-tools/darwin-option.sh;
darwin-rebuild = writeProgram "darwin-rebuild"
{
inherit (config.system) profile;
inherit (stdenv) shell;
path = "${pkgs.coreutils}/bin:${config.nix.package}/bin:${config.environment.systemPath}";
}
../../pkgs/nix-tools/darwin-rebuild.sh;
in
{
config = {
environment.systemPackages =
[ # Include nix-tools by default
darwin-option
darwin-rebuild
];
};
}