1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00
nix-darwin/pkgs/nix-tools/default.nix

51 lines
1.2 KiB
Nix
Raw Permalink Normal View History

{ lib
, coreutils
, jq
, git
, substituteAll
, stdenv
, profile ? "/nix/var/nix/profiles/system"
, nixPackage ? "/nix/var/nix/profiles/default"
, systemPath ? "$HOME/.nix-profile/bin:/etc/profiles/per-user/$USER/bin:/run/current-system/sw/bin:/nix/var/nix/profiles/default/bin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin"
}:
let
extraPath = lib.makeBinPath [ nixPackage coreutils jq git ];
writeProgram = name: env: src:
substituteAll ({
inherit name src;
dir = "bin";
isExecutable = true;
2024-11-16 10:53:32 +00:00
meta.mainProgram = name;
} // env);
path = "${extraPath}:${systemPath}";
in
{
darwin-option = writeProgram "darwin-option"
{
inherit path;
inherit (stdenv) shell;
}
./darwin-option.sh;
darwin-rebuild = writeProgram "darwin-rebuild"
{
inherit path profile;
inherit (stdenv) shell;
postInstall = ''
mkdir -p $out/share/zsh/site-functions
cp ${./darwin-rebuild.zsh-completions} $out/share/zsh/site-functions/_darwin-rebuild
'';
}
./darwin-rebuild.sh;
2023-07-01 15:11:16 +00:00
darwin-version = writeProgram "darwin-version"
{
inherit (stdenv) shell;
path = lib.makeBinPath [ jq ];
}
./darwin-version.sh;
}