2024-10-11 12:58:03 -05:00
|
|
|
{
|
|
|
|
|
writeShellApplication,
|
|
|
|
|
coreutils,
|
|
|
|
|
curl,
|
|
|
|
|
gnutar,
|
2026-04-06 16:24:53 -05:00
|
|
|
inetutils,
|
2024-10-11 12:58:03 -05:00
|
|
|
nix,
|
|
|
|
|
...
|
|
|
|
|
}:
|
|
|
|
|
writeShellApplication {
|
|
|
|
|
name = "inject-darwin";
|
|
|
|
|
runtimeInputs = [
|
|
|
|
|
coreutils
|
|
|
|
|
curl
|
|
|
|
|
gnutar
|
2026-04-06 16:24:53 -05:00
|
|
|
inetutils
|
2024-10-11 12:58:03 -05:00
|
|
|
nix
|
|
|
|
|
];
|
|
|
|
|
text = ''
|
|
|
|
|
# Get my configuration
|
2026-04-06 16:21:02 -05:00
|
|
|
cd /etc/nix-darwin
|
2024-10-11 12:58:03 -05:00
|
|
|
|
|
|
|
|
# Build NixOS for this system
|
2026-04-06 16:24:53 -05:00
|
|
|
nix --extra-experimental-features "nix-command flakes" build ".#darwinConfigurations.$(hostname -s).system"
|
2026-04-06 16:21:02 -05:00
|
|
|
sudo mv /etc/bashrc /etc/bashrc.before-nix-darwin
|
|
|
|
|
sudo mv /etc/zshrc /etc/zshrc.before-nix-darwin
|
|
|
|
|
sudo ./result/sw/bin/darwin-rebuild switch --flake .
|
2024-10-11 12:58:03 -05:00
|
|
|
'';
|
|
|
|
|
}
|