Commit graph

1077 commits

Author SHA1 Message Date
Martin Weinelt 8e70f11f88
networking: clarify search and domain option descriptions
There is no canonical way to set a system domain name any longer. The one
we previously used was the NIS/YP one, but that is pointless these days.

The hostname is set up through /etc/hostname, but hostname(5) states that
it should only contain 64 7-bit ASCII characters, so it cannot be used
to cover the domain name.

We still support setting the domain name to complete the `fqdn` option
and as a central option to reference the domain name from. If anyone
wants a NIS/YP domain name set, do it yourself..

We then clarify that the domain option has nothing to do with DNS
resolution anymore and search should be configured instead.

Finally explain the purpose of the ndots option in the context of search
domains, since they decide when we stop considering the search domains
when querying names with more than one dot.
2025-07-06 00:59:37 +02:00
Martin Weinelt 8a4536fdaf
networking: stop configuring NIS domain name
The `domainname` utility uses setdomainname (see getdomainname(2)) to
configure the NIS[1] (also known as YP) domain name.

It provided a central directory for various objects that are resolved via
nsswitch in the late 1990s and early 2000s.

It is however not a safe nor common deployment scenario anymore.

[1] https://en.wikipedia.org/wiki/Network_Information_Service
2025-07-06 00:59:36 +02:00
Martin Weinelt b84f8fdaa0
networking: provide hostname-debian by default
This is first and foremost to provide compat with scripts that call the
hostname executable to retrieve the hostname, an assumptions we probably
should not be breaking.
2025-07-06 00:59:36 +02:00
Martin Weinelt bf1b4d35fb
networking: don't install nettools by default
https://lwn.net/Articles/710533/ has been true in 2017 and still holds
today.
2025-07-06 00:59:36 +02:00
Will Fancher c90c29bacc nixos/bcachefs: Parse tags
Fixes #317901
2025-07-05 23:46:05 +05:30
Martin Weinelt 4dd357b322
nixos/network-interfaces-systemd: support WoL and ProxyARP
This completes support for all `network.interfaces` options.
2025-07-04 22:13:16 +02:00
Martin Weinelt 87a1396702
nixos/zfs: use hostname-debian for hostname lookups
This is the simpler, more lightweight and better maintained version of
the hostname utility.
2025-07-04 06:57:54 +02:00
Will Fancher b1fb0503ec
bcachefs-unlock: respect x-systemd mount options (#419473) 2025-06-25 06:08:32 -04:00
Charlotte 814bbef95e
bcachefs-unlock: Also handle mount paths
Co-authored-by: Will Fancher <elvishjerricco@gmail.com>
2025-06-25 09:37:33 +01:00
Charlotte 🦝 Deleńkec ca0c35d813 bcachefs-unlock: respect x-systemd mount options
This will allow unlocking to take place *after* all of the devices have
been probed, as indicated by the x-systemd.wants and x-systemd.requires
options. This allows for multi-device bcachefs volumes to be reliably
unlocked.
2025-06-25 09:01:43 +01:00
qubitnano f9bd91aa07 nixos/bcachefs: include poly1305 and chacha20 kernel modules for kernel < 6.15
Kernel 6.16-rc1 removed the poly1305 algorithm in
ceef731b0e22df80a13d67773ae9afd55a971f9e

bcachefs switched to the kernel libraries for poly1305 and chacha20 in
6.15 in 4bf4b5046de0ef7f9dc50f3a9ef8a6dcda178a6d
2025-06-24 13:34:08 +05:30
John Titor 4cd9dd4a87 nixos/bcachefs, bcachefs: add johnrtitor as maintainer
Let's give it a try once again, now that I am back on Bcachefs

Signed-off-by: John Titor <50095635+JohnRTitor@users.noreply.github.com>
2025-06-22 02:58:48 +05:30
John Titor 774eadda46 nixos/bcachefs: init module for autoScrub
Signed-off-by: John Titor <50095635+JohnRTitor@users.noreply.github.com>
2025-06-22 02:58:48 +05:30
K900 7e4f0fbf9d Merge remote-tracking branch 'origin/master' into staging-next 2025-06-06 21:50:43 +03:00
Johannes Kirschbauer 6e25d9885f
nixos/filesystems: chore replace 'with' statements 2025-06-06 11:07:10 +02:00
nixpkgs-ci[bot] c18eaf47ec
Merge master into staging-next 2025-05-22 18:05:39 +00:00
Arnout Engelen 0d14c3cc5b
nixos: autoUpgrade: allow disabling flake upgrades
When auto-upgrading based on a flake, it might be desirable to
only upgrade to the newer flake, without updating the nixpkgs
from the flake lock. This option makes that possible.
2025-05-22 09:16:56 +02:00
Robert Hensing 3dd811c4b9 lib.types.attrNamesToTrue: unpublish temporarily
Thank you for making this change.
Unfortunately, and I take blame for this, this change to the module
system was not reviewed and approved by the module system maintainers.
I'm supportive of this change, but extending it on the staging-next
branch is not the right place.
This commit is also here to make sure that we don't run into conflicts
or other git trouble with the staging workflow.

Review:
It looks alright, but it didn't have tests yet, and it should be
considered in a broader context where the existence of this type
creates an incentive to be used in cases where the `<attr> = false;`
case is undesirable. I'd like to complement this with an type that
has `<attr> = {};` only.

My apologies for the lack of a timely and clear review. Often we
recommend to define the type outside the module system until
approved. This commit puts us back in that state.

attrNamesToTrue was introduced in 98652f9a90
2025-05-16 11:52:36 +02:00
Will Fancher 98652f9a90 nixos/kernel: Allow controlling modules with attrsets 2025-05-15 00:00:56 -04:00
Shelvacu f886d71d7b nixos: Elaborate documentation for fileSystems.* options 2025-05-07 13:02:00 -07:00
Michael Hoang 6c701a9573 nixos/networking: fix fqdnOrHostName when FQDN explictly set 2025-04-23 00:45:17 +10:00
Michael Hoang 4d537721f7 nixos/networking: allow users to override FQDN
This may be useful for users where `${cfg.hostname}.${cfg.domain}` isn't
actually the fully quantified domain name of the server.
2025-04-15 18:28:40 +02:00
Shawn8901 9a1d8f09cf zfs: add option to use kernel keyring for encryption credentials 2025-04-03 22:57:06 +02: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
Arne Keller fd9f17ef49
nixos/filesystems: init bindfs (#337697) 2025-03-30 22:10:57 +02:00
h7x4 ab0564bd10
treewide: add documentation for nixos systemd units 2025-03-12 18:00:38 +01:00
Michele Guerini Rocco 64ddb39f99
network: make network setup service do not depend on udev, and fix typo with greTunnels (#373931) 2025-02-25 08:06:51 +01:00
Shawn8901 faadb5162c nixos/fileSystems: omit swap comment if there are no swapDevices 2025-02-23 23:23:32 +01:00
Sandro Jäckel 4a1cad4c46
nixos/filesystems: remove unused variable 2025-02-23 22:01:44 +01:00
Stefan Frijters 45dad721eb
nixos/zfs: make it easier to override Persistent setting of timers 2025-02-22 12:55:04 +01:00
Peder Bergebakken Sundt fc36872297
nixos/fileSystems: link to mount(8) from fileSystems.*.options (#377170) 2025-02-05 11:08:15 +01:00
Peder Bergebakken Sundt 953f72e76e nixos/*: tag manpage references 2025-01-27 02:47:01 +01:00
Peder Bergebakken Sundt 15391ccd3e nixos/fileSystems: fix mount(8) manpage links 2025-01-27 01:03:14 +01:00
Peder Bergebakken Sundt f259802ac7 nixos/fileSystems: link to mount(8) from fileSystems.*.options 2025-01-27 01:02:27 +01:00
Florian Klink 0b65cf03f0 nixos/network-interfaces-systemd: remove unused arg in genericDhcpNetworks
The first argument is not used (anymore).
2025-01-26 14:51:00 +02:00
Egor Savkin 201f27715e network: make network-setup service do not depend on udevd directly; fix typo with GRE tunnels
Otherwise, when doing nixos switch to major changes (typically when stdenv changes), udevd service gets loaded after addresses, which causes addresses service to wait indefinitely for the device and fail.

Signed-off-by: Egor Savkin <es@m-labs.hk>
2025-01-24 17:40:34 +08:00
github-actions[bot] 51d152f300
Merge master into staging-next 2025-01-13 12:06:21 +00:00
Sefa Eyeoglu f571531078
nixos/networking: fix shellcheck findings with enableStrictShellChecks enabled (#349573) 2025-01-13 09:00:59 +01:00
github-actions[bot] a58f8abed0
Merge staging-next into staging 2025-01-06 00:15:41 +00:00
Christian Kögler 945777b8ed
nixos/zfs: Set scrub default IOSchedulingClass to idle (#312193) 2025-01-05 23:57:50 +01:00
Will Fancher b7ea795937
nixos/overlayfs: add a switch to disable prefixing with /sysroot for initrd mounts (#340763) 2025-01-05 17:56:41 -05:00
Will Fancher 764082c095
nixos/fileSystems: add enable option (#301915) 2025-01-05 17:40:23 -05:00
Wolfgang Walther d63aa1ddbe
nixos/tasks: remove obsolete tty-backgrounds-combine.sh file
This should have been removed in
82e1d0c8b1.
2024-12-29 18:36:48 +01:00
MakiseKurisu dab01f875c
nixos/powertop: add hooks to fix incorrect configurations 2024-12-26 01:12:15 +08:00
Adam C. Stephens c937a5c697
nixos/zfs: fix not auto-importing pools without any fileSystems (#365058) 2024-12-14 10:22:24 -05:00
misuzu 9c54c30f11
tasks/network-interfaces: Disable network-local-commands service if unnecessary (#338622) 2024-12-14 13:17:13 +02:00
Andrew Marshall 4ed27101c6 nixos/zfs: fix not auto-importing pools without any fileSystems
`lib.all (_: false) [ ]` is `true`, which is not the semantics we want
here, and interacts poorly with `boot.zfs.extraPools` where
`getPoolFilesystems` may return `[]`. So explicitly handle this case.
This does mean there isn’t a straightforward way to disable auto-import
with `extraPools` and no associated `fileSystems` while keeping the unit
around, but that’s probably okay for now.

See https://github.com/NixOS/nixpkgs/issues/364995.
Broken in 7f8278a264.
2024-12-13 19:02:30 -05:00
Arne Keller e3f940648e
nixos/zfs: do not auto-import pools marked noauto (#352391) 2024-12-12 06:51:39 +01:00
Andrew Marshall 7f8278a264 nixos/zfs: do not auto-import pools marked noauto
This requires all datasets for the pool specified in `fileSystems` to be
marked noauto.

Note that this implicitly skips some tasks for the pool, such as
`expandOnBoot`, as the pool will not be imported at that time.
2024-12-11 22:56:13 -05: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
Tomodachi94 2e98ec0e0e nixos/networking-interfaces-scripted: use read -r
...instead of plain read, which can cause issues.

See SC2162:
https://www.shellcheck.net/wiki/SC2162
2024-12-09 08:06:29 +01:00
Will Fancher fb70f75220
nixos/filesystems: assert when label and device are set simultaneously (#362481) 2024-12-08 22:02:53 -05:00
r-vdp b6dbf6deed
nixos/filesystems: assert that the device and label options are consistent 2024-12-09 02:52:24 +03:00
Bjørn Forsman 7aad7090b7 nixos/zfs: order pool sync services before final.target
If we don't do this, I think systemd can kill the service(s) before they
finish.
2024-12-07 10:16:55 +01:00
Will Fancher 74454e41a5
nixos/filesystems: don't silently ignore label when device is set (#361418) 2024-12-03 23:59:55 -05:00
r-vdp 9226d4e9ee
nixos/filesystems: don't silently ignore label when device is set
Before this change, when both device and label were set, the label would
be silently ignored. This is especially problematic when the device is
set in another module, and it's not immediately obvious why the label is
not having any effect.

Additionally, some other modules use the device option to get the device
of a filesystem, but this option is not populated when only the label is
set, causing those modules to conclude that the filesystem does not have
a backing device.

With this change, we populate the device option using the label when the
label is set. This means that we get a clear error message when both the
device and label are set, and that the device is properly populated
whenever the label is used to specify the backing device.
2024-12-03 11:45:42 +01:00
Egor Savkin 9354d385e2 network: Fix cycle dependency causing race of netdev and address configuration
This changes the following chain after `nixos-rebuild switch` with modified tunnel interfaces:
stop network-setup -> stop TUN-netdev -> stop network-addresses-TUN -> start network-addresses-TUN (fails since it depends on TUN-netdev which is off).

Chain after this change:
stop TUN-netdev -> stop network-setup -> stop network-addresses-TUN -> start TUN-netdev -> start network-addresses-TUN -> start network-setup

Signed-off-by: Egor Savkin <es@m-labs.hk>
2024-12-02 10:54:47 +08:00
Sandro b5ad44e06e
nixos/lvm: expand enable description to better inform users about the… (#355463) 2024-11-27 22:37:48 +01:00
Will Fancher 9100366975
nixos/network-interfaces-systemd: improve default ethernet network matching (#347283) 2024-11-18 21:18:19 -08:00
liberodark b9956ceb87 nixos/auto-upgrade: Format 2024-11-15 08:36:15 +01:00
Sandro a9f3a296d3
nixos/lvm: expand enable description to better inform users about their actions 2024-11-12 16:54:14 +01:00
Moritz Sanft cba277a1dc
nixos/overlayfs: format 2024-11-05 17:02:24 +01:00
Moritz Sanft 96a7448a4e
nixos/overlayfs: add a switch to disable prefixing with /sysroot for initrd mounts 2024-11-05 16:54:01 +01:00
Andrew Marshall 9ce881027b zfs: remove recommendations to use unstable
`pkgs.zfs_unstable` is pre-release software and may very well have
critical bugs that make it unsuitable for general use. As such, we
should not recommend it as a general solution to the problem of "my
Kernel is too new for stable ZFS".
2024-11-01 18:50:24 -04:00
Andrew Marshall a0de415588 nixos/zfs: improve docs for boot.zfs.devNodes option
Specify more clearly how this is used, and defer to upstream docs for
guidance on selecting it.
2024-10-31 09:04:11 -04:00
Andrew Marshall 0f69b960b8 nixos/zfs: teach to override devNodes per pool
This may be useful if some pools use LUKS or some other intermediate
layer, while others do not.
2024-10-30 10:41:18 -04:00
Sandro Jäckel 91cf1d31c8 nixos/zfs: fix shellcheck findings with enableStrictShellChecks enabled 2024-10-30 08:33:57 +00:00
Sefa Eyeoglu 8e6cc2f3f6
nixos/networking: fix shellcheck findings with enableStrictShellChecks enabled
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2024-10-18 18:23:05 +02:00
Masum Reza cb9ac608fc
nixos/{bcache,lvm}: enable when using systemd in stage 1 initrd (#343760) 2024-10-10 12:16:31 +05:30
Lương Việt Hoàng 24597e9460 nixos/network-interfaces-systemd: improve default ethernet network matching
Reliably match physical ethernet interfaces by using `Kind=!*` with `Type=ether`.
This will exclude veth interfaces, which have `Kind=veth`.
2024-10-08 20:23:48 +07:00
Bjørn Forsman 20a3012813 nixos/networking: improve vlan service description
VLAN is an abbreviation, so let's not write Vlan.
2024-10-04 22:09:01 +02:00
Bjørn Forsman e8da2c8981 nixos/networking: fix macvlan service description
Fix copy pasta from the vlan service: Vlan -> MACVLAN
2024-10-04 22:08:40 +02:00
Franz Pletz cc2142b9f0
nixos/zfs: remove incorrect conditional use of spl kmod; remove withs (#344271) 2024-09-28 15:30:13 +02:00
Andrew Marshall bec753ddfc nixos/zfs: replace with with let
The fully-qualified name would certainly be a lot here, but `with` can
still be unclear even with narrow scope. A short `let` adds clarity
without significantly increasing verbosity.
2024-09-27 08:08:31 -04:00
Andrew Marshall eef4c18ae8 nixos/zfs: remove unused vars 2024-09-27 08:08:31 -04:00
Andrew Marshall 33bd85a6c8 nixos/zfs: remove top-level withs
As it is generally considered an anti-pattern. Removing them here in
fact exposed one bug (see previous commit).
2024-09-27 08:08:30 -04:00
Andrew Marshall 06ed2c46fb nixos/zfs: remove incorrect conditional use of spl kmod
This was incorrectly getting `lib.version` which is e.g.
`"24.11pre-git"`, but should have been the ZFS package version. However,
the condition, at least per the comment, is reversed and should be
instead `versionOlder cfgZfs.package.version "2.2.0"`. However, the
entire premise seems to be incorrect, as ZFS 2.2.6 includes the spl
module. Since the previous condition here was effectively always true,
it would initially seem the best move is to remove the conditional
altogether and always include the spl kmod. However, going back to
4360a87c45 where this condition was added,
the intent appears to be that spl was no longer needed here in
the-pre-release ZFS (long since in all supported versions), due to it
being merged into ZFS mainline. Given that intent and that our boot
tests on all versions succeed without including it in the initrd, remove
it.
2024-09-27 08:08:30 -04:00
Artturin ecd4ea0ab2
nixos/auto-upgrade: correct typo in assertion message (#295125) 2024-09-25 20:41:02 +03:00
Patrick Collins 448240f6e2
nixos/nfsd: fix typo that breaks services.nfs.settings (#342200)
Currently will always fail when nfs.server.hostName is specified alongside nfs.settings.
2024-09-25 20:33:23 +03: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
John Titor 468a6cbbbe
nixos/bcache: enable bcache when using systemd in stage 1 initrd 2024-09-22 23:37:51 +05:30
John Titor 3f90386b24
nixos/lvm: enable lvm when using systemd in stage 1 initrd
Fixes https://github.com/NixOS/nixpkgs/issues/343566
2024-09-22 22:04:30 +05:30
Felix Buehler dd7ab59690 nixos/services.nfs: remove with lib; 2024-09-15 10:43:58 +02:00
github-actions[bot] b6b2ac4f61
Merge master into staging-next 2024-09-07 00:12:59 +00:00
Aaron Ecay 345618de26
nixos/zfs: mitigate data loss issues when resuming from hibernation 2024-09-06 13:39:21 -04:00
tu-maurice a7ef1254e6 tasks/network-interfaces: Disable network-local-commands service if unnecessary
If the localCommands variable is empty this service does nothing, but
runs anyway. We can disable it in these cases.
2024-08-31 15:22:14 +02:00
github-actions[bot] fab50d5f8d
Merge staging-next into staging 2024-08-31 00:13:46 +00:00
Philip Taron 9916dc8728
treewide/nixos: remove with lib; part 2 (#335618) 2024-08-30 15:56:57 -07:00
Felix Buehler cd197cebdf nixos/system.autoUpgrade: remove with lib; 2024-08-30 23:01:45 +02:00
Will Fancher c653608dcd overlayfs: Assert that upperdir == null requires systemd initrd 2024-08-30 15:18:36 -04:00
Will Fancher 160ff9ff9c overlayfs: Use depends 2024-08-30 15:18:36 -04:00
Will Fancher b7c5fd93f1 nixos: Support fileSystems.<name>.depends with fstab-generator 2024-08-30 15:18:35 -04:00
Luflosi 8032f77462
nixos/filesystems: init bindfs 2024-08-27 13:43:46 +02:00
github-actions[bot] 3b85a864c3
Merge staging-next into staging 2024-08-26 18:04:37 +00:00
Jörg Thalheim f40cd1bfe0 nixos/autoUpgrade: add --refresh when using flakes
otherwise the cache might delay updates quite a bit
2024-08-26 12:02:38 +02:00
ajs124 bd0539cb20 nixos/tasks/lvm: assert kernel version for vdo 2024-08-23 19:59:34 +02:00
ajs124 9366ef0fbd vdo: 8.2.2.2 -> 8.3.0.71 2024-08-23 19:59:33 +02:00
ajs124 ee6a0e376d kvdo: drop 2024-08-23 19:59:31 +02:00
7c6f434c da64ac6beb
Merge pull request #310807 from Naxdy/work/improve-btrfs-autoscrub
nixos/btrfs: refactor & improve device selection for autoScrub
2024-08-03 15:31:32 +00:00
misuzu 4df3c4c17b nixos/clevis: add support for parent encrypted zfs datasets 2024-06-12 21:21:50 +03:00