| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 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.
|
| |
|
|
|
|
|
|
|
|
|
| |
pkgs/krops takes populate as an argument, which nixpkgs doesn't provide,
so evaluating any of the flake's lib attributes from pkgs/krops fails.
The flake passes its own populate.
The README describes using krops from a flake: writeDeploy and the other
functions from lib.<system>, evalSource and mkTarget from krops' lib
directory, and deploying with nix run --impure, because krops' lib
evaluates <nixpkgs/lib>, environment variables, and /etc/hostname.
|
| |
|