mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-14 11:57:34 +00:00
86fe053806
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
41 lines
798 B
Nix
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
|
|
];
|
|
|
|
};
|
|
}
|