mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-05 16:27:03 +00:00
43 lines
887 B
Nix
43 lines
887 B
Nix
{ config, pkgs, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
inherit (pkgs) stdenv;
|
|
|
|
extraPath = lib.makeBinPath [ config.nix.package pkgs.coreutils pkgs.jq pkgs.git ];
|
|
|
|
writeProgram = name: env: src:
|
|
pkgs.substituteAll ({
|
|
inherit name src;
|
|
dir = "bin";
|
|
isExecutable = true;
|
|
} // env);
|
|
|
|
darwin-option = writeProgram "darwin-option"
|
|
{
|
|
inherit (stdenv) shell;
|
|
path = "${extraPath}:${config.environment.systemPath}";
|
|
}
|
|
../../pkgs/nix-tools/darwin-option.sh;
|
|
|
|
darwin-rebuild = writeProgram "darwin-rebuild"
|
|
{
|
|
inherit (config.system) profile;
|
|
inherit (stdenv) shell;
|
|
path = "${extraPath}:${config.environment.systemPath}";
|
|
}
|
|
../../pkgs/nix-tools/darwin-rebuild.sh;
|
|
in
|
|
|
|
{
|
|
config = {
|
|
|
|
environment.systemPackages =
|
|
[ # Include nix-tools by default
|
|
darwin-option
|
|
darwin-rebuild
|
|
];
|
|
|
|
};
|
|
}
|