Commit graph

301 commits

Author SHA1 Message Date
Janne Heß eb831f759b
nixos/stc: Improve mount unit handling
We should sometimes restart the units rather than reloading them so the
changes are actually applied. / and /nix are explicitly excluded because
there was some very old issue where these were unmounted. I don't think
this will affect many people since most people use fstab mounts instead
but I plan to adapt this behavior for fstab mounts as well in the future
(once I wrote a test for the fstab thingies).
2023-08-21 09:07:14 +02:00
Janne Heß bc9b484db8
Merge pull request #232230 from oddlama/fix-activation-template-unit-specializations
Fix detection of changed template unit specializations in switch-to-configuration.pl
2023-08-16 13:46:45 +02:00
Janne Heß d995da11d8
nixos/switch-to-configuration: Fix unit location in toplevel 2023-08-13 14:26:30 +02:00
Vincent Haupert fbebce610f nixos/toplevel: move systemBuilder for boot.kernel.enable
This avoids creating a build-time reference on `boot.kernelParams` if
the configuration does not use a kernel, i.e., `boot.kernel.enable` is
set to `false`.
2023-08-04 12:46:03 +02:00
oddlama d073105d6b
nixos/switch-to-configuration: fix ignoring of template unit specialization dropins 2023-07-23 13:16:58 +02:00
Robert Hensing 3fd4ac8e82
Merge pull request #237040 from roberth/flexible-activation
nixos/system: Support pre-activated images
2023-07-08 16:06:25 +02:00
Robert Hensing 772d6076e8 nixos: Add system.activatable flag for images that are pre-activated 2023-06-28 14:06:28 +02:00
Robert Hensing 9edad17d29 nixos/top-level: Remove unused builder variables
These variables were previously used by the activation script
build commands, but are now embedded into those commands for
to improve reusability for an upcoming addition.
2023-06-28 12:49:34 +02:00
Robert Hensing 7891c8cdaf nixos/activatable-system: Move legacy variables to top-level 2023-06-28 12:48:59 +02:00
Robert Hensing 990b72f6af nixos/activatable-system: Make system builder commands env independent
This way it will be easier to reuse in a different context, such as
a separate build of the activation script by itself (TBD).
2023-06-28 12:42:51 +02:00
Naïm Favier 0179d9f7e6
nixos/top-level: change extraDependencies from package to pathInStore
Allows adding subdirectory flake inputs that aren't top-level store paths.
2023-06-27 11:48:08 +02:00
Wout Mertens a97fe8990d
switch-to-configuration.pl: fix inverted dry-activate logic for swap 2023-06-14 12:11:45 +02:00
Robert Hensing 193f4fea90 nixos/activatable-system: Make substitutions explicit
This helps with understanding the code.
We might make this not depend on environment variables later.
systemBuilderArgs is a form of global state, which isn't helpful.
2023-06-10 19:15:00 +02:00
Robert Hensing a16986f1a3 nixos: Move installBootLoader to activation script modules 2023-06-10 19:15:00 +02:00
Robert Hensing 61d43dee5f nixos: Extract module for activation script inclusion into toplevel
Allows omission of this functionality through disabledModules, e.g.
for image building.
2023-06-10 19:15:00 +02:00
Victor Engmark 8deaa732a8 refactor: Split mkdir -m … into mkdir + chmod
As recommended by ShellCheck
<https://www.shellcheck.net/wiki/SC2174>.
2023-06-08 15:55:40 +12:00
Bjørn Forsman ef85c3fe51 nixos: use passAsFile to avoid "Argument list too long" error
This patch fixes "Argument list too long" build failure when passing a
list of store paths to system.extraDependencies that exceeds Linux'
MAX_ARG_STRLEN limit of 128 KiB. With the shortest possible derivation
names (one byte), the 128 KiB limit is equivalent to about 2850
derivations. With longer derivations names, the limit is hit earlier.
Fix this restriction.
2023-05-19 22:31:31 +02:00
Robert Hensing 5bdf63819b nixos/top-level.nix: Add system.checks
Note that this does not add to the `forbiddenDependenciesRegex`
code because that code check should be unaffected as it only checks
output dependencies, not build dependencies.
Build deps are added after that check, if those are enabled in the
first place.
2023-05-11 21:18:38 +02:00
Jared Baur 67561dcc59
nixos/bootspec: Fix cross for nixos-system systemBuilder
When `nixpkgs.hostPlatform` != `nixpkgs.buildPlatform`, building the
top-level attribute fails since the bootspec portion of the system
builder tries to reference the host platform's `jq`. Change this to
reference the build platform's `jq`.
2023-05-04 20:09:16 -07:00
Raito Bezarius bc502d0a14 nixos/bootspec: adopt the merged RFC-0125
This removes the feature preview warning, enable by default bootspec,
adds a validation flag to prevent Go to go into build-time closure.

This will break all downstream users of bootspec as those changes are
not backward-compatible.
2023-04-28 18:26:11 -07:00
K900 48b2f723f5 nixos/system: disallow system.copySystemConfiguration in pure eval mode
This is already broken, so let's give it a better error message.
2023-03-29 17:49:30 +03:00
Linus Heckemann eb45cd5108 nixos/top-level: add includeBuildDependencies option
This option allows adding the build closure of the system to its
runtime closure, enabling fully-offline rebuilds (as long as no new
packages are added).
2023-03-14 11:55:13 +01:00
Victor Fuentes d3528cdc3d
nixos/version: add config.system.nixos.distroName and config.system.nixos.distroId 2023-01-14 16:19:06 -05:00
Ryan Lahfa e2e8dfcf44
Merge pull request #207163 from NixOS/rfc0125-improvements
nixos/activation/bootspec: make initrd optional, serialize system, precise extensions' type
2022-12-23 00:43:29 +01:00
Cole Helbling 21f4afd799 nixos/activation/bootspec: fix document output path
The RFC currently stipulates the document will be available at
`$out/boot.json`.
2022-12-22 07:56:09 -08:00
Raito Bezarius 5dd2e60371 nixos/activation/bootspec: make initrd optional, serialize system, precise extensions' type 2022-12-21 23:28:21 +01:00
Jörg Thalheim 668a2b2f33
Merge pull request #172237 from DeterminateSystems/bootspec-rfc
Support external bootloader backends (RFC-0125)
2022-12-17 08:35:53 +00:00
Cole Helbling 5af481f67f nixos/activation/bootspec: fixup improper $out substitution 2022-12-08 13:50:05 -08:00
Cole Helbling dce9add02b nixos/activation/bootspec: refactor the generator script
We separate the different steps (injecting the toplevel and injecting
the specialisations) so that it's easy to document what each snippet is
actually doing.
2022-12-08 13:50:05 -08:00
Cole Helbling 38e5089814 nixos/activation/bootspec: drop problematic comment, only generate bootspec when bootspec is enabled 2022-12-08 13:50:05 -08:00
Cole Helbling 97f657c742 nixos/activation/bootspec: DocBook -> Markdown, add description for extensions field 2022-12-08 13:50:05 -08:00
Raito Bezarius 680369e504 nixos/activation/bootspec: add some comments to explain the delicate manipulations 2022-12-08 13:50:05 -08:00
Raito Bezarius 11dfbee0a4 nixos/activation/bootspec: add bootspec chapter in NixOS manual 2022-12-08 13:50:05 -08:00
Raito Bezarius 9832e3e9b9 nixos/activation/bootspec: remove SB extension example in Cue schema 2022-12-08 13:50:04 -08:00
Raito Bezarius 348ba1b33c nixos/activation/bootspec: module-ify
This does the following:

* turns bootspec into a NixOS module
* validates bootspecs with Cue
* exposes internal knobs
2022-12-08 13:50:04 -08:00
Raito Bezarius ee27291b34 nixos/activation/bootspec: fix slurping specialisation bootspecs 2022-12-08 13:50:04 -08:00
K900 e69c37eae9 nixos/activation: don't generate bootspec for containers 2022-12-08 13:50:04 -08:00
Graham Christensen e9c85d6d0f nixos/activation/bootspec: embed the document into a bootspec subdir 2022-12-08 13:50:04 -08:00
Graham Christensen 6c0e4e892f nixos/activation/bootspec: embed the entire contents of specialisation's bootspecs into the parent
See: https://github.com/NixOS/rfcs/pull/125#discussion_r871222614
2022-12-08 13:50:04 -08:00
Cole Helbling 942dcd238b nixos/activation/bootspec: init bootspec support (RFC-0125) 2022-12-08 13:50:03 -08:00
Artturin a34d7b67fd nixos/top-level.nix: add forbiddenDependenciesRegex option
useful for making sure that there's no dev outputs in the system
2022-12-02 21:15:24 +02:00
Sandro 9477fa1e44
Merge pull request #197917 from SuperSandro2000/kernel-enable 2022-11-12 21:12:56 +01:00
Sandro Jäckel 182575a60d
nixos/kernel: replace boot.isContainer with boot.kernel.enable 2022-11-09 23:45:33 +01:00
Robert Hensing 9299483604 nixos/top-level.nix: Move configurationName to grub.nix
The configuration-name file is grub specific, so it should not be
in top-level.nix.
2022-11-05 00:25:46 +01:00
Robert Hensing 37fa46a224 nixos/top-level.nix: Remove workaround for #156533 2022-11-05 00:25:46 +01:00
Robert Hensing 0b05ed2c78 nixos/specialisation.nix: Extract module 2022-11-05 00:25:46 +01:00
Robert Hensing d3ac0938a7 nixos/top-level.nix: Make extensible
(cherry picked from commit 4ec415cff9bcbaef08e0d900406a5c7181e71881)
2022-11-05 00:05:26 +01:00
pennae 1d41cff3dc nixos/*: convert straggler options to MD 2022-08-31 17:27:38 +02:00
pennae f2ea09ecbe nixos/*: convert options with listings
minor rendering changes.
2022-08-31 17:27:36 +02:00
pennae bd56368848 nixos/*: md-convert hidden plaintext options
most of these are hidden because they're either part of a submodule that
doesn't have its type rendered (eg because the submodule type is used in
an either type) or because they are explicitly hidden. some of them are
merely hidden from nix-doc-munge by how their option is put together.
2022-08-31 16:32:54 +02:00