Unverified Commit cc11eea7 authored by Ryan Lahfa's avatar Ryan Lahfa Committed by GitHub
Browse files

Merge pull request #195671 from amarshall/rename-readonlystore

nixos: nix.readOnlyStore -> boot.readOnlyNixStore
parents 6654c1d5 c88944f0
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -78,6 +78,13 @@
          relying on this should provide their own implementation.
        </para>
      </listitem>
      <listitem>
        <para>
          The <literal>nix.readOnlyStore</literal> option has been
          renamed to <literal>boot.readOnlyNixStore</literal> to clarify
          that it configures the NixOS boot process, not the Nix daemon.
        </para>
      </listitem>
    </itemizedlist>
  </section>
  <section xml:id="sec-release-23.05-notable-changes">
+2 −0
Original line number Diff line number Diff line
@@ -29,6 +29,8 @@ In addition to numerous new and upgraded packages, this release has the followin

- The EC2 image module previously detected and activated swap-formatted instance store devices and partitions in stage-1 (initramfs). This behaviour has been removed. Users relying on this should provide their own implementation.

- The `nix.readOnlyStore` option has been renamed to `boot.readOnlyNixStore` to clarify that it configures the NixOS boot process, not the Nix daemon.

## Other Notable Changes {#sec-release-23.05-notable-changes}

<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
+1 −11
Original line number Diff line number Diff line
@@ -115,6 +115,7 @@ in
    (mkRenamedOptionModuleWith { sinceRelease = 2003; from = [ "nix" "useChroot" ]; to = [ "nix" "useSandbox" ]; })
    (mkRenamedOptionModuleWith { sinceRelease = 2003; from = [ "nix" "chrootDirs" ]; to = [ "nix" "sandboxPaths" ]; })
    (mkRenamedOptionModuleWith { sinceRelease = 2205; from = [ "nix" "daemonIONiceLevel" ]; to = [ "nix" "daemonIOSchedPriority" ]; })
    (mkRenamedOptionModuleWith { sinceRelease = 2211; from = [ "nix" "readOnlyStore" ]; to = [ "boot" "readOnlyNixStore" ]; })
    (mkRemovedOptionModule [ "nix" "daemonNiceLevel" ] "Consider nix.daemonCPUSchedPolicy instead.")
  ] ++ mapAttrsToList (oldConf: newConf: mkRenamedOptionModuleWith { sinceRelease = 2205; from = [ "nix" oldConf ]; to = [ "nix" "settings" newConf ]; }) legacyConfMappings;

@@ -366,17 +367,6 @@ in
        '';
      };

      readOnlyStore = mkOption {
        type = types.bool;
        default = true;
        description = lib.mdDoc ''
          If set, NixOS will enforce the immutability of the Nix store
          by making {file}`/nix/store` a read-only bind
          mount.  Nix will automatically make the store writable when
          needed.
        '';
      };

      nixPath = mkOption {
        type = types.listOf types.str;
        default = [
+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ fi
# like squashfs.
chown -f 0:30000 /nix/store
chmod -f 1775 /nix/store
if [ -n "@readOnlyStore@" ]; then
if [ -n "@readOnlyNixStore@" ]; then
    if ! [[ "$(findmnt --noheadings --output OPTIONS /nix/store)" =~ ro(,|$) ]]; then
        if [ -z "$container" ]; then
            mount --bind /nix/store /nix/store
+12 −2
Original line number Diff line number Diff line
@@ -10,9 +10,8 @@ let
    src = ./stage-2-init.sh;
    shellDebug = "${pkgs.bashInteractive}/bin/bash";
    shell = "${pkgs.bash}/bin/bash";
    inherit (config.boot) systemdExecutable extraSystemdUnitPaths;
    inherit (config.boot) readOnlyNixStore systemdExecutable extraSystemdUnitPaths;
    isExecutable = true;
    inherit (config.nix) readOnlyStore;
    inherit useHostResolvConf;
    inherit (config.system.build) earlyMountScript;
    path = lib.makeBinPath ([
@@ -42,6 +41,17 @@ in
        '';
      };

      readOnlyNixStore = mkOption {
        type = types.bool;
        default = true;
        description = lib.mdDoc ''
          If set, NixOS will enforce the immutability of the Nix store
          by making {file}`/nix/store` a read-only bind
          mount.  Nix will automatically make the store writable when
          needed.
        '';
      };

      systemdExecutable = mkOption {
        default = "/run/current-system/systemd/lib/systemd/systemd";
        type = types.str;