The foundation: a common base for nix-darwin, NixOS and home-manager machines, shipped as a
flake-parts module in the
dendritic pattern. It brings options (kiso.*) and
features (flake.modules.<darwin|nixos|homeManager>.<name>); the consuming flake brings the
values and the hosts.
Input names don't matter to kiso; the example uses its owner's convention (scorsi- for their own
flakes, to tell them apart from external ones).
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-26.05-darwin";
flake-parts.url = "github:hercules-ci/flake-parts";
scorsi-kiso = {
url = "github:scorsi/kiso";
inputs.nixpkgs.follows = "nixpkgs"; # and any other input you share with it
};
};
outputs =
inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
inputs.scorsi-kiso.flakeModules.default
./modules # your own features, values and hosts
];
};
}Then set the values (kiso.owner, kiso.configDir, kiso.stateVersions) and declare hosts that
import features by name: config.flake.modules.darwin.fish, homeManager.git… See
example.nix, which kiso's own nix flake check builds.
| Option | What it is |
|---|---|
kiso.owner |
the primary user: name, full name, email, FIDO2 SSH keys (login and commit signing) |
kiso.configDir |
where the consuming flake is cloned, relative to home (drs rebuilds from there) |
kiso.reposDir |
where clones of other repos live (repositories by default; kanna's live clone) |
kiso.stateVersions |
darwin, nixos, homeManager state versions |
secrets is only the sops-nix wiring (decrypt with the host's SSH key); the secrets and their
.sops.yaml belong to the consumer. Per-host SSH settings (agent forwarding, shared connections)
too: add programs.ssh.settings."<hosts>" blocks in a feature of your own.
Flake plumbing: supported systems, the darwinConfigurations option, nix fmt, nix develop
(Nix linters, sops, age), checks that build every host of the current system, and the apps
switch (darwin-rebuild + nvd diff), check, fmt.
From a consuming flake, without pushing:
nix run .#switch -- --override-input scorsi-kiso path:$HOME/repositories/kisoThen push kiso, nix flake update scorsi-kiso in the consumer, switch, commit its flake.lock. Here:
nix fmt, nix flake check.
Nothing about a specific machine, network or person lives here: no host names, domains, IPs, personal paths or secrets. Those are the consumer's values.
