From 75df988e1cb9863ee5d708dbc578f7690bb182de Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Dec 2026 03:50:16 +0000 Subject: populate pipe: directory, a directory the command makes A pipe source's command printed a file. With directory set, it gets an empty directory as its first argument, mode 0700 in populate's temporary directory, which populate removes afterwards, and fills it, and populate delivers what it made there, with the modes it has, e.g. secrets with mode 0600 under 0700, and the fixed time of pipe's output, compared by checksum. Secrets that should stay in memory can go to a target directory of their own, e.g. in /run, with a populate run of its own. The scenario pipe-directory checks the modes, and that a changed directory gets mirrored, removing what's not in it anymore. --- pkgs/populate/tests/fixtures.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'pkgs/populate/tests/fixtures.sh') diff --git a/pkgs/populate/tests/fixtures.sh b/pkgs/populate/tests/fixtures.sh index 93b302d..375514c 100755 --- a/pkgs/populate/tests/fixtures.sh +++ b/pkgs/populate/tests/fixtures.sh @@ -252,6 +252,19 @@ SH chmod +x /fixtures/pipe2 echo piped > /fixtures/pipe2-data +# pipe-dir: a command for the pipe source type's directory, making a +# directory of secrets in the one it gets, like enstate --pack does, with +# what /fixtures/pipe-dir-data says, which the tests change. +cat > /fixtures/pipe-dir <<'SH' +#! /bin/sh +set -efu +umask 077 +mkdir -p "$1"/sub/deep +cat /fixtures/pipe-dir-data > "$1"/sub/deep/secret +SH +chmod +x /fixtures/pipe-dir +echo one > /fixtures/pipe-dir-data + # alt2: like alt, with other outputs, to change a source to. mkdir /fixtures/alt2 cat > /fixtures/alt2/flake.nix <<'NIX' -- cgit v1.3.1 [cgit] Unable to lock slot /tmp/cgit/2f200000.lock: Permission denied (13)