···133133 which will be used by the boot partition.
134134135135 ```ShellSession
136136- # parted /dev/sda -- mkpart primary 512MiB -8GiB
136136+ # parted /dev/sda -- mkpart primary 512MB -8GB
137137 ```
1381381391393. Next, add a *swap* partition. The size required will vary according
140140- to needs, here a 8GiB one is created.
140140+ to needs, here a 8GB one is created.
141141142142 ```ShellSession
143143- # parted /dev/sda -- mkpart primary linux-swap -8GiB 100%
143143+ # parted /dev/sda -- mkpart primary linux-swap -8GB 100%
144144 ```
145145146146 ::: {.note}
···153153 reserved 512MiB at the start of the disk.
154154155155 ```ShellSession
156156- # parted /dev/sda -- mkpart ESP fat32 1MiB 512MiB
156156+ # parted /dev/sda -- mkpart ESP fat32 1MB 512MB
157157 # parted /dev/sda -- set 3 esp on
158158 ```
159159···180180 end part, where the swap will live.
181181182182 ```ShellSession
183183- # parted /dev/sda -- mkpart primary 1MiB -8GiB
183183+ # parted /dev/sda -- mkpart primary 1MB -8GB
184184 ```
1851851861863. Finally, add a *swap* partition. The size required will vary
187187 according to needs, here a 8GiB one is created.
188188189189 ```ShellSession
190190- # parted /dev/sda -- mkpart primary linux-swap -8GiB 100%
190190+ # parted /dev/sda -- mkpart primary linux-swap -8GB 100%
191191 ```
192192193193 ::: {.note}
+18-16
nixos/modules/services/backup/syncoid.nix
···1616 lib.concatMapStrings (s: if lib.isList s then "-" else s)
1717 (builtins.split "[^a-zA-Z0-9_.\\-]+" name);
18181919- # Function to build "zfs allow" commands for the filesystems we've
2020- # delegated permissions to. It also checks if the target dataset
2121- # exists before delegating permissions, if it doesn't exist we
2222- # delegate it to the parent dataset. This should solve the case of
2323- # provisoning new datasets.
1919+ # Function to build "zfs allow" commands for the filesystems we've delegated
2020+ # permissions to. It also checks if the target dataset exists before
2121+ # delegating permissions, if it doesn't exist we delegate it to the parent
2222+ # dataset (if it exists). This should solve the case of provisoning new
2323+ # datasets.
2424 buildAllowCommand = permissions: dataset: (
2525 "-+${pkgs.writeShellScript "zfs-allow-${dataset}" ''
2626 # Here we explicitly use the booted system to guarantee the stable API needed by ZFS
···3838 (concatStringsSep "," permissions)
3939 dataset
4040 ]}
4141- else
4242- ${lib.escapeShellArgs [
4343- "/run/booted-system/sw/bin/zfs"
4444- "allow"
4545- cfg.user
4646- (concatStringsSep "," permissions)
4747- # Remove the last part of the path
4848- (builtins.dirOf dataset)
4949- ]}
4141+ ${lib.optionalString ((builtins.dirOf dataset) != ".") ''
4242+ else
4343+ ${lib.escapeShellArgs [
4444+ "/run/booted-system/sw/bin/zfs"
4545+ "allow"
4646+ cfg.user
4747+ (concatStringsSep "," permissions)
4848+ # Remove the last part of the path
4949+ (builtins.dirOf dataset)
5050+ ]}
5151+ ''}
5052 fi
5153 ''}"
5254 );
···6769 (concatStringsSep "," permissions)
6870 dataset
6971 ]}
7070- ${lib.escapeShellArgs [
7272+ ${lib.optionalString ((builtins.dirOf dataset) != ".") (lib.escapeShellArgs [
7173 "/run/booted-system/sw/bin/zfs"
7274 "unallow"
7375 cfg.user
7476 (concatStringsSep "," permissions)
7577 # Remove the last part of the path
7678 (builtins.dirOf dataset)
7777- ]}
7979+ ])}
7880 ''}"
7981 );
8082in
+10-5
nixos/modules/services/security/vault.nix
···104104105105 storagePath = mkOption {
106106 type = types.nullOr types.path;
107107- default = if cfg.storageBackend == "file" then "/var/lib/vault" else null;
107107+ default = if cfg.storageBackend == "file" || cfg.storageBackend == "raft" then "/var/lib/vault" else null;
108108 defaultText = literalExpression ''
109109- if config.${opt.storageBackend} == "file"
109109+ if config.${opt.storageBackend} == "file" || cfg.storageBackend == "raft"
110110 then "/var/lib/vault"
111111 else null
112112 '';
···172172173173 config = mkIf cfg.enable {
174174 assertions = [
175175- { assertion = cfg.storageBackend == "inmem" -> (cfg.storagePath == null && cfg.storageConfig == null);
175175+ {
176176+ assertion = cfg.storageBackend == "inmem" -> (cfg.storagePath == null && cfg.storageConfig == null);
176177 message = ''The "inmem" storage expects no services.vault.storagePath nor services.vault.storageConfig'';
177178 }
178178- { assertion = (cfg.storageBackend == "file" -> (cfg.storagePath != null && cfg.storageConfig == null)) && (cfg.storagePath != null -> cfg.storageBackend == "file");
179179- message = ''You must set services.vault.storagePath only when using the "file" backend'';
179179+ {
180180+ assertion = (
181181+ (cfg.storageBackend == "file" -> (cfg.storagePath != null && cfg.storageConfig == null)) &&
182182+ (cfg.storagePath != null -> (cfg.storageBackend == "file" || cfg.storageBackend == "raft"))
183183+ );
184184+ message = ''You must set services.vault.storagePath only when using the "file" or "raft" backend'';
180185 }
181186 ];
182187
+6
nixos/tests/sanoid.nix
···4848 };
4949 # Take snapshot and sync
5050 "pool/syncoid".target = "root@target:pool/syncoid";
5151+5252+ # Test pool without parent (regression test for https://github.com/NixOS/nixpkgs/pull/180111)
5353+ "pool".target = "root@target:pool/full-pool";
5154 };
5255 };
5356 };
···104107 target.succeed("cat /mnt/pool/sanoid/test.txt")
105108 source.systemctl("start --wait syncoid-pool-syncoid.service")
106109 target.succeed("cat /mnt/pool/syncoid/test.txt")
110110+111111+ source.systemctl("start --wait syncoid-pool.service")
112112+ target.succeed("[[ -d /mnt/pool/full-pool/syncoid ]]")
107113108114 assert len(source.succeed("zfs allow pool")) == 0, "Pool shouldn't have delegated permissions set after syncing snapshots"
109115 assert len(source.succeed("zfs allow pool/sanoid")) == 0, "Sanoid dataset shouldn't have delegated permissions set after syncing snapshots"