Commit Graph

11 Commits

Author SHA1 Message Date
Ramses
fb5f54e05e nixos: replace container activation scripts (#499313) 2026-04-09 15:06:25 +00:00
r-vdp
6ab12a513a nixos: convert remaining postBootCommands that load the nix DB to systemd services
Convert all remaining boot.postBootCommands that call
nix-store --load-db into register-nix-paths systemd services for
consistency with qemu-vm.nix and to make the ordering dependency
with nix-channel-init explicit.

All services use the same unit name (register-nix-paths) and the
same sysinit.target ordering, so nix-channel-init's
after=register-nix-paths.service dependency works uniformly across
all platforms.

Platform-specific logic (netboot password setup, sd-image partition
expansion) is kept in the service script or in boot.postBootCommands
as appropriate.
2026-03-23 10:01:50 +01:00
r-vdp
0f363a1cb4 nixos: replace container activation scripts
docker: move /init symlink creation from activationScript to installBootLoader,
which is the mechanism switch-to-configuration already uses for this purpose.

lxc: remove redundant activation script.
The installBootLoader hook was already handling /sbin/init.

incus: replace activationScript with a oneshot systemd service that uses
ConditionPathExists to create /etc/nixos/configuration.nix only on first
boot.

See: https://github.com/NixOS/nixpkgs/issues/475305
2026-03-12 23:58:05 +01:00
Silvan Mosberger
4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00
Sigmanificient
6dd44107ac treewide: remove unused lib (and other) arguments 2024-07-26 11:18:09 +02:00
figsoda
ca6c2c2111 nixos/docker-image: clean up let-in binding 2022-11-30 17:27:23 -05:00
Thomas Tuegel
757c7f3773 docker-container: Remove /etc symlink
The system output usually contains a symlink from /etc to the static
configuration for the benefit of the stage-1 script in the initrd. The stage-2
script is usually started in the real root without such a symlink. In a
container, there is no stage-1 and the system output is used directly as a real
root. If the symlink is present, setup-etc.pl will create a symlink cycle and
the system cannot boot. There is no reason for the /etc link to exist in a
container because setup-etc.pl will create the necessary files. The container
module will now remove the /etc symlink and create an empty directory. The empty
/etc is for container managers to populate it with site-specific settings; for
example, to set the hostname. This is required to boot NixOS in an LXC container
on another host.

See also: #9735
2019-11-27 15:51:19 -06:00
Ding Xiang Fei
4259f7575e use closure-info for building system tarball 2018-11-07 12:52:53 +08:00
Michael Bishop
3c9e579d1e make-system-tarball: allow alternate compression methods 2018-04-03 11:30:43 -03:00
Tuomas Tynkkynen
60f5659dad treewide: Use correct output in ${config.nix.package}/bin 2016-04-25 16:44:37 +02:00
Eelco Dolstra
1cb5583c05 container.nix -> docker-container.nix 2015-04-19 22:06:45 +02:00