nixpkgs/nixos/modules
Winter 258dca1e95 nixos/profiles/nix-builder-vm: allow the system derivation to be substituted
Consider a user wanting to set up the Linux builder for the first time,
but with a slightly more generous allocation of resources compared to
the default. They'll do something like this:

```
{
  virtualisation.cores = 3;
  virtualisation.darwin-builder = {
    diskSize = 40 * 1024;
    memorySize = 4 * 1024;
  };
}
```

This will fail with an error like this:

```
error: a 'aarch64-linux' with features {} is required to build '/nix/store/3acpgmwqwnk8g2gc5r05ar2lvmn01b8a-builder.pl.drv', but I am a 'aarch64-darwin' with features {apple-virt, benchmark, big-parallel, nixos-test}
```

But why would they have to rebuild the NixOS system?! All they did was
change the arguments passed to QEMU, and nothing those options control
would affect the NixOS configuration itself... right?

`config.system.build.toplevel` is defined with `allowSubstitutes` set to
`false` by default, which makes it so that the toplevel can't be
substituted if Nix is trying to use it "directly." So because the above
example would have to rebuild the VM runner, which references toplevel
directly, Nix refuses to substitute it, unless `always-allow-substitutes
= true` is set as a Nix option. (In the case where the QEMU options
aren't changed at all, Nix just substitutes the runner, which sidesteps
this issue as the runner itself doesn't use toplevel as an input.)

(cherry picked from commit 747c55e702)
2025-05-17 19:40:59 +00:00
..
config beta release 2025-05-16 19:04:43 +02:00
hardware nixos/graphics: don't mark package options as internal 2025-05-10 14:36:08 -04:00
i18n/input-method treewide: remove inactive maintainer ericsagnes 2025-05-09 12:03:09 +02:00
image nixos/image/repart: Use own assertions / warnings. (#406940) 2025-05-15 19:14:53 +02:00
installer installer/tools: fix grammatical error in docs (#388452) 2025-05-10 11:31:39 +02:00
misc beta release 2025-05-16 19:04:43 +02:00
profiles nixos/profiles/nix-builder-vm: allow the system derivation to be substituted 2025-05-17 19:40:59 +00:00
programs nixos/nm-applet: fix service starting too early in some cases (#406277) 2025-05-16 16:52:22 +08:00
security acme: Add csr option 2025-05-17 09:24:49 +00:00
services nixos/sourcehut: adapt to new versions 2025-05-17 15:34:17 +00:00
system nixos/etc: remove rogue continue (#399915) 2025-05-16 15:08:17 +02:00
tasks nixos/networking: fix fqdnOrHostName when FQDN explictly set 2025-04-23 00:45:17 +10:00
testing nixos/test-driver: move sshBackdoor cfg from test-instrumentation to driver 2025-05-10 10:40:35 +02:00
virtualisation nixos/libvirtd: Use preferred version of iptables (#228625) 2025-05-10 22:23:51 +02:00
module-list.nix Add autoenv to modules list 2025-05-16 11:26:05 +02:00
rename.nix nixos/gsignond: remove 2025-04-17 10:58:21 +02:00