Commit Graph

101 Commits

Author SHA1 Message Date
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
Attila Oláh
ac4441fabd
Add missing closing parens.
https://xkcd.com/859
2024-03-02 12:40:40 +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
Philip Taron
9c505de9f4
nixos/filesystems: ensure correct ordering w.r.t. shutdown.target 2023-11-30 15:34:11 -08:00
Nick Cao
37cac5f032
nixos/stage-1-systemd: makeFstabEntries: drop rootPrefix parameter 2023-09-27 18:31:56 -04:00
Nick Cao
0fecd7edc8
nixos/stage-1-systemd: fix initrd-fstab generation for bind mounts, again
See https://github.com/NixOS/nixpkgs/pull/185089
2023-09-27 14:34:17 -04:00
Will Fancher
b497502357 nixos: Use systemd-growfs for autoResize 2023-06-04 22:57:22 -04:00
Will Fancher
5176a4f113 nixos: Use systemd-makefs for autoFormat 2023-06-04 22:57:20 -04:00
Matthias Berndt
92814241a8 improve stratis initrd support
it is now possible to supply a stratis pool uuid
for every filesystem, and if that filesystem
is required for boot, the relevant pool will be
started in the initramfs.
2023-05-16 22:48:36 -04:00
Felix Buehler
327b0cff7a treewide: use more lib.optionalString 2023-04-07 13:38:33 +02: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
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
Vladimír Čunát
cdad0ce127
nixos/filesystems: fix a typo in docs 2022-11-27 21:57:35 +01: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
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
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
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
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
Lily Foster
69d7943101 nixos/systemd-stage-1: unify initrd fstab generation logic with system fstab 2022-08-18 13:33:43 -04: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
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
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
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
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
Luflosi
26a695399a
nixos/apfs: init
Add the final missing pieces for full APFS support.
2022-01-27 15:18:45 +01:00
Naïm Favier
2ddc335e6f
nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02: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
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
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
Artturin
c971de97c4 nixos/swap: add options option 2021-07-20 20:51:27 +03: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
hyperfekt
870fa77ff6 nixos/filesystems: mount persistent storage to /sys/fs/pstore 2021-05-09 23:21:32 +02: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
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
Matthieu Coudron
3562533edc filesystems: add syntax to /etc/fstab header
ubuntu displays it and it helps in case you forgot the syntax and dont want to consult the man
2020-12-03 12:40:03 +01:00
Graham Christensen
bc49a0815a
utillinux: rename to util-linux 2020-11-24 12:42:06 -05:00
rnhmjoj
20d491a317
treewide: completely remove types.loaOf 2020-09-02 00:42:50 +02:00