aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs
Commit message (Collapse)AuthorAgeFilesLines
* populate: run shell code with /bin/shtv10 days5-14/+18
| | | | | | populate runs shell code on the deploying machine and on the target with /bin/sh, so neither needs a shell in PATH, as the PATH a CI job runs populate with may lack one.
* populate: file sources' record setting, for provenance in the run recordtv10 days8-21/+222
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A consumer recording what a build used gets the commit of git sources, and the store paths of flake, flake-input, and derivation sources, but nothing for file sources, which often hold the configuration, taken from work trees on the deploying machine. Recording nothing about them stays the default, since they may hold secrets, whose hash could give them away. file sources' record setting, with flags that default to false, adds to the source's entry in the record: - commit: if path is in a Git work tree, the commit HEAD names, and dirty, whether git status lists anything in path. Git runs on the deploying machine, without hooks, file system monitors, and writing the index, on every run, which is cheap: a new commit can change HEAD without changing any file. - digest: what nix-hash --type sha256 --sri prints for the target path, after the flakes step, which may have rewritten its lock file. That takes reading all of it, so populate only computes it if the source changed since the last record, and else takes it from that record, which the command taking the lock prints, so a run that changes nothing reads nothing more. The record's format stays version 0: the fields are optional additions. The README documents that the record tells what populate delivered, which something changing the target directory meanwhile would make it miss, and how rsync can leave out much of what Git ignores, with :- .gitignore in a .rsync-filter file, and what that misses. record-file checks the commit, dirty, and the digest, also taken from the last record.
* populate: lock files rewritten in place change only if they differtv10 days7-60/+151
| | | | | | | | | | | | | | | | | A file or git source whose lock file the flakes step rewrites in place gets the original back from delivering it, on every run, from rsync, or from git reset, which also printed HEAD is now at, and Nix printed that it updates the lock file, so the record said the source changed on every run. Populate keeps a copy of the rewritten lock file in .populate/locks/<name>, and the flakes step compares with it, printing what Nix says about the lock file, and changed, only if it differs. Delivering such a source doesn't count bringing back the lock file: rsync returns the paths of what it changed, and the git source's script takes the lock file's path, and resets quietly if that's all that differs. relock also checks that the second, unchanged, run prints nothing about lock files, and says nothing changed, now for rewriting in place too.
* populate: fail when losing the lock, keepalives for the ssh connectiontv10 days4-36/+104
| | | | | | | | | | | | | | | | | | | | The command holding the lock can end while populate runs: killed on the target, e.g. by the OOM killer, or with the shared ssh connection, e.g. when its master gets killed, after which populate's next command would start a new one, and go on without the lock. When that command ends, so does what populate runs it with, ssh or sh, which populate's child is. So Context::shell, which every command on the target goes through, before what it changes, and before the record, checks that the child is still running, failing otherwise. A run that wasn't locked throughout doesn't get recorded, and its journal stays, so the next record tells what it changed. Context keeps the lock, which clean_up releases. The keepalives end the shared connection, and with it the command holding the lock on the target, about a minute after the target stops answering, e.g. when the network fails, instead of when TCP gives up, which may take hours. lock-lost kills the command holding the lock from a pipe source.
* populate: a lock, a journal, and a record of each runtv10 days12-208/+908
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For consumers of the target directory on the target, e.g. a CI service, which should act after a run that delivered everything, and know what it delivered. Populate holds an exclusive flock on .populate/lock from right after checking the sentinel until it's done. The command holding it runs over the shared connection, or directly, keeping the lock until its input ends, which populate's ending ends as well, so no lock stays behind. Runs wait for each other, and for consumers holding a shared lock, saying so. The sentinel is a directory, which a sentinel file becomes, since there's always state to keep now, and the target needs flock. Populate keeps a journal in .populate/journal, a line of JSON for each entry: a run starting, beginning to deliver or change a source, what that changed, and pruning. The entries go with the next command on the target, before what that changes, so the journal needs no commands of its own. After delivering everything, populate replaces .populate/run.json with the record of the run, which sums up the journal, and removes the journal. A run that doesn't finish leaves it, so changed in the record means changed since the last record: a source the journal tells began changing, without what it changed, counts as changed. The record has, for each source, its type, whether it changed, and what got delivered: the commit of a git source, the store path of a flake, flake-input, or derivation source, and the derived one, and a symlink's target. Nothing about secrets, nor files. Each source type is a Kind, whose deliver returns the Outcome: whether anything changed, and what got delivered. rsync tells changes by what it itemizes, the snippets by printing changed: the git source if it cloned, reset, or submodule updates or cleaning printed anything, links if they point elsewhere, and lock files and generated flakes if they differ. Symlinks in place of the lock or the journal get refused. A file or git source whose lock file populate rewrites in place counts as changed on every run, since delivering it brings back the original.
* krops: leave targets to populate, also in pure evaluationtv2026-11-143-70/+132
| | | | | | | | | | | | | | | | | | | | | | | | writeDeploy, writeCommand, and writeTest pass target strings to pkgs.populate as they are, so populate fills in what they leave out, and decides whether the target is local, when it runs. runShell runs populate shell, which decides that for running nixos-rebuild and writeCommand's commands, so rebuild's unbuffer for local targets with allocateTTY depends on $1, and runShell returns shell code, also for remote targets. Target attribute sets get mkTarget's defaults and whether they're local during evaluation, as before, unless that's pure: then mkTarget leaves the user and the host null, instead of reading /etc/hostname, which pure evaluation pretends doesn't exist, and pkgs.populate and populate shell leave them, and whether the target is local, to populate, which also refuses copying flakes to targets using sudo then. writeTest checks that its target is local during evaluation, unless that's pure, and with populate shell --local-only before populating. writeDeploy needs a target's host for a separate buildTarget in pure evaluation. pkgs/krops/target.nix has what pkgs.populate and pkgs.krops need of targets. pkgs.populate's derivations stay the same, for strings and attribute sets. The deploy scenarios get target strings too, for the local and the remote target, and so does the allocateTTY scenario.
* populate: populate shell, running shell code on a targettv2026-11-144-67/+379
| | | | | | | | | | | | | | | | populate shell [OPTION]... TARGET SCRIPT runs SCRIPT with /bin/sh on TARGET, reached like populate reaches it, deciding whether it's local when it runs, with local or remote as $1, so SCRIPT can tell. It takes populate's target options but --path, and --tty, giving SCRIPT a terminal on a remote target, and --local-only, failing before connecting unless the target is local. It replaces itself with the command running SCRIPT, so the exit status, the terminal, and signals are SCRIPT's. krops can run nixos-rebuild with it, which needs whether the target is local, unless it decides that during evaluation, which pure evaluation can't. The command line's parsing is shared between populate and populate shell.
* krops: use lib/with.nix everywhere, and no withtv2026-11-145-53/+53
| | | | | | | | | | | | lib/default.nix is for backwards compatibility only, so the examples in the README and ci.nix use lib/with.nix, as klib, with nixpkgs' lib from pkgs. pkgs.populate and its checks name what they use from nixpkgs' lib, builtins, and klib, instead of bringing them into scope with with, and the scenarios inherit what they use from the builder and nixpkgs' lib, which the builder doesn't pass on anymore. Nix tells undefined names when parsing then, and a name means the same wherever it's used. The derivations and the scenarios stay the same.
* krops: take nixpkgs' lib from the callertv2026-11-143-21/+29
| | | | | | | | | | | krops' lib imported <nixpkgs/lib>, which pure evaluation doesn't allow, and so did pkgs.krops and pkgs.populate, through it, also in krops' flake. lib/with.nix is krops' own lib, a function taking nixpkgs' lib, without merging it in. pkgs.krops and pkgs.populate use it with the lib callPackage gives them, nixpkgs.lib in krops' flake, and lib/default.nix is what it was: <nixpkgs/lib>, builtins, and krops' own lib, merged. The derivations stay the same.
* populate: passage sources default identities_file when populate runstv2026-11-147-10/+29
| | | | | | | | | | | | The default, toString ~/.passage/identities, is a path relative to the home directory, which Nix resolves when parsing the file defining it, populate's Nix library's types, so evaluating any sources failed in pure mode, e.g. in a flake. identities_file defaults to null, which leaves it out of the sources, and populate defaults it to ~/.passage/identities, in HOME, when it runs. The passage scenarios also run without identities_file, with HOME a directory that has .passage/identities.
* populate: print what Nix says about lock files only if something changedtv2026-11-144-10/+85
| | | | | | | | | | | | | | | | | | Looking at a flake with inputs drawn from sources, populate overrides those inputs with an empty flake, which makes Nix warn that it doesn't write the lock file it changed, listing the overrides, on every run, locally for archiving a flake or flake-input source, and on the target for checking the inputs drawn. nix_looking leaves that warning out of what Nix prints. A generated flake gets locked anew on every run, so it pins what the inputs are now, which made Nix print that it creates the lock file, listing all inputs, on every run. That only gets printed if the lock file differs from the one there was. No phase is expected to print Nix's warning, and relock's second phase, which changes nothing, isn't expected to print anything about the generated flake's lock file.
* tests: silence network interface warningstv2026-11-141-1/+12
|
* populate: copy flakes only if the target lacks some of their store pathstv2026-11-142-5/+16
| | | | | | | nix copy connects anew, without the shared connection, also when the target has all of a flake's store paths already, and then copies nothing. The shared connection tells which store paths the target lacks, and nix copy only copies those, if any.
* populate: check each Git work tree once per runtv2026-11-145-128/+254
| | | | | | | | | | | | | | | | | git_problems looks through all of a work tree for .git files and directories, which takes long for big ones like nixpkgs. A git source drawn from by a flake-input source got checked three times per run: when delivering it, by resolve, deciding on git+file:, and by derived_state, for the key. populate notes the work trees git_problems found nothing wrong with during the run, and resolve and derived_state get told, so git_flake only checks the rest, e.g. hooks. The git source's script prints checked if it checked the work tree that was there, instead of making a fresh clone. Its commands print to standard error, without getting the standard output populate reads, so nothing they leave running keeps populate waiting. rewrite-cache-gitsource is rewrite-cache-git with a git source.
* populate: git sources reset the work tree only if it differs from the committv2026-11-142-3/+11
| | | | | | | | | | | Resetting a work tree that is at the commit already rewrites Git's index, after comparing each tracked file with it, which takes long for big work trees like nixpkgs, and comparing alone takes about a third of that. So git sources reset only if HEAD isn't the commit, or a tracked file differs from it, as git status tells, which also covers a lock file Nix created and staged. The git scenarios also change a tracked file, which redeploying resets.
* populate: tests: rewrite-cache-git's flake has who, which dep usestv2026-11-141-2/+2
| | | | | dep's greeting is "dep+" and the who of its input inner, so the flake the scenario draws inner from needs who, not greeting.
* populate: tell whether a Git work tree drawn from changed by its committv2026-11-144-26/+117
| | | | | | | | | | | | | | | | | | | Whether a derived copy of a flake or flake-input source needs to be made again depends on the sources it draws inputs from. For one that isn't in the store, the key had its hash, so every run read all of it, e.g. all of a nixpkgs work tree, .git included, which takes long even when nothing changed. For a Git work tree that Nix gets as git+file:, whose commit and tracked files are all Nix uses, the key has its commit instead, if no tracked file differs from it, which Git tells quickly. git_flake decides what Nix gets as git+file:, for resolve as well. Keys of copies drawing from such work trees change once, so those copies get made again on the first run, also after deploying with krops 1. rewrite-cache-git checks that such a copy gets made again for a new commit, but not for redeploying, nor for an untracked file.
* populate: a README of its own, krops' linking to ittv2026-11-143-92/+635
| | | | | | | | | | | | | | pkgs/populate/README.md documents populate on its own: building it, what it needs, its command line, the sources as JSON and in Nix with its Nix library, the target directory, the source types, flake inputs from sources, what it prints, and its tests. The sections about the target directory, the source types, and flake inputs from sources move there from krops' README, which links to them from sections of the same names, and from the first mention of populate. docs/design.md keeps how populate works. krops' README describes krops' own tests, and CHANGELOG what populate being a program of its own means for krops.
* tests: populate's tests of its own, krops' using themtv2026-11-149-0/+3455
| | | | | | | | | | | | | | | | | | | | | | | | populate's tests are in pkgs/populate/tests, independent of krops. They run the program, with the sources as JSON from populate's Nix library, and target strings for the remote targets, leaving the user and whether the target is local to populate, so they cover its command line too. Phases expecting populate to refuse its arguments, e.g. a source name or a target path that can't be used, expect the program's refusal, with refused, the message, since nothing checks them during evaluation there. builder.nix is what builds the scenarios, which krops' tests use as well, with a function running the phases, and whether that checks the arguments during evaluation. vm.nix takes a module for both machines, for what else the scenarios run, and fixtures.nix and smoke.nix are what both use of the fixtures and the smoke test. krops' tests are deploy, writeDeploy's arguments to nixos-rebuild, with the stand-in for nixos-rebuild in the module, and populate, populate's scenarios that expect refusals, which pkgs.populate makes evaluation fail with, and those of populate's smoke test, all through pkgs.populate with target attribute sets as mkTarget returns them. -A only selects from all of populate's scenarios and krops' own.
* populate: layer populate below kropstv2026-11-149-136/+598
| | | | | | | | | | | | | | | | | | populate is a program of its own, with a Nix library, in pkgs/populate, which krops uses, and which doesn't use krops: - default.nix builds the program, with nix-build there or callPackage, as pkgs.populate-unwrapped. - lib is populate's Nix library: the types of sources and the POSIX types they use, evalSource, flakeFollows, hasGeneratedFlake, and derivesFlake, taking nixpkgs' lib. krops' lib takes them from there, so it provides them as before, and so does lib/types. pkgs.populate, the function from populate's arguments to a script running the program, is krops' own, in pkgs/krops/populate.nix, with checks.nix next to it. It takes the program as populate-unwrapped, which callPackage passes from the overlay; the flake, whose nixpkgs lacks it, passes its own.
* populate: a command line instead of a spectv2026-11-147-180/+619
| | | | | | | | | | | | | | | | | | | | | The program takes populate's arguments on its command line, like other programs: populate [OPTION]... SOURCES [TARGET], with the sources as JSON in the file SOURCES, or on standard input for -. TARGET has the syntax of krops' lib's mkTarget, [USER@][HOST][:PORT][PATH], parsed the same way, and what it leaves out gets filled in when populate runs, as mkTarget would, from LOGNAME and the machine's name. Options set what the syntax can't express, or override its parts: --sudo, --ssh-arg, --user, --host, --port, --path, and --local or --remote for whether the target is the machine populate runs on, which populate otherwise decides like isLocalTarget. The sources carry no version. pkgs.populate passes a target attribute set, as mkTarget returns it, part by part, with --local or --remote as evaluation decides, so nothing changes for krops. A target string goes to the program as it is. The program also refuses target hosts and users starting with -, which ssh would take for options, now that a command line can give them.
* populate: filter the program's sources by nametv2026-11-141-6/+7
| | | | | | | | The filter for the program's sources took the paths it gets relative to toString ./., which they needn't start with, e.g. if a symlink leads to the directory, so nothing matched, and the build found no Cargo.lock. It goes by the names of what it leaves out now: the Nix files, the docs, .gitignore, and cargo's target directory.
* populate: let git sources keep hooks, refuse them only for git+file:tv2026-11-131-15/+14
| | | | | | | git sources refused work trees with hooks, but populate's Git doesn't run hooks, so git-foreign's work tree with a hook is fine to use, as it expects. Only Nix's Git runs them, in a git+file: flake, so drawing inputs refers to a work tree with hooks as path: instead.
* populate: state what the target sends back for derived copies in codetv2026-11-131-32/+140
| | | | | | | | DerivedState::parse reads what derived_state prints, and key_text builds the text whose hash is a derived copy's key, the same as before, both with unit tests, instead of decoding fields by position inside Flakes::derive. Fields from the target that don't end in a null byte fail, instead of getting dropped.
* populate: decide whether a target is local like isLocalTargettv2026-11-132-13/+86
| | | | | | | | For specs whose target's local is null, the program decides whether the target is local like krops' lib's isLocalTarget: an empty LOGNAME or HOSTNAME counts as unset, as with lib.maybeEnv, and /etc/hostname's labels can be of any length, as with lib.types.label. is_local_with, pure, has unit tests.
* populate: exit with the status of the command that failedtv2026-11-133-8/+26
| | | | | | | | | | | The shell implementation runs under set -e, so it exits with the status of the command that failed, e.g. 255 if ssh can't reach the target, which wrappers retrying on connection failures rely on, or 128 if git fetch fails. The program does the same, instead of exiting with 1, and with 128 plus the signal for a command a signal ended. A phase's expect.status is the exit status it expects populate to fail with; git-status checks git fetch's.
* populate: check the settings of sources in the spectv2026-11-133-16/+172
| | | | | | | | | | | | The program checks that each source's settings are those lib/types/populate.nix defines for its type, with values of the kinds it defines, for specs from elsewhere than default.nix: a misspelt setting fails, as design.md promises, instead of being ignored, and so does a setting the program would treat as its default because of its kind. This subsumes the check of absolute paths. ln gets a symlink source's target after --, so it can't be taken for an option either.
* populate: fail if find fails looking for .rsync-filter filestv2026-11-131-10/+11
| | | | | | | | | | Looking for .rsync-filter files that apply to a file source, a failing find counted as finding none, and only happened with rsync 3.5.0 and later. Like in the shell implementation, find runs before each transfer with filter files, and its failure stops populate with find's message, e.g. for a source that's missing, or contains a directory find can't read, which would also have switched off the check of insecureLinks. A signal during find takes effect right after it.
* populate: give sizes in rsync's log in units of 1024tv2026-11-132-3/+5
| | | | | | rsync gives sizes in units of 1000 for two apostrophes, and in units of 1024 for three, which the shell implementation asks for. rsync-units checks it.
* populate: check paths in the spec, name the way into a cycletv2026-11-131-4/+63
| | | | | | | | | The program checks that the paths of file, pass, and pipe sources are absolute, as lib/types/populate.nix demands, for specs from elsewhere, so none can be taken for an option, e.g. of rsync. A cycle of sources drawing inputs from each other gets named with the way into it, like checks.nix names it.
* populate: run pipe commands through a shelltv2026-11-131-2/+2
| | | | | | | | A pipe source's command is an absolute path, which a shell runs as a script if it isn't a program, e.g. lacks #!. The program ran it directly, which fails for such a command. pipe-script runs a pipe command without #!.
* populate: refer to flakes as git+file: only with a usable .gittv2026-11-132-5/+12
| | | | | | | | | | | | | Writing the lock file of a git+file: flake, Nix runs Git, with the repository's configuration and hooks, which may run commands. A .git in a source's directory can come from anywhere, e.g. one planted in a materialized flake, or one a file source keeps. So drawing inputs refers to a flake as git+file: only if git_problems finds nothing wrong with its .git directory, the way git sources check their work trees, and else as path:. lock-foreign-git plants a .git in a materialized flake and in a file source that keeps it, whose configuration names an fsmonitor command.
* populate: check the hooks and submodules of Git work treestv2026-11-131-4/+32
| | | | | | | | | | | | | | | git submodule update uses the .git of a submodule as it finds it in the work tree: a repository of its own, with configuration that runs commands, or a file naming a repository elsewhere. So git_problems also requires each .git below the work tree to be a file naming a repository in .git/modules. And it refuses hooks in .git/hooks, which populate's Git doesn't run, but Nix's does, writing the lock file of a flake in a git source. git-submodule plants a submodule's .git in the work tree: a repository of its own whose configuration names a filter, and a file naming a repository elsewhere. The fixture withsub has gitsrc as its submodule sub.
* populate: keep URLs, refs, and names from being taken for optionstv2026-11-131-8/+9
| | | | | | | | | | A git source's url and ref are strings, and git clone, git remote, and git fetch took ones starting with - for options, e.g. --upload-pack, which runs a command where the repository is local. They come after -- now, and so does a pass source's name for git log and pass show. git-ref-option gives a ref that git fetch would take for --upload-pack.
* README: requirements, and where populate's program istv2026-11-131-3/+3
| | | | | | New users learn what the deploying machine and the target need, including nixpkgs 23.11 or later for building populate, and developers where populate's program, its description, and its unit tests are.
* populate: warn about the arguments it doesn't usetv2026-11-131-42/+57
| | | | | | | | dash, jq, and implementation, which overrides of the shell implementation set, come through ..., because callPackage sets named arguments, so populate can tell they're set, and warns that they're unused. Other arguments populate doesn't know fail, as they do for named arguments.
* populate: drop the shell implementationtv2026-11-136-1781/+78
| | | | | | | | | | | | | | | Populate is the program in Rust only. pkgs.populate checks its arguments, and returns a script running the program with them as JSON. The arguments it took for the shell implementation, dash, jq, and implementation, stay accepted and unused, so overrides setting them keep working. Copying flakes to remote targets using sudo gets refused during evaluation, as before, by checks.nix, and by the program for specs from elsewhere. The jq test goes with the jq programs; the program's unit tests cover their equivalents.
* populate: build with Rust 1.71, as in nixpkgs 23.11tv2026-11-133-3/+4
| | | | | | The program needs Rust 1.71, the oldest version its dependencies support, which Cargo.toml states, so clippy points out what newer versions add. The lock file is of version 3, which Cargo reads from version 1.53 on.
* populate: draw flake inputs natively in Rusttv2026-11-134-609/+1021
| | | | | | | | | | | | | The program decides how to draw inputs and derive copies of flake and flake-input sources itself. The target runs fixed snippets, which send back what it needs to know: where paths resolve to and what's there, the lock files of flakes as nix flake metadata prints them, and what tells whether a derived copy needs to be made again. The program checks that drawn inputs exist in the lock files, computes the keys of derived copies, and writes generated flakes. Derived copies get the same keys as with the shell implementation, so switching implementations doesn't make them again.
* populate: deliver flake and flake-input sources natively in Rusttv2026-11-139-623/+1032
| | | | | | | | | | | src/flake_input.rs reads what nix flake metadata and nix flake archive print as JSON itself: it selects the flake or input, decides what the target fetches or gets copied, and computes the store paths to root, which are what selected.jq, selfIsRemote.jq, selfLocked.jq, and the Nix expressions of the shell implementation do there. On the target, fixed snippets in sh::flake run Nix, getting values as positional parameters, and send JSON or store paths back. The jq test's cases are unit tests of the Rust equivalents.
* populate: deliver flakes and draw inputs with the Rust programtv2026-11-136-40/+1522
| | | | | | | | | | | | | The program delivers flake and flake-input sources, draws inputs from sources, and removes state that sources don't need anymore, so it does everything the shell implementation does, and passes all scenarios. src/flake.rs builds the same shell code as shell.nix generates for these, with every value quoted, so both implementations behave alike while that code moves to Rust piece by piece. The ssh scripts in the temporary directory run the ssh that was in PATH when populate started, so one can be ssh in PATH for nix copy. The other one is for nix copy's ssh:// store, without the control socket.
* populate: deliver sources other than flakes with the Rust programtv2026-11-1310-17/+1435
| | | | | | | | | | | | | | | | | | | | | | The program delivers derivation, file, git, pass, passage, pipe, and symlink sources, makes backups, and prunes, as the shell implementation does, with the same messages. Commands on the target are fixed shell snippets in src/sh.rs, which get values as positional parameters, run directly for local targets and over ssh, sharing one master connection, for remote ones. rsync's transfers and its check for .rsync-filter files it can't read are in src/rsync.rs. Given flake or flake-input sources, or sources drawing inputs from others, the program fails before changing anything, saying that these aren't implemented yet. SIGHUP, SIGINT, and SIGTERM make populate stop once the command it waits for ends, stop the ssh master, remove its temporary directory, and exit with 128 plus the signal's number. The spec's target gets local, which rust.nix sets during evaluation, like the other functions of krops decide, and which the program decides when it runs if it's null. The spec comes on file descriptor 3, so the commands populate runs keep standard input, and the tools populate runs come first in PATH.
* populate docs: describe the designtv2026-11-131-0/+177
| | | | | | | pkgs/populate/docs/design.md describes populate's parts, the program's invocation, the spec, the checks, what populate prints, its safety guarantees, how it runs commands, how to test changes, and what the program does so far.
* populate: add a Rust implementation, selectable for the teststv2026-11-1311-1603/+2224
| | | | | | | | | | | | | | | | | | | pkgs.populate takes implementation: "shell", the default, generates a script from populate's arguments, and "rust" passes them as JSON to the program in pkgs/populate, built from the crate there by program.nix. The program checks the spec as checks.nix does during evaluation, with the same messages, and reports that delivering sources isn't implemented yet. rustProgram replaces the program, e.g. with one built some other way. checks.nix holds the checks of populate's arguments during evaluation. Both implementations check the names of sources and the target path with it, and the Rust one's wrapper also checks drawing inputs, which the shell implementation checks where it draws them. nix-build tests --argstr implementation rust runs the scenarios with the Rust implementation. They expect it to refuse copying flakes to targets using sudo when it runs, not during evaluation, because only then it decides whether the target is local.
* populate, overlay: mark populate's scripts as shell, drop unused libtv2026-11-132-6/+2
| | | | | | The scripts populate writes with writeDash get /* sh */ markers like the other shell code, and the overlay doesn't import krops' lib, which it doesn't use.
* populate: omit the times of directories and symlinkstv2026-11-131-0/+4
| | | | | | | rsync sets the modification time of each directory whose contents change, and logs a line for it. Nothing relies on these times, nor on the times of symlinks, so --omit-dir-times and --omit-link-times leave them alone, and the log lists only what got transferred or deleted.
* krops: add allocateTTY to writeDeploytv2026-11-131-3/+8
| | | | | | | | | With allocateTTY, nixos-rebuild runs with a terminal, so it shows colours and progress: on remote targets, ssh gets -t, which allocates a terminal if its own input is one, and on the local target, expect's unbuffer provides one. The nixos-rebuild stand-in records whether its output is a terminal.
* populate: follow branches and tags of git sourcestv2026-11-131-17/+24
| | | | | | | | A ref that consists of 4 to 40 hex digits is a commit, which populate fetches only if the work tree lacks it, unless fetchAlways is set. Any other ref is a branch or tag, which populate fetches on every run, resetting the work tree to the commit fetched. Resetting to the name itself resolves to a local branch, which fetching doesn't move.
* populate: name the target alike in all messagestv2026-11-131-20/+20
| | | | | | | | | | | | | What populate prints names paths on the target in different ways: populating as host:path, also for the local target, pruning and the errors about the sentinel by targetName, and replacing a symlink or a Git work tree by the path alone. All of them use targetName now: the path, prefixed by the host if the target isn't local, and by the user if that isn't root. Replacing a symlink or a Git work tree quotes the path and ends with an ellipsis, like populating and pruning do. The tests expect the names that way, and rsync-log also expects the line naming the source being populated.
* populate: reduce log spamtv2026-11-131-2/+2
|