Commit Graph

913 Commits

Author SHA1 Message Date
Jörg Thalheim
3288479636 nixos/envfs: make mounts non-critical
We usually don't want to bring the whole machine into emergency mode
just because we couldn't mount envfs. It's usually not on the critical
path.
2023-05-08 11:24:18 +02:00
Florian Klink
6b27ed3229
Merge pull request #169116 from ElvishJerricco/systemd-stage-1-networkd
Systemd stage 1 networkd
2023-04-21 18:40:59 +02:00
Will Fancher
748f1329fc systemd-initrd: Automatically configure networking.interfaces 2023-04-17 16:41:35 -04:00
Felix Buehler
327b0cff7a treewide: use more lib.optionalString 2023-04-07 13:38:33 +02:00
Martin Weinelt
9e4d592114
Merge remote-tracking branch 'origin/master' into staging-next
Conflicts:
- pkgs/development/python-modules/eve/default.nix
2023-03-14 16:49:37 +01:00
Izorkin
3e3367aa6a
nixos/profiles/base: remove duplicate and optimize fsPackages 2023-03-03 23:32:48 +03:00
Florian Klink
ab566b8656
Merge pull request #208269 from ElvishJerricco/systemd-stage-1-fsck
Systemd stage 1 fsck
2023-02-17 10:06:39 +02:00
Sandro Jäckel
1c664befd4
nixos/envfs: add extraFallbackPathCommands options
this is mainly useful for restricted platforms like wsl which require
some extra entries in /bin/
2023-02-08 15:52:38 +01:00
Will Fancher
14b77582da systemd-stage-1: fsck 2023-02-08 00:43:10 -05:00
Will Fancher
1b39491326 systemd-stage-1: Use x-initrd.mount for better unit dependencies 2023-02-07 22:22:39 -05:00
Sandro Jäckel
d9f07dcee5
nixos/envfs: use configured environment.usrbinenv and environment.binsh
Taken from upstream
d91aeefccb
2023-01-30 16:52:43 +01:00
pennae
cf792cfde3 nixos/envfs: fix envfs package option default
mdDoc is not valid here, but isn't currently rejected for xslt reasons.
2023-01-22 17:50:09 +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
Jörg Thalheim
655e072533 nixos/bcachefs: fix boot with systemd enabled initrd 2023-01-01 19:58:16 +01:00
Will Fancher
3d7270abd5
Merge pull request #203171 from ElvishJerricco/zfs-fix-requested-credentials
nixos/zfs: Ensure pool has datasets to decrypt
2022-12-29 00:00:29 -05:00
Jörg Thalheim
741a0f5a7f envfs: init at 1.0.0 2022-12-28 16:03:49 +01:00
Lily Foster
8b4fd74782 nixos/filesystems: require fstab options list be non-empty
When the option list is empty, the fstab generator does not
automatically add "defaults" and generates a non-working fstab (since it
just emits two spaces around where the options would have been which is
only technically one fstab separator).
2022-12-26 17:11:05 +01:00
Will Fancher
a45968c1e4 nixos/zfs: Ensure pool has datasets to decrypt 2022-12-24 17:13:32 -05:00
Jakub Sokołowski
c70f047315
nixos/zfs: assert no force import with hibernation
According to a ZFS issue about hibernation causing data corruption:
https://github.com/openzfs/zfs/issues/12842

The way this happens is if the system force imports a pool that was
suspended during hibernation. I've had this happen twice on NixOS and
I'd like to avoid having this happen again, to me or others.

To do this I've added an assertion that makes sure you can't have
`forceImportRoot` or `forceImportAll` enabled with `allowHibernation`.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2022-12-17 13:11:23 +01:00
Artturin
05a2dfd674 lib.replaceChars: warn about being a deprecated alias
replaceStrings has been in nix since 2015(nix 1.10)

so it is safe to remove the fallback

d6d5885c15
2022-12-15 22:25:51 +02:00
Ryan Lahfa
bc7c15825b
Merge pull request #117371 from grahamc/sysctl-hostname
network-interfaces: set hostname from sysctl if defined
2022-12-01 16:03:04 +01:00
Vladimír Čunát
cdad0ce127
nixos/filesystems: fix a typo in docs 2022-11-27 21:57:35 +01:00
Sandro
f92201f461
Merge pull request #197925 from SuperSandro2000/lvm2 2022-11-24 13:58:29 +01:00
Will Fancher
71c74bf173 nixos: Add ext to fsPackages in stage 2 with systemd-initrd enabled 2022-11-20 22:30:01 -05:00
Martin Weinelt
c021df5792
Merge pull request #197254 from Atemu/fstab-escape-options 2022-11-19 18:08:40 +01:00
Will Fancher
acecd1ec7b Revert "nixos: Fix fsck with systemd 251.6 and later"
This reverts commit d9b1bde390.
2022-11-15 17:45:38 -05:00
aszlig
d9b1bde390
nixos: Fix fsck with systemd 251.6 and later
Version 251.6 of systemd introduced a small change[1] that now checks
whether the fsck command is available in *addition* to the filesystem
specific fsck.$fsname executable.

When bumping systemd to version 251.7 on our side[2], we introduced that
change. This subsequently caused our "fsck" test to fail and it looks
like this was an oversight during the pull request[3] introducing the
bump.

Since the fsck wrapper binary is in util-linux, I decided to address
this by adding util-linux to fsPackages because util-linux is already
part of the closure of any NixOS system so the impact should be pretty
low.

[1]: 73db7d9932
[2]: 844a08cc06
[3]: https://github.com/NixOS/nixpkgs/pull/199618

Signed-off-by: aszlig <aszlig@nix.build>
2022-11-15 02:15:54 +01:00
Sandro Jäckel
5452a26077
nixos/lvm: replace boot.isContainer with services.lvm.enable 2022-11-09 23:47:37 +01:00
Robert Hensing
93a905ec4f
Merge pull request #194759 from hercules-ci/fqdn-or-hostname
nixos: Add `networking.fqdnOrHostName`
2022-11-09 13:53:57 +01:00
Naïm Favier
8f571534c9
Merge pull request #194766 from ncfavier/proxy-arp 2022-10-31 09:59:56 +01:00
Thiago Kenji Okada
f83198ab9c
Merge pull request #171680 from bryanasdev000/zfshibernation
nixos/zfs: introduce option to control hibernation
2022-10-29 10:37:52 +01:00
Bryan A. S
a53858010b nixos/zfs: introduce option to control hibernation 2022-10-29 04:46:27 -03:00
Bjørn Forsman
3ec90ef87f nixos/filesystems: add nfs4 to fsToSkipCheck
This change fixes this system journal warning for
`fileSystems.<name>.fsType = "nfs4"` configurations:

  systemd-fstab-generator[714]: Checking was requested for "192.168.0.6:/data", but it is not a device.
2022-10-23 20:08:08 +02:00
Atemu
7e2aec079c nixos/filesystems: escape mount options in fstab
Some mount options might include path names and those often contain spaces and
therefore must be escaped. An example which prompted me to make this change is
the path of a btrfs subvolume.
2022-10-22 20:00:56 +02:00
Robert Hensing
18e3f431e1 networking.fqdnOrHostName: Elaborate and format the descriptions 2022-10-15 11:57:58 +02:00
Edward Tjörnhammar
a72e138b78 nixos/jfs: correct broken toplevel reference 2022-10-06 19:26:13 +00:00
Naïm Favier
52c58c8bbe
nixos/network-interfaces: reflect negative settings of proxyARP
Currently, setting `proxyARP` to true enables `proxy_arp`, but setting
it to false doesn't disable it. This is surprising and stateful.
2022-10-06 16:46:17 +02:00
Robert Hensing
f43716f28e nixos: Add networking.fqdnOrHostName option, readOnly 2022-10-06 16:21:09 +02:00
Christian Kögler
d3fc91e579
Merge pull request #191352 from maifel-maifel/mr-networking-deprecation-note
nixos/networking: add a suggestion to use networkd options
2022-10-01 09:10:30 +02:00
digital
12d64e041b nixos/networking: add a suggestion to use networkd options 2022-09-15 18:07:24 +02:00
Nick Cao
ca03f2dc0f
nixos/stratis: init 2022-09-12 15:19:36 +08: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
pennae
9547123258 nixos/*: convert internal option descriptions to MD
we'll have to do it eventually, may as well be now.
2022-08-31 16:32:54 +02:00
pennae
ef176dcf7e nixos/*: automatically convert option descriptions
conversions were done using https://github.com/pennae/nix-doc-munge
using (probably) rev f34e145 running

    nix-doc-munge nixos/**/*.nix
    nix-doc-munge --import nixos/**/*.nix

the tool ensures that only changes that could affect the generated
manual *but don't* are committed, other changes require manual review
and are discarded.
2022-08-31 16:32:53 +02:00
pennae
9217509ece nixos/network-interfaces: convert option descriptions to MD 2022-08-27 19:18:29 +02:00
pennae
51a11254a7 nixos/*: literalDocBook -> literalMD
no change to rendered output
2022-08-27 19:18:29 +02:00
Will Fancher
2239c5d55f
Merge pull request #186163 from lilyinstarlight/feature/systemd-stage-1-fs-label
nixos/systemd-stage-1: unify initrd fstab generation logic with system fstab
2022-08-20 18:29:07 -04:00
pennae
6039648c50 nixos/*: automatically convert option docs 2022-08-19 22:40:58 +02:00
pennae
7e7d68a250 nixos/*: mark pre-existing markdown descriptions as mdDoc 2022-08-19 22:40:58 +02:00
pennae
e4ed177f82 nixos/* eliminate inner whitespace in tags that was missed earlier
nix-doc-munge won't match tags that contain newlines anywhere. most of
these have already been removed, but a few obviously made it through.
2022-08-19 22:40:58 +02:00
Pierre Bourdon
4ae5da5394
nixos/network-interfaces-systemd: do not ignore /0 gateway routes
While it might seem odd, 0.0.0.0/0 or ::/0 gateways are valid and
commonly used on point-to-point links (e.g. a wireguard tunnel) to
indicate that all traffic needs to be sent to a given interface.

systemd-networkd actually documents this as a valid configuration in its
man pages [1].

Tested to do the right thing in one of my NixOS containers using
a Wireguard tunnel as its default route.

[1] https://www.freedesktop.org/software/systemd/man/systemd.network.html#DefaultRouteOnDevice=
2022-08-19 02:25:41 +02:00
Lily Foster
69d7943101 nixos/systemd-stage-1: unify initrd fstab generation logic with system fstab 2022-08-18 13:33:43 -04:00
ajs124
9fd1ae2f4e
Merge pull request #185413 from Luflosi/skip-fsck-for-more-filesystems 2022-08-15 20:09:59 +02:00
pennae
50f9b3107a
Merge pull request #185474 from pennae/option-docs-md
nixos/*: more options md conversion
2022-08-12 23:23:26 +02:00
Franz Pletz
a7f89ddd63
Merge pull request #185763 from srhb/zfs-scrub-synchronously
nixos/zfs: scrub synchronously
2022-08-10 15:20:52 +02:00
Sarah Brofeldt
ab2e77ea82 nixos/zfs: scrub synchronously
This prevents spurious systemd failures if the timer unit starts a new
scrub before a long-running one has finished.
2022-08-09 07:06:09 +02:00
Paul Haerle
944a466373
fix whitespace 2022-08-06 21:57:14 +02:00
Paul Haerle
cc477fb34d
zfs: Make zpool available for zpool-expand-pools
...if cfgExpandOnBoot == "all", otherwise it fails during runtime:
```
Aug 06 19:38:05 nixos zpool-expand-pools-start[981]: /nix/store/ka3vivdray82mi9dql12yf258gkw643l-unit-script-zpool-expand-pools-start/bin/zpool-expand-pools-start: line 3: zpool: command not found
```
2022-08-06 21:51:31 +02:00
pennae
087472b1e5 nixos/*: automatically convert option docs 2022-08-06 20:39:12 +02:00
Luflosi
dd80fa1e9b
nixos/filesystems: skip fsck for more filesystems
This commit prevents warning messages like
```
systemd-fstab-generator: Checking was requested for "/path/to/device", but it is not a device.
```
in `dmesg` when one of the filesystems 9p, cifs, prl_fs or vmhgfs is added to the list of `fileSystems`.
This happens because the generated /etc/fstab entry contains a non-zero fsck pass number, which doesn't make sense for these filesystems.
2022-08-06 15:21:57 +02:00
pennae
423545fe48 nixos/*: normalize manpage references to single-line form
now nix-doc-munge will not introduce whitespace changes when it replaces
manpage references with the MD equivalent.

no change to the manpage, changes to the HTML manual are whitespace only.
2022-08-05 18:34:50 +02:00
pennae
61e93df189 nixos/*: automatically convert option docs to MD
once again using nix-doc-munge (69d080323a)
2022-08-03 22:46:41 +02:00
pennae
3aebb4a2be nixos/*: normalize link format
make (almost) all links appear on only a single line, with no
unnecessary whitespace, using double quotes for attributes. this lets us
automatically convert them to markdown easily.

the few remaining links are extremely long link in a gnome module, we'll
come back to those at a later date.
2022-08-03 21:57:46 +02:00
pennae
694d5b19d3 nixos/*: replace </para><para> with double linebreaks
our xslt already replaces double line breaks with a paragraph close and
reopen. not using explicit para tags lets nix-doc-munge convert more
descriptions losslessly.

only whitespace changes to generated documents, except for two
strongswan options gaining paragraph two breaks they arguably should've
had anyway.
2022-08-03 20:39:21 +02:00
pennae
6b13dd0e9e
Merge pull request #183491 from pennae/automatic-md-conversions
treewide: automatically md-convert option descriptions
2022-08-02 02:15:30 +02:00
pennae
2e751c0772 treewide: automatically md-convert option descriptions
the conversion procedure is simple:

 - find all things that look like options, ie calls to either `mkOption`
   or `lib.mkOption` that take an attrset. remember the attrset as the
   option
 - for all options, find a `description` attribute who's value is not a
   call to `mdDoc` or `lib.mdDoc`
 - textually convert the entire value of the attribute to MD with a few
   simple regexes (the set from mdize-module.sh)
 - if the change produced a change in the manual output, discard
 - if the change kept the manual unchanged, add some text to the
   description to make sure we've actually found an option. if the
   manual changes this time, keep the converted description

this procedure converts 80% of nixos options to markdown. around 2000
options remain to be inspected, but most of those fail the "does not
change the manual output check": currently the MD conversion process
does not faithfully convert docbook tags like <code> and <package>, so
any option using such tags will not be converted at all.
2022-07-30 15:16:34 +02:00
Alexandre Badez
8457d9277a system.autoUpgrade: add boot option. 2022-07-29 08:21:07 +02:00
pennae
a16b25432e
Merge pull request #182685 from pennae/invariant-option-conversions
treewide: invariant option conversions to MD
2022-07-27 15:39:47 +02:00
ajs124
66e9ea4827
Merge pull request #180008 from Luflosi/skip-fsck-for-bind-mount 2022-07-25 23:56:12 +02:00
pennae
b115622f4b nixos/tasks: invariant option docs MD conversions 2022-07-24 13:01:47 +02:00
ajs124
c386f8658b (k)vdo: 8.1.1.360 -> 8.2.0.2 2022-07-20 15:00:53 +02:00
Artturi
6dc4ee65f7
Merge pull request #179163 from cmm/network-setup-bindTo
nixos/network-interfaces-scripted: don't bindTo absent network-setup.service
2022-07-19 01:33:14 +03:00
Luflosi
db4fdd6247
nixos/filesystems: skip fsck for bind mounts
Without this change, configurations like
```nix
fileSystems."/path/to/bindMountedDirectory" = {
  device = "/path/to/originalDirectory";
  options = [ "bind" ];
};
```
will lead to a warning message in `dmesg`:
```
systemd-fstab-generator: Checking was requested for "/path/to/originalDirectory", but it is not a device.
```
This happens because the generated /etc/fstab entry contains a non-zero fsck pass number, which doesn't make sense for a bind mount.
2022-07-12 16:51:25 +02:00
Lassulus
92c4b16caf
Merge pull request #171401 from klemensn/filesystems-zfs
Small ZFS handling improvements
2022-07-03 18:07:53 +02:00
Michael Livshin
cd13a2074b nixos/network-interfaces-scripted: don't bindTo absent network-setup.service 2022-06-26 11:03:57 +03:00
Naïm Favier
e1c1fdd8c2
nixos/networkd: add IPv6PrivacyExtensions=kernel for default networks
Maybe this could go in `genericNetwork`, but I don't know if it makes
sense for bridges, bonds etc. and I don't want to break anything.
2022-06-21 17:12:01 +02:00
Naïm Favier
f8a83b4260
nixos/networkd: make default networks RequiredForOnline when possible
When `systemd.network.wait-online.anyInterface` is enabled,
`RequiredForOnline` really means "sufficient for online", so enable it.
2022-06-21 17:12:01 +02:00
pennae
9e109ffdb5
Merge pull request #178110 from pennae/fix-networkd-gateways
nixos/networking: fix v4+v6 default gateways with networkd
2022-06-20 14:17:41 +00:00
pennae
da28b26d64 nixos/networking: fix v4+v6 default gateways with networkd
fixes #178078
2022-06-18 09:33:35 +02:00
Sandro
8effa309cc
Merge pull request #176379 from SuperSandro2000/network-setup
nixos/network-interfaces-scripted: remove network-setup unit if unused
2022-06-17 22:36:45 +02:00
Sandro Jäckel
ec00b4bb11
nixos/network-interfaces-scripted: remove network-setup unit if unused 2022-06-05 13:35:55 +02:00
Alexandru Scvortov
3a09010b9d nixos/network-interfaces: add networking.interfaces.<name>.ipv[46].routes.type 2022-06-02 19:16:25 +01:00
Janne Heß
e6fb1e63d1
Merge pull request #171650 from helsinki-systems/feat/config-systemd-package
treewide: pkgs.systemd -> config.systemd.package
2022-05-09 10:23:04 +02:00
Maximilian Bosch
f0bb39d4b7
Merge pull request #167327 from lheckemann/networkd-usedhcp
nixos/networkd: reimplement useDHCP in a sensible way
2022-05-07 00:05:44 +02:00
Janne Heß
57cd07f3a9
treewide: pkgs.systemd -> config.systemd.package
This ensures there is only one systemd package when e.g. testing the
next systemd version.
2022-05-05 20:00:31 +02:00
Will Fancher
f989e13983 zfs: Support zfs_force=y on the command line as well. 2022-05-04 18:32:27 -04:00
Will Fancher
e0b5ba5479 nixos: Don't use grep to request ZFS credentials, and consider keystatus 2022-05-03 14:56:50 -04:00
Will Fancher
0a16158078 zfs: Update comment for https://github.com/zfsonlinux/zfs/pull/4943 2022-05-03 12:55:01 -04:00
Will Fancher
8555a7fdbf zfs: Allow three tries to decrypt datasets 2022-05-03 12:55:01 -04:00
Will Fancher
44a6882f55 nixos/stage-1-systemd: ZFS support 2022-05-03 12:55:00 -04:00
Klemens Nanni
d1754b1ab0 nixos/filesystems/zfs: Use proper script mode
Tell zpool-list(8) to format output rather than modifying it afterwards.

Furthermore, pool names may contain spaces and would thus break due to
awk(1)'s word splitting.
2022-05-03 16:28:39 +02:00
Klemens Nanni
2a341bd2f4 nixos/filesystems/zfs: Escape dataset names
Although unlikely, ZFS happily accepts names like 'zroot/foo -r'.

Escape names and separate command line options from arguments to avoid
any kind of misinterpretation.
2022-05-03 15:56:54 +02:00
Maximilian Bosch
196c877c85
nixos/network-interfaces: remove outdated deprecation information 2022-04-30 12:40:10 +02:00
Maximilian Bosch
aa849e1478
nixos/network-interfaces-systemd: actually set catchall-iface if useDHCP = true;
Previously this wasn't done in the `forEach`-expression for
`cfg.interfaces` and thus `networking.useDHCP` didn't have any effect if
no further interface was statically configured.
2022-04-30 00:30:03 +02:00
Linus Heckemann
d30dbf38b9
nixos/networkd: reimplement useDHCP in a sensible way 2022-04-30 00:30:01 +02:00
Will Fancher
2e96b64e02
Merge pull request #170123 from ElvishJerricco/systemd-shutdown-ramfs-fixup
Systemd shutdown ramfs fixup
2022-04-28 20:17:23 -04:00
Will Fancher
50925651bb zfs: Sync pools on shutdown. 2022-04-28 14:12:16 -04:00
Janne Heß
69d1acda00
nixos/xfs: Fix evaluation (#170471) 2022-04-26 21:43:01 +02:00
Janne Heß
acca69992c
nixos/btrfs: Add systemd stage 1 support 2022-04-24 16:32:54 +02:00
Janne Heß
160fb93fdc
nixos/filesystems: Make most simple filesystems compatible with systemd
This includes disabling some features in the initrd by default, this is
only done when the new initrd is used. Namely, ext and bcache are
disabled by default. bcache gets an own enable option while ext is
detected like any other filesystem.
2022-04-24 16:32:34 +02:00
Janne Heß
a719f5fb9d
Merge pull request #168965 from helsinki-systems/feat/systemd-stage-1-hostid
nixos/stage-1-init: Set host id for ZFS
2022-04-18 18:31:18 +02:00
Thiago Kenji Okada
99b20f5580
Merge pull request #107957 from tex/nixos/auto-upgrade
nixos/auto-upgrade: add persistent option
2022-04-16 23:06:17 +01:00
Janne Heß
3396c96e4b
nixos/stage-1-init: Set host id for ZFS 2022-04-16 21:32:18 +01:00
Milan Svoboda
a5fb565bf5 nixos/auto-upgrade: add persistent option 2022-04-16 19:27:21 +02:00
Janne Heß
01bc138a8e
nixos/stage-1-init: Merge mdraid module into swraid 2022-04-15 19:57:16 +01:00
Janne Heß
2633e82e1a
nixos/stage-1-systemd: Add LVM2 support 2022-04-13 23:00:19 +01:00
Graham Christensen
bd3e9c3d05 nixos/zfs: better support auto-expanding partitioned disks 2022-04-07 13:06:57 -04:00
ajs124
6a8face381 nixos/tests/lvm2: don't try to add script from vdo to initrd 2022-04-04 14:23:09 +01:00
ajs124
397f065cb4 nixos/tasks/lvm: add vdo support 2022-04-04 13:00:46 +01:00
Janne Heß
7cdc4dd5d1
Merge pull request #164943 from ElvishJerricco/systemd-initrd-reuse-systemd-module
initrd: Opt-in bare bones systemd-based initrd
2022-04-03 15:53:02 +02:00
Jade
e50bc2f36d
nixos/nix-gc, nixos/auto-upgrade: Minor documentation fixes.
The gc documentation had some artifacts (presumably being copied from
autoupgrade) and the autoupgrade docs had a typo
2022-03-31 00:24:25 -04:00
Linus Heckemann
3631db714c
Merge pull request #158176 from lheckemann/fix-tempaddr
network-interfaces: use altered interface name for setting use_tempaddr
2022-03-29 10:39:46 +02:00
Janne Heß
158a2972eb
nixos/filesystems: Move options into the fs module
This was probably forgotten during a refactoring. The module is where
the values of the options are actually used.
2022-03-27 13:23:44 +02:00
Will Fancher
213de9b108 systemd-initrd: autoFormat and autoResize in initrd 2022-03-22 21:28:51 -04:00
jpathy
19bb72c070 networking.greTunnels: Add ttl option 2022-03-23 00:24:44 +05:30
pennae
e8bfc4d4a8
Merge pull request #164367 from jpathy/patch-2
networking.greTunnels: support ip6gre*
2022-03-18 15:43:03 +00:00
Silvan Mosberger
839b9b8ddc
Merge pull request #77622 from R-VdP/nixos-upgrade-reboot-window
NixOS/auto-upgrade: offer the possibility to define a reboot window during which the system may be automatically rebooted
2022-03-17 23:50:53 +01:00
jpathy
0a62de4cd5 networking.greTunnels: support ip6gre* 2022-03-17 17:59:36 +05:30
R-VdP
39f3eb3004 NixOS/auto-upgrade: offer the possibility to define a reboot window during which the system may be automatically rebooted
Some systems should not be rebooted at just any time. If the upgrade process takes too long, for instance because of a
slow internet connection, or if the upgrade service is ran during production hours, we want to allow to define a window
outside of which a reboot will not be performed.
The system will then reboot on the next run of the upgrade service which finishes inside the reboot window.

E.g. we can run the update service twice per week, once during the night and once during the day, but reboots are only
allowed during the night. By doing so, a system that is usually shut down during the night will still receive updates
and systems that are turned on 24/7 can be rebooted outside of production hours.

Co-authored-by: Silvan Mosberger <github@infinisil.com>
2022-03-09 08:18:16 +01:00
Alyssa Ross
1176525f87 treewide: remove obsolete kernel version checks
We don't support Linux kernels older than 4.4 in Nixpkgs.
2022-02-19 21:09:19 +00:00
Linus Heckemann
c74d784771 network-interfaces: use altered interface name for setting use_tempaddr
Fixes #86764
2022-02-05 00:13:03 +01:00
Jade
fe636b4805
nixos/networking: Typo fix 2022-02-04 13:55:56 -05:00
Luflosi
26a695399a
nixos/apfs: init
Add the final missing pieces for full APFS support.
2022-01-27 15:18:45 +01:00
Luflosi
64560de406
nixos/networkd: fix networking.networkd.static test
Commit ca58bd0a50 broke the test networking.networkd.static. This happened because the test sets `networking.defaultGateway`. This is implemented by adding the gateway to the list of `routes` using `mkDefault`. The `routes` are then overridden by an empty list in the newly added code. Replace `mkDefault` with `id` so the two lists are merged and everything (hopefully) works as expected.
See https://github.com/NixOS/nixpkgs/pull/144590 for a more context.
2022-01-21 19:35:17 +01:00
Luflosi
ca58bd0a50
nixos/networkd: Add routes from interfaces to [Route] section of .network file
Closes https://github.com/NixOS/nixpkgs/pull/93635.
2022-01-20 20:14:55 +01:00
Guillaume Girol
fdc3784828
Merge pull request #148637 from hexagonal-sun/network/gre-tap-tun
nixos/network: add gre virtual interfaces
2022-01-01 17:04:29 +00:00
Graham Christensen
06edb74413
Merge pull request #148785 from pennae/more-option-doc-staticizing
treewide: more defaultText for options
2021-12-17 11:14:08 -05:00
pennae
9407761763 treewide: add defaultText for options using other shortcut bindings 2021-12-09 01:42:24 +01:00
pennae
2d564521c0 treewide: add literalDocBook text to options with complex defaults
some options have default that are best described in prose, such as
defaults that depend on the system stateVersion, defaults that are
derivations specific to the surrounding context, or those where the
expression is much longer and harder to understand than a simple text
snippet.
2021-12-09 01:38:24 +01:00
pennae
ed673a69db treewide: add defaultText for options with simple cfg.* expression defaults
adds defaultText for options with defaults that use only literals, full config.*
paths, and the cfg shortcut binding.
2021-12-09 01:14:16 +01:00
David Knaack
28db2a481d
nixos/snapraid: fix evaluation
Use string concatenation operator (`+`) instead of incorrect list concatenation operator (`++`)
2021-12-08 11:10:02 +01:00
Matthew Leach
5ce7061945 nixos/networking: add options for configuring a GRE tunnel
Add `networking.greTunnels` option that allows a GRE tunnel to be
configured in NixOS.
2021-12-07 15:44:00 +00:00
lunik1
6073b099d0
nixos/snapraid: relax permissions of snapraid-sync
Remove PrivateDevices to silence warning about SnapRAID being
unable to access disk UUIDs.

Add CAP_FOWNER when touch is enabled so file time stamps can be
set.
2021-12-03 15:55:27 +00:00
Artturi
a0d4895e9d
Merge pull request #146709 from Artturin/underscorename 2021-11-21 03:12:31 +02:00
Artturin
2077956e78 nixos/network-interfaces: add a warning for underscores in hostname
until the issues in https://github.com/NixOS/nixpkgs/pull/138978
have been resolved
2021-11-21 01:39:39 +02:00
Artturi
1c005b3de1
Merge pull request #139337 from Artturin/tempaddr 2021-11-20 01:27:13 +02:00
Cheng Shao
4cd015e65e NixOS auto upgrade: add openssh to path 2021-11-19 12:52:36 +00:00
Artturin
31759dc4b7 nixos/networkmanager: remove redundant ipv6.ip6-privacy
this setting was added in 2016 in commit
bcdd81d9e1

the posibility to preferTempAddress was added to
nixos/network-interface in 2018 in commit
1fec496f38

preferTempAddress was renamed to tempAddress
in 2020 in commit 2485e6399e

therefore this setting is redundant since nm will use the sysctl option

nixos/network-interfaces: add default to sysctl so that the value for it
is set

networkmanager falls back to it
https://man.archlinux.org/man/NetworkManager.conf.5
2021-11-19 01:12:25 +02:00
Cole Helbling
516b49155e nixos/zfs: replace parentheses with braces
The parentheses prevent the `continue` line from working by running the
enclosed in a subshell -- I noticed that ZFS would start asking me for
my password to encrypted child datasets, even though they were not
specified in `requestEncryptionCredentials`. The following logs would
also be present in the import unit's journal:

    Oct 31 22:13:17 host systemd[1]: Starting Import ZFS pool "pool"...
    Oct 31 22:13:44 host zfs-import-pool-start[3711]: importing ZFS pool "pool"...
    Oct 31 22:13:44 host zfs-import-pool-start[4017]:pool/nix/store/39zij3xcxn4w38v6x8f88bx8y91nv0rm-unit-script-zfs-import-pool-start/bin/zfs-import-pool-start: line 31: continue: only meaningful in a `for', `while', or `until' loop
    Oct 31 22:13:44 host zfs-import-pool-start[4020]:pool/nix/store/39zij3xcxn4w38v6x8f88bx8y91nv0rm-unit-script-zfs-import-pool-start/bin/zfs-import-pool-start: line 31: continue: only meaningful in a `for', `while', or `until' loop
    Oct 31 22:15:14 host zfs-import-pool-start[4023]: Failed to query password: Timer expired
    Oct 31 22:15:14 host zfs-import-pool-start[4024]: Key load error: encryption failure
    Oct 31 22:15:14 host systemd[1]: zfs-import-pool.service: Main process exited, code=exited, status=255/EXCEPTION
    Oct 31 22:15:14 host systemd[1]: zfs-import-pool.service: Failed with result 'exit-code'.
    Oct 31 22:15:14 host systemd[1]: Failed to start Import ZFS pool "pool".
2021-11-03 04:59:46 -04:00
pennae
c1f5155471 nixos/networking: support FOU encapsulation for sits 2021-10-16 20:48:03 -04:00
pennae
f29ea2d15d nixos/networking: add foo-over-udp endpoint support
allows configuration of foo-over-udp decapsulation endpoints. sadly networkd
seems to lack the features necessary to support local and peer address
configuration, so those are only supported when using scripted configuration.
2021-10-16 20:48:03 -04:00
Michele Guerini Rocco
46b2a2594a
Merge pull request #140779 from legendofmiracles/wol
nixos/wakeonlan: switch to systemd.link and to nixos/networking
2021-10-09 10:34:26 +02:00
legendofmiracles
bb3ea37eee
nixos/networking: add the wakeonlan option 2021-10-07 14:15:17 -06:00
Naïm Favier
2ddc335e6f
nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
Samuel Dionne-Riel
110165b784 Provide submodule to security.wrappers for older kernels
Fixes a regression from #126289
2021-09-29 16:10:27 -04:00
rnhmjoj
fedd7cd690
nixos: explicitely set security.wrappers ownership
This is slightly more verbose and inconvenient, but it forces you
to think about what the wrapper ownership and permissions will be.
2021-09-13 13:48:13 +02:00
Lassulus
7cd6b6dfc8
Merge pull request #132786 from helsinki-systems/feat/initrd-dm-cache
tasks/lvm: add all tools from thin-provisioning-tools
2021-09-08 18:19:41 +02:00
Michele Guerini Rocco
052009bf2b
Merge pull request #135315 from johnjameswhitman/johnjameswhitman/fix-wlan-sub-interfaces
nixos/tasks/network-interfaces: Assign mac to new wlan interface instead of underlying one
2021-09-02 09:37:04 +02:00
John Whitman
8d3527aa88 nixos/network-interfaces: Fix wlan interface mac 2021-09-01 21:46:26 -04:00
davidak
a023b22d6b
Merge pull request #105786 from teto/fstab
filesystems: add syntax to /etc/fstab header
2021-08-26 05:53:25 +02:00
Sandro
49b5beea43
Merge pull request #128624 from vs49688/exfat 2021-08-25 12:24:39 +02:00
Your Name
4bb4bcc30c services.zfs.expandOnBoot: support expanding pools on boot
Either enumerating a list of pools to expand or expanding
all pools on boot.
2021-08-24 15:01:08 -04:00
Zane van Iperen
a049d84229
nixos/filesystems/exfat: use "exfatprogs" instead of "exfat" if kernel > 5.7
5.7+ comes with a native exfat implementation, exfatprogs should be used instead.

The exfat package puts a "mount.exfat" binary in the path, which causes
mount to prefer the FUSE version to the non-fuse one. There's no way to
disable the binary, so switch to exfatprogs.
2021-08-24 03:31:41 +10:00
ajs124
f358f7326b tasks/lvm: add all tools from thin-provisioning-tools
This should barely increase the size of the initrd, because these are all symlinks.
With this, systems with dm-cache/lvmcache can also be booted, although the kernel modules for the relevant dm targets still need to be added to the initrd with boot.initrd.kernelModules.
2021-08-20 12:55:06 +02:00
Michele Guerini Rocco
a336bdd209
Merge pull request #103738 from netixx/openvswitch-improved-systemd
openvswitch: fix systemd integration assertion
2021-08-16 11:48:53 +02:00
ajs124
ce080720fb
Merge pull request #131587 from hyperfekt/systemd-pstore
nixos/filesystems: succeed mount-pstore.service without backend
2021-07-27 14:27:15 +02:00
Ben Siraphob
b63a54f81c
Merge pull request #110742 from siraben/deprecate-fold 2021-07-27 15:13:31 +07:00
hyperfekt
b3200bc922 nixos/filesystems: succeed mount-pstore.service without backend 2021-07-26 21:02:58 +00:00
Luke Granger-Brown
a0b7bd69ac
Merge pull request #124431 from hyperfekt/systemd-pstore
nixos/filesystems: mount-pstore.service improvements
2021-07-25 10:33:39 +01:00
Robert Hensing
98352288bd
Merge pull request #128032 from Artturin/add-swap-options
nixos/swap: add options option
2021-07-23 10:45:53 +02:00
Artturin
c971de97c4 nixos/swap: add options option 2021-07-20 20:51:27 +03:00
lunik1
145a3d084a
nixos/snapraid: init 2021-07-14 19:02:19 +01:00
Atemu
f879395bd9
nixos/btrfs: handle new checksum types in initrd (#126158)
Can't mount a root formatted with those otherwise
2021-07-06 09:57:10 -04:00
Niklas Hambüchen
685e8ff7dd xserver: Generate readable config indentation 2021-06-17 03:34:40 +02:00
Sandro
2b49e4e735
Merge pull request #107728 from nessdoor/master 2021-06-15 14:40:21 +02:00
jakobrs
b07602a604 nixos/lib, nixos/filesystems: Make fsBefore more stable, and add depends option 2021-06-08 18:51:31 +02:00
hyperfekt
af871f619c nixos/filesystems: await builtin pstore module backend in mount-pstore
If the pstore module is builtin, it nonetheless can take considerable
time to register a backend despite /sys/fs/pstore already appearing
mounted, so the condition is moved into the main script to extend
waiting for the backend to this case.
2021-05-30 03:43:56 +02:00
hyperfekt
92cbe52e19 nixos/filesystems: condition mount-pstore.service on pstore module
systemd's modprobe@.service does not require success so mount-pstore
executed despite a non-present pstore module, leading to an error about
the /sys/fs/pstore mountpoint not existing on CONFIG_PSTORE=n systems.
2021-05-30 03:43:50 +02:00
hyperfekt
ef991f9b8b nixos/filesystems: condition mount-pstore.service on unmounted /sys/fs/pstore
For unknown reasons, switching to a system that first introduces this
service has it fail with /sys/fs/pstore already having been mounted.
2021-05-21 17:49:23 +02:00
Tomas Antonio Lopez
b922fa959b nixos/swap: add discardPolicy option
Add option for activating discards on swap partitions (none, once, pages and both).
2021-05-19 21:23:35 +09:00
ajs124
8e78793029 nixos/tasks/filesystems: utillinux -> util-linux 2021-05-17 14:47:57 +02:00
Florian Klink
6c0058f47f
Merge pull request #85073 from hyperfekt/systemd-pstore
nixos/systemd|filesystems: mount and evacuate /sys/fs/pstore using systemd-pstore
2021-05-17 00:00:52 +02:00
github-actions[bot]
bf5d8bb531
Merge master into staging-next 2021-05-14 00:58:11 +00:00
Jens Nolte
22e797947b
nixos/zfs: Add defaultText for 'boot.zfs.package'-option (#122002) 2021-05-13 17:40:10 -04:00
hyperfekt
870fa77ff6 nixos/filesystems: mount persistent storage to /sys/fs/pstore 2021-05-09 23:21:32 +02:00
github-actions[bot]
1ae6d3d02f
Merge master into staging-next 2021-05-07 18:24:29 +00:00
Linus Heckemann
4c4ac4bb20 nixos/network: allow configuring tempaddr for undeclared interfaces 2021-04-27 16:43:30 +02:00
Julien Moutinho
05d334cfe2 Revert "Revert "apparmor: fix and improve the service""
This reverts commit 420f89ceb2.
2021-04-23 07:17:55 +02:00
Luflosi
e205a4800f
nixos/cpu-freq: fix typo in description
This typo was introduced when the option was first added in 2011, almost 10 years ago (ae82e7b048).
2021-04-21 22:03:18 +02:00
Jörg Thalheim
fc02b14738
Merge pull request #117071 from mohe2015/hotfix-zfs-grub
nixos/zfs: Fix regression that prevents people to boot from zfs using grub if they didn't add zfs to boot.initrd.supportedFilesystems
2021-04-17 16:01:22 +01:00
ajs124
c6d4dae35d treewide: fix eval without aliases after 9378fdf87e 2021-04-08 13:33:09 +02:00
Sandro Jäckel
9378fdf87e
iproute: deprecate alias 2021-04-04 01:43:46 +02:00
Alyssa Ross
b0854238b0 nixos/zfs: fix autoScrub.enable description
This was previously "Whether to enable Enables periodic scrubbing of
ZFS pools.."
2021-04-01 19:19:00 +00:00
oxalica
80a1336bb9 nixos/filesystems: always write mount options for swap devices
According to fstab(5), unlike last two fields `fs_freq` and `fs_passno`,
the 4-th field `fs_mntops` is NOT optional, though it works when omitted.

For best-practice and easier to be parsed by other programs, we should always
write `defaults` as default mount options for swap devices.
2021-03-28 19:54:03 +02:00
Graham Christensen
857c649083
network-interfaces: set hostname from sysctl if defined
The `networking.hostname` option was changed to not permit periods
in names, due to a strict reading of RFC 1123. For users who need
the hostname to be fully qualified, the networking.hostName option
suggests using boot.kernel.sysctl."kernel.hostname" as a workaround.

This option works correctly at boot time, but every "nixos-rebuild
switch" will change the hostname back to the unqualified version.

This commit brings the activation script in line with the
documentation's recommendation.
2021-03-23 11:40:54 -04:00
Hedtke, Moritz
742f3a4369
nixos/zfs: Fix regression that prevents people to boot from zfs using grub if they didn't add zfs to boot.initrd.supportedFilesystems
See https://github.com/NixOS/nixpkgs/pull/99386
2021-03-20 23:57:50 +01:00
Florian Klink
53a0c2878b
Merge pull request #111786 from flokli/systemd-247.3
systemd: 247.2 -> 247.3
2021-02-12 12:52:49 +01:00
Cole Helbling
1ed5b6a285
zfs: disable smartmontools mail functionality 2021-02-06 22:04:00 -08:00
Cole Helbling
370df31f1c
nixos/zfs: make zed mail optional
"zed does not need the ability to send email by default" --Eelco
2021-02-06 22:03:59 -08:00
Florian Klink
24bebfa308 Revert "nixos/network-interfaces-systemd: fix IPv6 privacy extensions"
This reverts commit d349582c07.

The workaround initially applied isn't necessary anymore, as 247.3
contains the following commit:

> 242fc1d261 network: fix IPv6PrivacyExtensions=kernel handling

… which fixes https://github.com/systemd/systemd/issues/18003.
2021-02-03 22:21:19 +01:00
Jörg Thalheim
5b9bfe5625
zfs: fix invalid package references 2021-02-03 11:45:31 +01:00
Jörg Thalheim
0e784a2a3b
nixos/zfs: fix reference to awk
broken in 648a6c4348
2021-02-03 11:43:00 +01:00
Jörg Thalheim
9c6a9d0458
nixos/lxd: refactor to use zfs.package/enabled property 2021-02-01 17:59:18 +01:00
Jörg Thalheim
ed1f13244b
nixos/zfs: expose enabled option 2021-02-01 17:59:18 +01:00
Jörg Thalheim
648a6c4348
nixos/zfs: expose zfs package as readonly attribute 2021-02-01 17:59:14 +01:00
Kevin Cox
969e43e394
Merge pull request #95406 from Mic92/mountpoint-type
nixos/filesystems: don't allow mountpoints with trailing slash
2021-01-31 06:28:02 -05:00
Ben Siraphob
1c2a2b0a08 treewide: fold -> foldr 2021-01-26 10:57:07 +07:00
Florian Klink
b2f3bd4d79
Merge pull request #100155 from primeos/nixos-add-fqdn-option
nixos/networking: Add a read-only option for the FQDN
2021-01-25 16:45:45 +01:00
Jörg Thalheim
76360c005f
nixos/filesystems: don't allow mountpoints with trailing slash
They are semantically the same as the non-slash version and therefore
are potential source of duplicates.

Also fixes https://github.com/NixOS/nixpkgs/issues/78951

Alternative to https://github.com/NixOS/nixpkgs/pull/95308
2021-01-25 11:10:03 +01:00
volth
bc0d605cf1 treewide: fix double quoted strings in meta.description
Signed-off-by: Ben Siraphob <bensiraphob@gmail.com>
2021-01-24 19:56:59 +07:00