Commit graph

352 commits

Author SHA1 Message Date
Peder Bergebakken Sundt
c77ac9dfc3 treewide: fix typos 2025-06-02 16:07:07 +02:00
Winter
747c55e702 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.)
2025-05-16 13:00:15 -04:00
Rebecca Turner
2263f723c1
darwin.linux-builder: split create-builder script
The current workflow for starting the `linux-builder` on macOS is to run
`nix run nixpkgs#darwin.linux-builder`, which adds keys to the store and
then starts the builder.

Adding the keys requires user input (due to `sudo`) but the actual
builder should just stay running in the background somewhere.

I'd like to automate this process, but it's currently rather complex:
the first part of the script needs user input for `sudo`, and then
there's no signal when the process has finished starting up. The user
will need to see stdout/stderr during the first part, which makes it
challenging to capture it for the second part to determine when startup
has finished.

To fix this, I've split the `create-builder` script into an `add-keys`
script (interactive) and a `run-builder` script (background). These new
scripts are exposed in the `passthru` attributes for external users. The
`create-builder` script is now a simple call of `add-keys` and then
`run-builder`.

See: https://nixos.org/manual/nixpkgs/unstable/#sec-darwin-builder
2025-05-12 12:18:33 -07:00
Silvan Mosberger
374e6bcc40 treewide: Format all Nix files
Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:

  nix-build ci -A fmt.check

This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).

This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).

Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](8616af08d9/maintainers/scripts/auto-rebase).

If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
2025-04-01 20:10:43 +02:00
nixpkgs-ci[bot]
2341cd6a3a
Merge master into staging-next 2025-03-18 06:05:15 +00:00
Will Fancher
317736b155
nixos/iso-image: Consolidate ISOs Using Specialisations. (#355893) 2025-03-17 21:22:38 -04:00
nixpkgs-ci[bot]
f2e2b1814d
Merge master into staging-next 2025-03-17 18:05:11 +00:00
nikstur
7872cf6917
nixos/perlless: only disable installer tools that introduce perl (#388564) 2025-03-17 14:01:20 +01:00
Will Fancher
0aad0248ce nixos/iso-image: Include latest kernel specialisation.
Now that ISOs include the latest kernel as a specialisation, separate
ISOs for the new kernel are no longer necessary.
2025-03-16 01:38:37 -04:00
Will Fancher
da9a092c34 nixos/iso-image.nix: nixfmt 2025-03-16 00:23:46 -04:00
K900
7d36ee97e6 Merge remote-tracking branch 'origin/master' into staging-next 2025-03-14 09:56:27 +03:00
Michael Hoang
c0e0720c74 nix-builder-vm: disable auto-optimise-store
This option is associated with corruption[1, 2] and is disabled by
default in Nix as it can cause significant slowdowns[3].

[1]: https://github.com/NixOS/nix/issues/7273
[2]: https://github.com/LnL7/nix-darwin/pull/1152
[3]: https://github.com/NixOS/nix/issues/462#issuecomment-378189808
2025-03-13 16:02:29 +09:00
Philip Taron
711bf412a3
make-initrd: use closureInfo again (#372931) 2025-03-09 18:48:12 -07:00
isabel
adcdeadefd
nixos/perlless: only disable installer tools that introduce perl 2025-03-09 23:24:20 +00:00
Dominik Xaver Hörl
9270d7cbb6 nixos/installation-device: add jq.all to extraDependencies
As discovered in https://github.com/NixOS/nixpkgs/pull/372931, we need the dev output of jq for closureInfo. We opt to add the whole thing.
2025-03-09 14:20:48 +01:00
K900
b964d0d668
Revert "nixos/profiles/hardened: don't enable by default" 2025-02-19 19:53:15 +03:00
Marie Ramlow
c47719a799 nixos/profiles/hardened: don't enable by default 2025-02-19 17:26:05 +01:00
Nico Felbinger
958d1fb821
nixos/profiles/hardened: replace 'with' using inherit and add disable option 2025-02-03 21:34:05 +01:00
nikstur
e00357e1f3
nixos/perlless: disable NixOS documentation (#364544) 2025-02-01 17:47:03 +01:00
Davis Schirmer
26e66c536c
Remove with lib from minimal profile; group config 2024-12-14 15:13:26 -05:00
Moritz Sanft
91103e7d7c
nixos/perlless: disable NixOS documentation
NixOS documentation seems to come at the cost of another Perl dependency, and is currently not disabled-by-default in the `perlless` profile.

Consider this dependency path before the change:

```
$ nix why-depends .#some-image /nix/store/3vq9qasxlqpyq1k95nq3s13g2m6w59ay-perl-5.40.0
/nix/store/gn02dmslv3vihbwgfajws1g3ic9fj1m0-microvm-image-1-rc1
└───/nix/store/pmwncx8ja7h65zr0z9kvjncdxkymvd82-system-path
    └───/nix/store/mahxsvm46200qb879bxpdvpmamzss21c-nixos-help
        └───/nix/store/0ni8bklq7ykmbnidys169z1s9cagkm66-nixos-help
            └───/nix/store/ybl3snmpzjhna4vh8rs4zfrrky0q7xd4-w3m-0.5.3+git20230121
                └───/nix/store/3vq9qasxlqpyq1k95nq3s13g2m6w59ay-perl-5.40.0
```

After the change:

```
$ nix why-depends .#some-image /nix/store/3vq9qasxlqpyq1k95nq3s13g2m6w59ay-perl-5.40.0
'git+file:///some/path#some-image' does not depend on '/nix/store/3vq9qasxlqpyq1k95nq3s13g2m6w59ay-perl-5.40.0'
```
2024-12-12 11:35:38 +01:00
DavHau
08783a39b0 nixos: add option hardware.enableAllHardware
This allows users to simply enable support for all hardware by enabling the option `hardware.enableAllHardware`, instead of having to import `modules/profiles/all-hardware.nix`.

This is better, as the enableAllHardware option will be discoverable via search.nixos.org, while the `all-hardware.nix` is hidden inside nixpkgs and hard to discover.

Backward compatibility is provided by replacing the old `profiles/all-hardware.nix` with a file that sets the `enableAllHardware` option to true.
2024-12-12 16:45:25 +07:00
DavHau
45628b1432 all-hardware: move to hardware/all-hardware.nix 2024-12-12 12:26:36 +07:00
DavHau
b8d04f5831 all-hardare: remove obsolete import of zydas-zd1211.nix
This is already included via the above`hardware.enableRedistributableFirmware = true`
2024-12-12 12:26:36 +07: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
misuzu
07a96b2499
nixos/installation-device: make openssh settings a default (#339786) 2024-12-01 16:32:13 +02:00
Emily
ff5fea0a29 nixos/{demo,installer/virtualbox-demo}: drop
This is no longer referenced anywhere and so will inevitably bitrot,
and doesn’t do anything that isn’t simple to achieve with the
module documentation.
2024-11-07 23:41:51 +00:00
XYenon
9ea79affa9 nixos/profiles/minimal: remove programs.ssh.setXAuthLocation
Fix https://github.com/NixOS/nixpkgs/pull/341734#issuecomment-2416239664
2024-11-05 14:38:57 +08:00
Robert Hensing
a034fb50f7 Format 2024-10-08 11:27:01 +02:00
Robert Hensing
00355648f0 nixos/modules/profiles/macos-builder.nix: Restore as alias 2024-10-08 10:27:11 +02:00
Robert Hensing
4687820524 Document nixos/modules/profiles/nix-builder-vm.nix 2024-10-08 10:27:11 +02:00
Robert Hensing
1d76033154 Rename nixos/modules/profiles/{macos-builder.nix -> nix-builder-vm.nix} 2024-10-08 10:27:11 +02:00
Robert Hensing
2d11924c9a
macos-builder: readd Nix CLI for debugging (#347205) 2024-10-08 09:58:17 +02:00
Michael Hoang
10bad16926 macos-builder: readd Nix CLI for debugging
See https://github.com/NixOS/nixpkgs/pull/268574#discussion_r1788966194
2024-10-08 12:41:55 +11:00
nicoo
6f26c88376
nixos/macos-builder: pin stateVersion (#342380)
Closes #325610, #325674
2024-10-04 16:09:56 +02:00
Artturin
e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00
Geoffrey Thomas
82978a85c6 Revert "nixos/profiles/base: install vim w/nix-syntax plugin"
Adding custom plugins causes the `vim` command to be a wrapper script
running `vim -u ...`, which makes it not load the default ~/.vimrc.
(This is analogous to #177375 about neovim.)

As of Vim 9, the syntax-highlighting portion of the nix plugin is
upstream; the full plugin is only needed for indentation etc. (see also
e261eb152b). So, using regular pkgs.vim
works around this behavior/bug and causes any ~/.vimrc to get loaded,
without regressing the syntax highlighting support that motivated the
change being reverted here.

This reverts commit 0b5a0cbc69.
2024-09-22 15:16:39 -04:00
Sandro
d7a90aab71
nixos/profiles/minimal: set fonts.enableDefaultPackages which was previously set by environment.noXLibs 2024-09-22 20:21:16 +02:00
Sandro
da1b2b5adb
nixos/profiles/minimal: drop noXLibs
noXLibs is an advanced option for advanced users which know how to recognize and debug build failures which might be caused by the added overlays.

The minimal profile should be minimal but also save to use for many people and not cause build failures in packages it really shouldn't.
2024-09-14 00:59:14 +02:00
Martin Weinelt
4cec81a995
Revert "modules/virtualisation: add shared options, merge various diskSize options" (#340894)
Breaks evaluation of all nixos tests, and is therefore a channel blocker.
2024-09-10 03:12:55 +02:00
Jonas Chevalier
7c4dde339a
modules/virtualisation: add shared options, merge various diskSize options (#339535) 2024-09-09 21:23:11 +02:00
Emily
866a8e220c nixos/perlless: remove redundant system.switch.enableNg
This is now on by default.
2024-09-06 08:35:43 +01:00
Emily
7b9bb0a9a1 nixos/installer: drop support for ReiserFS and JFS
ReiserFS has not been actively maintained for many years. It has been
marked as obsolete since Linux 6.6, and is scheduled for removal
in 2025. A warning is logged informing users of this every time a
ReiserFS file system is mounted. It suffers from unfixable issues
like the year 2038 problem.

JFS is a slightly more ambiguous case. It also has not been actively
maintained for years; even in 2008 questions were being raised
about its maintenance state  and IBM’s commitment to it, and some
enterprise distributions were opting not to ship support for it as
a result. It will [indefinitely postpone journal writes], leading
to data loss over potentially arbitrary amounts of time. Kernel
developers [considered marking it as deprecated] last year, but
no concrete decision was made. There have been [occasional fixes]
to the code since then, but even the developer of much of those was
not opposed to deprecating it.

[considered marking it as deprecated]: https://lore.kernel.org/lkml/Y8DvK281ii6yPRcW@infradead.org/
[indefinitely postpone journal writes]: https://www.usenix.org/legacy/events/usenix05/tech/general/full_papers/prabhakaran/prabhakaran.pdf
[occasional fixes]: https://www.phoronix.com/news/JFS-Linux-6.7-Improvements

Regardless of whether JFS should be removed from the kernel, with all
the implications for existing installations that entails, I think
it’s safe to say that no new Linux installation should be using
either of these file systems, and that it’s a waste of space and
potential footgun to be shipping support for them on our standard
installation media. We’re lagging behind other distributions on
this decision; neither is supported by Fedora’s installation media.

(It also just so happens that `jfsutils` is the one remaining package
in the minimal installer ISO that has reproducibility issues, due to
some cursed toolchain bug, but I’m not trying to Goodhart’s law
this or anything. I just think we shouldn’t be shipping it anyway.)
2024-09-05 16:00:35 +01:00
phaer
94634e82f8 macos-builder: use virtualisation.diskSize...
...and drop virtualisation.darwin-builder.diskSize.

This makes negative diskSizes illegal.
2024-09-05 15:56:24 +02:00
phaer
04fadac429 run nixfmt-rfc-style 2024-09-05 15:56:22 +02:00
Felix Stupp
c945e4db53
nixos/installation-device: make openssh settings a default
- as the comment above already indicates
- neither OpenSSH nor PermitRootLogin are really required for a working
  installation device, hence making it easier to change
2024-09-05 11:51:27 +00:00
K900
644cf688b3 nixos/graphical: don't enable Pulseaudio 2024-09-04 13:56:42 +03:00
K900
878922a902 nixos/installation-device: use a bigger hammer
Untrimmed mbrola-voices is leaking into the installer images again.
Instead of trying to manually squash every path it could possibly
leak through, use a very big hammer.
2024-09-03 10:53:25 +03:00
WilliButz
c169763c30
userborn: init at 0.1.0 (#332719) 2024-08-30 12:22:54 +02:00
Sandro Jäckel
d50e23f0a4
glxinfo: replace with mesa-demos 2024-08-28 14:38:12 +02:00