mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
nixos/filesystems: Remove default = "auto" from fsType
NixOS has traditionally enabled the `ext` family of file systems by default. Originally, when switching to systemd initrd, we wanted to transition to making this explicit so that initrds could be made without `ext`. The problem is that anyone with `fsType = "auto";` for an `ext` file system in initrd will fail to boot, which is not really an acceptable regression as we switch to systemd initrd by default. By removing `default = "auto"` from `fsType`, we rule out the vast majority of these regressions as eval errors, since most users of `fsType = "auto"` for ext file systems are using it because of the default value. In hindsight, this is probably what #225352 was really about.
This commit is contained in:
parent
6201e203d0
commit
f8ed5f30c0
18 changed files with 48 additions and 10 deletions
|
|
@ -144,6 +144,7 @@
|
||||||
nixpkgs.hostPlatform = "x86_64-linux";
|
nixpkgs.hostPlatform = "x86_64-linux";
|
||||||
boot.loader.grub.enable = false;
|
boot.loader.grub.enable = false;
|
||||||
fileSystems."/".device = "nodev";
|
fileSystems."/".device = "nodev";
|
||||||
|
fileSystems."/".fsType = "none";
|
||||||
# See https://search.nixos.org/options?show=system.stateVersion&query=stateversion
|
# See https://search.nixos.org/options?show=system.stateVersion&query=stateversion
|
||||||
system.stateVersion = lib.trivial.release; # DON'T do this in real configs!
|
system.stateVersion = lib.trivial.release; # DON'T do this in real configs!
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -135,6 +135,8 @@
|
||||||
|
|
||||||
- The packages `iw` and `wirelesstools` (`iwconfig`, `iwlist`, etc.) are no longer installed implicitly if wireless networking has been enabled.
|
- The packages `iw` and `wirelesstools` (`iwconfig`, `iwlist`, etc.) are no longer installed implicitly if wireless networking has been enabled.
|
||||||
|
|
||||||
|
- The `fileSystems.<name>.fsType` option no longer has a default value and must be specified by the user. The value `"auto"` still works as before, though its use is generally discouraged.
|
||||||
|
|
||||||
- `services.uptime` has been removed because the package it relies on does not exist anymore in nixpkgs.
|
- `services.uptime` has been removed because the package it relies on does not exist anymore in nixpkgs.
|
||||||
|
|
||||||
- `services.kubernetes.addons.dns.coredns` has been renamed to `services.kubernetes.addons.dns.corednsImage` and now expects a
|
- `services.kubernetes.addons.dns.coredns` has been renamed to `services.kubernetes.addons.dns.corednsImage` and now expects a
|
||||||
|
|
|
||||||
|
|
@ -796,6 +796,7 @@ in
|
||||||
"/dev/disk/by-label/${config.isoImage.volumeID}"
|
"/dev/disk/by-label/${config.isoImage.volumeID}"
|
||||||
else
|
else
|
||||||
"/dev/root";
|
"/dev/root";
|
||||||
|
fsType = "iso9660";
|
||||||
neededForBoot = true;
|
neededForBoot = true;
|
||||||
noCheck = true;
|
noCheck = true;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,10 @@ let
|
||||||
text = "${expect.dev}";
|
text = "${expect.dev}";
|
||||||
};
|
};
|
||||||
documentation.enable = false;
|
documentation.enable = false;
|
||||||
fileSystems."/".device = "ignore-root-device";
|
fileSystems."/" = {
|
||||||
|
device = "ignore-root-device";
|
||||||
|
fsType = "none";
|
||||||
|
};
|
||||||
boot.loader.grub.enable = false;
|
boot.loader.grub.enable = false;
|
||||||
|
|
||||||
# Don't do this in an actual config
|
# Don't do this in an actual config
|
||||||
|
|
@ -26,7 +29,10 @@ let
|
||||||
system.forbiddenDependenciesRegexes = [ "-dev$" ];
|
system.forbiddenDependenciesRegexes = [ "-dev$" ];
|
||||||
system.extraDependencies = [ expect.dev ];
|
system.extraDependencies = [ expect.dev ];
|
||||||
documentation.enable = false;
|
documentation.enable = false;
|
||||||
fileSystems."/".device = "ignore-root-device";
|
fileSystems."/" = {
|
||||||
|
device = "ignore-root-device";
|
||||||
|
fsType = "none";
|
||||||
|
};
|
||||||
boot.loader.grub.enable = false;
|
boot.loader.grub.enable = false;
|
||||||
|
|
||||||
# Don't do this in an actual config
|
# Don't do this in an actual config
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,10 @@ let
|
||||||
|
|
||||||
# irrelevant stuff
|
# irrelevant stuff
|
||||||
system.stateVersion = "25.05";
|
system.stateVersion = "25.05";
|
||||||
fileSystems."/".device = "/test/dummy";
|
fileSystems."/" = {
|
||||||
|
device = "/test/dummy";
|
||||||
|
fsType = "auto";
|
||||||
|
};
|
||||||
boot.loader.grub.enable = false;
|
boot.loader.grub.enable = false;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,6 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
fsType = mkOption {
|
fsType = mkOption {
|
||||||
default = "auto";
|
|
||||||
example = "ext3";
|
example = "ext3";
|
||||||
type = nonEmptyStr;
|
type = nonEmptyStr;
|
||||||
description = ''
|
description = ''
|
||||||
|
|
|
||||||
|
|
@ -1453,6 +1453,7 @@ in
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
device = "/nix/.ro-store";
|
device = "/nix/.ro-store";
|
||||||
|
fsType = "none";
|
||||||
options = [ "bind" ];
|
options = [ "bind" ];
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -172,6 +172,7 @@ let
|
||||||
{ ... }:
|
{ ... }:
|
||||||
{
|
{
|
||||||
fileSystems."/".device = mkDefault "/dev/sda1";
|
fileSystems."/".device = mkDefault "/dev/sda1";
|
||||||
|
fileSystems."/".fsType = mkDefault "auto";
|
||||||
boot.loader.grub.device = mkDefault "/dev/sda";
|
boot.loader.grub.device = mkDefault "/dev/sda";
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
@ -476,7 +477,10 @@ rec {
|
||||||
modules = singleton (
|
modules = singleton (
|
||||||
{ ... }:
|
{ ... }:
|
||||||
{
|
{
|
||||||
fileSystems."/".device = mkDefault "/dev/sda1";
|
fileSystems."/" = {
|
||||||
|
device = mkDefault "/dev/sda1";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
boot.loader.grub.device = mkDefault "/dev/sda";
|
boot.loader.grub.device = mkDefault "/dev/sda";
|
||||||
system.stateVersion = mkDefault lib.trivial.release;
|
system.stateVersion = mkDefault lib.trivial.release;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@
|
||||||
# bind-mount the store
|
# bind-mount the store
|
||||||
"/nix/store" = {
|
"/nix/store" = {
|
||||||
device = "/usr/nix/store";
|
device = "/usr/nix/store";
|
||||||
|
fsType = "none";
|
||||||
options = [ "bind" ];
|
options = [ "bind" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
nodes.machine = {
|
nodes.machine = {
|
||||||
virtualisation.fileSystems."/var" = {
|
virtualisation.fileSystems."/var" = {
|
||||||
|
fsType = "none";
|
||||||
options = [
|
options = [
|
||||||
"bind"
|
"bind"
|
||||||
"nosuid"
|
"nosuid"
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ let
|
||||||
|
|
||||||
fileSystems = {
|
fileSystems = {
|
||||||
"/".device = rootFsDevice;
|
"/".device = rootFsDevice;
|
||||||
|
"/".fsType = "ext4";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Needed for installing bootloader
|
# Needed for installing bootloader
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,10 @@ let
|
||||||
../modules/testing/test-instrumentation.nix
|
../modules/testing/test-instrumentation.nix
|
||||||
../modules/profiles/qemu-guest.nix
|
../modules/profiles/qemu-guest.nix
|
||||||
{
|
{
|
||||||
fileSystems."/".device = "/dev/disk/by-label/nixos";
|
fileSystems."/" = {
|
||||||
|
device = "/dev/disk/by-label/nixos";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
boot.loader.grub.device = "/dev/vda";
|
boot.loader.grub.device = "/dev/vda";
|
||||||
boot.loader.timeout = 0;
|
boot.loader.timeout = 0;
|
||||||
nixpkgs.pkgs = pkgs;
|
nixpkgs.pkgs = pkgs;
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ with pkgs.lib;
|
||||||
virtualisation.fileSystems."/test-bind-dir/bind" = {
|
virtualisation.fileSystems."/test-bind-dir/bind" = {
|
||||||
device = "/";
|
device = "/";
|
||||||
neededForBoot = true;
|
neededForBoot = true;
|
||||||
|
fsType = "none";
|
||||||
options = [ "bind" ];
|
options = [ "bind" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -25,6 +26,7 @@ with pkgs.lib;
|
||||||
depends = [ "/nix/store" ];
|
depends = [ "/nix/store" ];
|
||||||
device = builtins.toFile "empty" "";
|
device = builtins.toFile "empty" "";
|
||||||
neededForBoot = true;
|
neededForBoot = true;
|
||||||
|
fsType = "none";
|
||||||
options = [ "bind" ];
|
options = [ "bind" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ let
|
||||||
|
|
||||||
fileSystems = {
|
fileSystems = {
|
||||||
"/".device = rootFsDevice;
|
"/".device = rootFsDevice;
|
||||||
|
"/".fsType = "ext4";
|
||||||
};
|
};
|
||||||
|
|
||||||
system.switch.enable = true;
|
system.switch.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,10 @@
|
||||||
};
|
};
|
||||||
virtualisation.rootDevice = "/dev/mapper/cryptroot";
|
virtualisation.rootDevice = "/dev/mapper/cryptroot";
|
||||||
# test mounting device unlocked in initrd after switching root
|
# test mounting device unlocked in initrd after switching root
|
||||||
virtualisation.fileSystems."/cryptroot2".device = "/dev/mapper/cryptroot2";
|
virtualisation.fileSystems."/cryptroot2" = {
|
||||||
|
device = "/dev/mapper/cryptroot2";
|
||||||
|
fsType = "auto";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,10 @@ in
|
||||||
virtualisation.rootDevice = "/dev/mapper/cryptroot";
|
virtualisation.rootDevice = "/dev/mapper/cryptroot";
|
||||||
virtualisation.fileSystems."/".autoFormat = true;
|
virtualisation.fileSystems."/".autoFormat = true;
|
||||||
# test mounting device unlocked in initrd after switching root
|
# test mounting device unlocked in initrd after switching root
|
||||||
virtualisation.fileSystems."/cryptroot2".device = "/dev/mapper/cryptroot2";
|
virtualisation.fileSystems."/cryptroot2" = {
|
||||||
|
device = "/dev/mapper/cryptroot2";
|
||||||
|
fsType = "auto";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,10 @@ let
|
||||||
modules = [
|
modules = [
|
||||||
{
|
{
|
||||||
system.stateVersion = "25.05";
|
system.stateVersion = "25.05";
|
||||||
fileSystems."/".device = "/dev/null";
|
fileSystems."/" = {
|
||||||
|
device = "/dev/null";
|
||||||
|
fsType = "none";
|
||||||
|
};
|
||||||
boot.loader.grub.device = "nodev";
|
boot.loader.grub.device = "nodev";
|
||||||
nixpkgs.hostPlatform = pkgs.stdenv.hostPlatform.system;
|
nixpkgs.hostPlatform = pkgs.stdenv.hostPlatform.system;
|
||||||
virtualisation.vmVariant.networking.hostName = "vm";
|
virtualisation.vmVariant.networking.hostName = "vm";
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,10 @@ lib.optionalAttrs (stdenv.hostPlatform.isLinux) (
|
||||||
(pkgs.nixos {
|
(pkgs.nixos {
|
||||||
system.nixos = dummyVersioning;
|
system.nixos = dummyVersioning;
|
||||||
boot.loader.grub.enable = false;
|
boot.loader.grub.enable = false;
|
||||||
fileSystems."/".device = "/dev/null";
|
fileSystems."/" = {
|
||||||
|
device = "/dev/null";
|
||||||
|
fsType = "none";
|
||||||
|
};
|
||||||
system.stateVersion = lib.trivial.release;
|
system.stateVersion = lib.trivial.release;
|
||||||
}).toplevel;
|
}).toplevel;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue