aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-22 16:22:04 +0000
committertv <tv@krebsco.de>2026-11-22 16:22:13 +0000
commit1aaa2cb7b8e08430c58dd3fae781359e9e308a50 (patch)
tree79f27935bcd4f08d5dc1e0ad7b8ce8c3ff691f14
parent40b229a047e578fa11c7d4cffb7aebc74fab3822 (diff)
krops populate: grep and sed in PATH
populate runs grep and sed, for pass sources, Git work trees, and git sources on local targets. pkgs.populate puts gnugrep and gnused into the PATH it gives populate, so the caller's PATH doesn't need them.
-rw-r--r--CHANGELOG.md4
-rw-r--r--pkgs/krops/populate.nix13
2 files changed, 9 insertions, 8 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f1597a2..69b53c8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,8 +19,8 @@
- Populate runs shell code with `/bin/sh`. If the target lacks commands
populate runs there, `flock`, rsync, `patch`, Git, grep, sed, or
findutils, populate warns, and gets them from the target's `<nixpkgs>`
- with `nix-build`.
- `pkgs.populate` puts util-linux and gnupatch in `PATH` as well.
+ with `nix-build`. `pkgs.populate` puts util-linux, gnupatch, grep, and
+ sed in `PATH` as well.
- `lib/with.nix` is krops' lib without nixpkgs' lib, which it takes from
its caller, e.g. a flake's `nixpkgs.lib`. `pkgs.krops`, `pkgs.populate`
and krops' flake use the nixpkgs lib they get, instead of
diff --git a/pkgs/krops/populate.nix b/pkgs/krops/populate.nix
index 18c036c..6d0286a 100644
--- a/pkgs/krops/populate.nix
+++ b/pkgs/krops/populate.nix
@@ -1,8 +1,8 @@
# pkgs.populate: given populate's arguments, it checks them, and returns a
# script running populate-unwrapped, the program in ../populate, with them,
# the sources as JSON.
-{ coreutils, findutils, git, gnupatch, lib, nix, openssh, pass, passage, rsync
-, util-linux, writers
+{ coreutils, findutils, git, gnugrep, gnupatch, gnused, lib, nix, openssh, pass
+, passage, rsync, util-linux, writers
, populate-unwrapped
, ...
}@args:
@@ -15,8 +15,9 @@ let
# set. They come through ..., because callPackage would set named ones.
unused = builtins.filter (name: args ? ${name}) [ "dash" "implementation" "jq" ];
unexpected = builtins.attrNames (removeAttrs args ([
- "coreutils" "findutils" "git" "gnupatch" "lib" "nix" "openssh" "pass"
- "passage" "rsync" "util-linux" "writers" "populate-unwrapped"
+ "coreutils" "findutils" "git" "gnugrep" "gnupatch" "gnused" "lib" "nix"
+ "openssh" "pass" "passage" "rsync" "util-linux" "writers"
+ "populate-unwrapped"
] ++ unused));
populate =
@@ -34,8 +35,8 @@ let
set -efu
echo + "$0" >&2
PATH=${lib.makeBinPath [
- coreutils findutils git gnupatch nix openssh pass passage rsync
- util-linux
+ coreutils findutils git gnugrep gnupatch gnused nix openssh pass passage
+ rsync util-linux
]}''${PATH:+:$PATH}
export PATH
# The sources on a file descriptor of their own, so the commands