Commit Graph

923 Commits

Author SHA1 Message Date
misuzu
4df3c4c17b nixos/clevis: add support for parent encrypted zfs datasets 2024-06-12 21:21:50 +03:00
Michele Guerini Rocco
9e97770a19
Merge pull request #312317 from tom-kuca/replace-existing-network-addresses
nixos/network-interfaces: prevent failure when a network address already exists
2024-06-03 15:30:13 +02:00
Maximilian Bosch
3cf4304692
Revert "nixos/networking: use mkIfs on the inner attributes" 2024-05-31 13:05:19 +02:00
Linus Heckemann
cf50bd0aa1 nixos/networking: use mkIfs on the inner attributes
This is a bit more compact and yields the same evaluation results.
2024-05-23 17:46:15 +02:00
Maximilian Bosch
f9f943b36e
nixos/networking: use optionalAttrs -> mkIf for networkd route generation
Suggested in https://github.com/NixOS/nixpkgs/pull/312472#discussion_r1605894882
2024-05-20 17:30:21 +02:00
Maximilian Bosch
c4fd7cf16d
nixos/networkd: get rid of *Config attributes in lists
This patch is about removing `wireguardPeerConfig`,
`dhcpServerStaticLeaseConfig` - a.k.a. the
AbstractSingletonProxyFactoryBean of nixpkgs - and friends.

As a former colleague said

> worst abstraction ever

I second that. I've written enough networkd config for NixOS systems so
far to have a strong dislike. In fact, these don't even make sense:
`netdevs.wireguardPeers._.wireguardPeerConfig` will be rendered into
the key `[WireGuardPeer]` and every key from `wireguardPeerConfig` is in
there. Since it's INI, there's no place where sections on the same level
as wireguardPeerConfig fit into. Hence, get rid of it all.

For the transition, using the old way is still allowed, but gives a
warning. I think we could drop this after one release.

The tests of rosenpass and systemd-networkd-dhcpserver-static-leases
were broken on the rev before, hence they were updated, but are still
not building.
2024-05-20 17:26:42 +02:00
Tomáš Kuča
71ce6b582b
nixos/network-interfaces: prevent failure when a network address already exists
The original code tests output of `ip addr add` command to detect if an
adress already exists. The error message was changed in the past and the
test no longer works.

The patch replaces `ip addr add` with `ip addr replace`. The new command
replaces an existing address or creates a new one if there isn't any.

fixes 306841
2024-05-17 01:02:29 +02:00
Franz Pletz
338a208e7d
Merge pull request #287505 from jpds/zfs-scrub-trim-randomizedDelaySec 2024-05-10 02:11:13 +02:00
Jonathan Davies
8e0e9bdee8 nixos/zfs: Added a randomizedDelaySec option to ZFS autoscrub/trim timers
Allows operators to space out these IO operations across a fleet of
machines, rather than have them all happen at the same time.
2024-05-03 15:01:53 +01:00
Jonathan Davies
5b671b7fc8 nixos/zfs: Default autoscrub interval to monthly 2024-05-03 13:41:51 +01:00
stuebinm
6afb255d97 nixos: remove all uses of lib.mdDoc
these changes were generated with nixq 0.0.2, by running

  nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix

two mentions of the mdDoc function remain in nixos/, both of which
are inside of comments.

Since lib.mdDoc is already defined as just id, this commit is a no-op as
far as Nix (and the built manual) is concerned.
2024-04-13 10:07:35 -07:00
Luís Fonseca
38b68216a5
nixos/zfs: install zfs udev rules on stage1
Install zfs udev rules on initrd, so that /dev/zvol gets populated.
2024-04-08 02:53:01 +01:00
Matt Moriarity
10035ed5ab nixos/bcachefs: support unlock with clevis in systemd stage 1 2024-04-05 14:39:11 +00:00
Aaron Andersen
c4719710f0
Merge pull request #298068 from posch/manage-gids
nixos/nfsd: settings for /etc/nfs.conf
2024-04-01 16:15:10 +00:00
Tobias Poschwatta
ee2b899ff7 nixos/nfsd: settings for /etc/nfs.conf
services.nfs.settings is added for options that go into /etc/nfs.conf.

There are services.nfs.server.extraNfsdConfig and
services.nfs.extraConfig, but they have drawbacks.  They overlap in
scope (nfs.extraConfig can also add nfsd options). They require that one
writes INI syntax. They often produce nfs.conf files with duplicate
section names, which is confusing.

This deprecates services.nfs.server.extraNfsdConfig and
services.nfs.extraConfig.

services.nfs.settings cannot be used together with
services.nfs.server.extraNfsdConfig or services.nfs.extraConfig.
2024-03-25 12:22:48 +01:00
Jörg Thalheim
3a8e8369a6 envfs: 1.0.3 -> 1.0.6
Diff: https://github.com/Mic92/envfs/compare/1.0.3...1.0.6
2024-03-24 10:26:45 +01:00
Attila Oláh
ac4441fabd
Add missing closing parens.
https://xkcd.com/859
2024-03-02 12:40:40 +01:00
Adam C. Stephens
b52452f8c7
Merge pull request #291951 from amarshall/zfs-pkgs-renaming
zfs: rename zfsStable -> zfs_2_2; zfsUnstable -> zfs_unstable; remove enableUnstable option in favor of package
2024-03-01 10:09:12 -05:00
Andrew Marshall
1f32eb724d nixos/zfs: Remove enableUnstable in favor of setting package
This just adds complexity and confusion. Once-upon-a-time, there was no
`package` and only `enableUnstable`, but now it is just confusing to
have both, as it would be possible to do e.g. `package = pkgs.zfs` and
`enableUnstable = true`, but then `enableUnstable` does nothing.
2024-02-27 19:30:19 -05:00
Andrew Marshall
929fcf9335 zfs_unstable: Rename from zfsUnstable
This matches the naming of other zfs_* pkgs.
2024-02-27 18:45:55 -05:00
Andrew Marshall
ce5b1e007e nixos/zfs: Fix typo in option doc 2024-02-27 18:45:55 -05:00
Alyssa Ross
45f1428902
zfs_2_1: 2.1.14 -> 2.1.15
This adds compatibility with newer kernels, which fixes
nixosTests.zfs.series_2_1, which broke when the default kernel version
was bumped.

This means we no longer need the removeLinuxDRM option at all, but
I've kept it around as a no-op so people can leave it set in case the
same thing happens again in future.
2024-02-27 13:44:16 +01:00
Alyssa Ross
2b9f043823
zfs: update latestCompatibleLinuxPackages
ZFS no longer tries to use GPL-only symbols on aarch64.

Tested by building nixosTests.zfs.stable (modified to use Linux 6.6)
and nixosTests.zfs.unstable.
2024-02-26 12:27:10 +01:00
pennae
258b935d70 nixos/filesystems: make supportedFilesystems an attrset
this lets us *dis*able filesystem explicitly, as is required by e.g. the
zfs-less installer images. currently that specifically is only easily
possible by adding an overlay that stubs out `zfs`, with the obvious
side-effect of also removing tooling that could run without the kernel
module loaded.
2024-02-19 11:46:52 +01:00
nikstur
1c1cfa073a nixos/filesystems: init overlayfs 2024-02-07 22:13:00 +01:00
Jörg Thalheim
559ddda570
Merge pull request #279852 from Madouura/pr/bcachefs
bcachefs: update comments, release-notes, only use IFS for bcachefs, update bcachefs-tools and module
2024-01-25 01:11:04 +01:00
Lassulus
65f1d64303
Merge pull request #279923 from jopejoe1/sshfs
nixos/filesystems: set `system.fsPackages` for sshfs
2024-01-24 22:04:41 +01:00
Luke Granger-Brown
f5344c8b87
Merge pull request #280658 from simonhollingshead/add-fixedrandomdelay
nixos/auto-upgrade: add system.autoUpgrade.fixedRandomDelay
2024-01-22 14:48:23 +00:00
Madoura
c3316bcce4
nixos/bcachefs: add 'bcachefs-tools' to (udev/systemd).packages 2024-01-16 15:19:39 -06:00
Madoura
9dfa878a20
nixos/bcachefs: clarify 'FIXME' comment on when to remove 2024-01-16 15:06:05 -06:00
Franz Pletz
a436870727
Merge pull request #278179 from sinanmohd/network-interfaces-sit
nixos/network-interfaces: fix implicit dependency on underlying device
2024-01-16 19:49:46 +01:00
Will Fancher
c6f2b53e78
Merge pull request #280296 from ancathri/getKeyLocations-nosnapshots
nixos/zfs: fix getKeyLocations when listsnaps=on
2024-01-15 11:31:25 -05:00
Guillaume Girol
e52366c4d8
Merge pull request #272169 from nyabinary/remove-deprecated-network-interfaces
nixos/network-interfaces: remove network-interfaces.target
2024-01-14 14:17:14 +01:00
nikstur
ce1ed11483
Merge pull request #280708 from thillux/fix-trackpoint
modules/trackpoint: fix quote
2024-01-13 15:25:25 +01:00
Markus Theil
7fcfa4f0d6 modules/trackpoint: fix quote
Fixes:

[    7.106281] systemd[1]: /etc/systemd/system/trackpoint.service:10: Unbalanced quoting, ignoring: "/nix/store/iidxwcyp8pqhrq3iji17shs4m6gin0kv-systemd-254.6/bin/udevadm trigger --attr-match=name="TPPS/2 IBM TrackPoint"

Signed-off-by: Markus Theil <theil.markus@gmail.com>
2024-01-13 12:22:06 +01:00
Simon Hollingshead
d077cd8691 nixos/auto-upgrade: add system.autoUpgrade.fixedRandomDelay
From systemd 247, timers can be configured to randomize their delay
once and to apply the same random delay for all future executions.
This allows users to have less jitter between auto-upgrade executions
while still avoiding multiple timers firing simultaneously on a
machine or multiple machines all performing their upgrades
simultaneously.

The default option value (false) is backwards compatible.

All supported versions of NixOS (in fact, back to and including 21.05)
use systemd 247 or later.
2024-01-13 03:40:44 +00:00
ancathri
51dfaf639a nixos/zfs: fix getKeyLocations when listsnaps=on
Encountered boot errors in pool with `listsnapshots=on` getKeyLocations should ignore snapshots as they will not be well-handled by createImportService later on
2024-01-12 19:06:00 -06:00
Ryan Lahfa
724d5348a6
Merge pull request #272794 from dcarosone/zpool-import-d
nixos/zfs: check pool state with -d, like import
2024-01-12 20:07:24 +01:00
Niko
9e2cd6f872
nixos/network-interfaces: remove network-interfaces.target
Co-authored-by: Martin Weinelt <mweinelt@users.noreply.github.com>
2024-01-12 17:29:03 +01:00
jopejoe1
df5728a4f4 nixos/filesystems: init sshfs 2024-01-10 00:24:48 +01:00
K900
ef190570b8 nixos/bcachefs: use linuxPackages_latest 2024-01-08 10:47:51 +03:00
Jörg Thalheim
db59d03371
Merge branch 'master' into pr/bcachefs 2024-01-07 11:40:30 +01:00
sinanmohd
8314af158f nixos/network-interfaces: fix implicit dependency on underlying device
the bug causes a hard dependency on an underlying device which might not be
valid for all interfaces, also broke the example for networking.sits. this is
due to calling hasAttr first and checking for null afterwards, the bug was
made more apparent in commit 76a3c30
2024-01-02 12:03:29 +05:30
Ryan Lahfa
e44341e335
Merge pull request #195805 from Luflosi/grub-use-correct-zfs-version
nixos/grub: use the correct ZFS version
2023-12-31 21:33:37 +01:00
nikstur
9b29bc0010 nixos/trackpoint: replace activationScript
Replace with a separate systemd service ordered before sysinit.target
2023-12-29 03:22:25 +01:00
Luflosi
c71cb77cd6
nixos/grub: use the correct ZFS version
When `config.boot.zfs.enableUnstable` is set to true, grub was built with the `zfs` package even though the rest of the system uses the `zfsUnstable` package.
The effect of this can only be seen when `zfs` and `zfsUnstable` actually differ (which is not currently the case), for example when overriding one of them locally.
2023-12-29 01:53:27 +01:00
nikstur
c9569af3e0
Merge pull request #271326 from philiptaron/shutdown.target
treewide: depend on `shutdown.target` if `DefaultDependencies=no` in almost every case
2023-12-27 08:33:26 +01:00
pacien
cf6d89525f nixos/zed: use global sendmail if configured
This simplifies the setup to receive emails from the ZFS Event Daemon
by relying on the sendmail wrapper defined by other modules such as
msmtp or Postfix.

This is more similar to how other modules like smartd deal with email
configuration.

The user is no longer required to define and rebuild their own ZFS
package to add email support.

GitHub: closes https://github.com/NixOS/nixpkgs/issues/132464
2023-12-17 18:16:08 +01:00
Linus Heckemann
f66d2b11d7
Merge pull request #270084 from Atemu/nixos/snapraid-top-level
nixos/snapraid: remove from top-level
2023-12-14 14:51:04 +01:00
rnhmjoj
cdc24ab409
nixos/networking-interfaces: fix rootless ping
In 759ec111 the ping setuid wrapper was removed in favour of giving
permissions to perform ICMP echo requests to all users.
The problem is that the systemd file that was supposed to change the
`net.ipv4.ping_group_range` sysctl is not always installed, specifically
only if systemd.coredump.enable.
In that case the range is "0 1", which is effectively restricts ping to
only root.

This change explicitely sets the range to "0 2^31-1", as systemd does.
2023-12-11 13:22:26 +01:00