Compare commits

..
11 Commits
Author SHA1 Message Date
lassulus 9f29cedac7 rename makeDiskImage -> makeDiskImages 2023-09-18 12:16:33 +00:00
lassulus 56e6cad143 module: add images to system.build 2023-09-18 12:16:33 +00:00
Lassulus 10fb975003 Merge pull request #372 from maralorn/patch-1
Fix reference link quickstart.md
2023-09-18 14:11:54 +02:00
maralorn 999f80f315 Fix reference link quickstart.md 2023-09-18 13:05:43 +02:00
github-actions[bot] 7548ad9469 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/1697b7d480449b01111e352021f46e5879e47643' (2023-09-13)
  → 'github:NixOS/nixpkgs/5148520bfab61f99fd25fb9ff7bfbb50dad3c9db' (2023-09-17)
2023-09-18 01:20:28 +00:00
Jörg Thalheim 9ab96378f8 reformat tree 2023-09-17 04:43:25 +00:00
Jörg Thalheim 1be23d771f replace statix with deadnix
statix does sometimes weird stuff while deadnix is even better at finding deadcode
2023-09-17 04:43:25 +00:00
Jörg Thalheim 4ec801c317 add deno to formatters 2023-09-17 04:43:25 +00:00
Jörg Thalheim ea3e29fe7d update command line reference 2023-09-17 04:43:25 +00:00
David Arnold 0faae8adf6 fix: avoid external probing effects from other devices 2023-09-15 20:04:52 +00:00
Rudolf Vesely 8aa6ec5ff2 Changing how to open LUKS. 2023-09-15 07:39:16 +00:00
12 changed files with 27 additions and 20 deletions

No files matched your search

+1 -1
View File
@@ -22,7 +22,7 @@ requirements. If you're not sure which layout to pick, use the
[hybrid](https://github.com/nix-community/disko/blob/master/example/hybrid.nix)
configuration. This layout is compatible with both BIOS and EFI systems.
Refer to the [reference manual](./reference) for more information about the
Refer to the [reference manual](./reference.md) for more information about the
sample layouts and how to build your own configuration.
Once you've chosen your layout, you'll need to make a note of the URL to the raw
Generated
+3 -3
View File
@@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1694593561,
"narHash": "sha256-WSaIQZ5s9N9bDFkEMTw6P9eaZ9bv39ZhsiW12GtTNM0=",
"lastModified": 1694948089,
"narHash": "sha256-d2B282GmQ9o8klc22/Rbbbj6r99EnELQpOQjWMyv0rU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1697b7d480449b01111e352021f46e5879e47643",
"rev": "5148520bfab61f99fd25fb9ff7bfbb50dad3c9db",
"type": "github"
},
"original": {
+6 -6
View File
@@ -11,10 +11,10 @@ let
diskoLib = {
# like make-disk-image.nix from nixpkgs, but with disko config
makeDiskImage = args: (import ./make-disk-image.nix ({ inherit diskoLib; } // args)).pure;
makeDiskImages = args: (import ./make-disk-image.nix ({ inherit diskoLib; } // args)).pure;
# a version of makeDiskImage which runs outside of the store
makeDiskImageScript = args: (import ./make-disk-image.nix ({ inherit diskoLib; } // args)).impure;
makeDiskImagesScript = args: (import ./make-disk-image.nix ({ inherit diskoLib; } // args)).impure;
testLib = import ./tests.nix { inherit lib makeTest eval-config; };
# like lib.types.oneOf but instead of a list takes an attrset
@@ -24,7 +24,7 @@ let
description = "one of ${concatStringsSep "," (attrNames types)}";
check = x: if x ? type then types.${x.type}.check x else throw "No type option set in:\n${generators.toPretty {} x}";
merge = loc: foldl'
(res: def: types.${def.value.type}.merge loc [
(_res: def: types.${def.value.type}.merge loc [
# we add a dummy root parent node to render documentation
(lib.recursiveUpdate { value._module.args = extraArgs; } def)
])
@@ -183,7 +183,7 @@ let
/* Takes a Submodules config and options argument and returns a serializable
subset of config variables as a shell script snippet.
*/
defineHookVariables = { config, options }:
defineHookVariables = { options }:
let
sanitizeName = lib.replaceStrings [ "-" ] [ "_" ];
isAttrsOfSubmodule = o: o.type.name == "attrsOf" && o.type.nestedTypes.elemType.name == "submodule";
@@ -229,7 +229,7 @@ let
type = lib.types.str;
default = ''
( # ${config.type} ${concatMapStringsSep " " (n: toString (config.${n} or "")) ["name" "device" "format" "mountpoint"]} #
${diskoLib.indent (diskoLib.defineHookVariables { inherit config options; })}
${diskoLib.indent (diskoLib.defineHookVariables { inherit options; })}
${config.preCreateHook}
${diskoLib.indent attrs.default}
${config.postCreateHook}
@@ -238,7 +238,7 @@ let
description = "Creation script";
};
mkMountOption = { config, options, default }@attrs:
mkMountOption = { default, ... }@attrs:
lib.mkOption {
internal = true;
readOnly = true;
+1 -1
View File
@@ -19,7 +19,7 @@
imageSize = lib.mkOption {
type = lib.types.strMatching "[0-9]+[KMGTP]?";
description = ''
size of the image if the makeDiskImage function from diksoLib is used.
size of the image if the makeDiskImages function from diksoLib is used.
is used as an argument to truncate -s
'';
default = "2G";
+1 -1
View File
@@ -107,7 +107,7 @@ in
--typecode=${toString partition._index}:${partition.type} \
${config.device}
# ensure /dev/disk/by-path/..-partN exists before continuing
partprobe
partprobe ${config.device}
udevadm trigger --subsystem-match=block
udevadm settle
${lib.optionalString (partition.content != null) partition.content._create}
+1 -1
View File
@@ -114,7 +114,7 @@ in
{
dev = ''
cryptsetup status ${config.name} >/dev/null 2>/dev/null ||
cryptsetup luksOpen ${config.device} ${config.name} \
cryptsetup open ${config.device} ${config.name} \
${keyFileArgs}
${lib.optionalString (config.content != null) contentMount.dev or ""}
'';
+1 -1
View File
@@ -42,7 +42,7 @@
--force \
--homehost=any \
"''${disk_devices[@]}"
partprobe
partprobe /dev/md/${config.name}
udevadm trigger --subsystem-match=block
udevadm settle
# for some reason mdadm devices spawn with an existing partition table, so we need to wipe it
+2 -2
View File
@@ -91,7 +91,7 @@
parted -s ${config.device} -- mkpart ${partition.part-type} ${diskoLib.maybeStr partition.fs-type} ${partition.start} ${partition.end}
''}
# ensure /dev/disk/by-path/..-partN exists before continuing
partprobe
partprobe ${config.device}
udevadm trigger --subsystem-match=block
udevadm settle
${lib.optionalString partition.bootable ''
@@ -101,7 +101,7 @@
parted -s ${config.device} -- set ${toString partition._index} ${flag} on
'') partition.flags}
# ensure further operations can detect new partitions
partprobe
partprobe ${config.device}
udevadm trigger --subsystem-match=block
udevadm settle
${lib.optionalString (partition.content != null) partition.content._create}
+1 -1
View File
@@ -50,7 +50,7 @@
zfs create ${config._parent.name}/${config.name} \
${lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "-o ${n}=${v}") config.options)} \
-V ${config.size}
partprobe
partprobe /dev/zvol/${config._parent.name}/${config.name}
udevadm trigger --subsystem-match=block
udevadm settle
${lib.optionalString (config.content != null) config.content._create}
+8 -1
View File
@@ -1,4 +1,4 @@
{ config, lib, pkgs, extendModules, ... }:
{ config, lib, pkgs, extendModules, ... }@args:
let
diskoLib = import ./lib {
inherit lib;
@@ -71,6 +71,13 @@ in
disko = builtins.trace "the .disko output is deprecated, please use .diskoScript instead" (cfg.devices._scripts pkgs).diskoScript;
diskoNoDeps = builtins.trace "the .diskoNoDeps output is deprecated, please use .diskoScriptNoDeps instead" (cfg.devices._scripts pkgs).diskoScriptNoDeps;
diskoImages = diskoLib.makeDiskImages {
nixosConfig = args;
};
diskoImagesScript = diskoLib.makeDiskImagesScript {
nixosConfig = args;
};
installTest = diskoLib.testLib.makeDiskoTest {
inherit extendModules pkgs;
name = "${config.networking.hostName}-disko";
+1 -1
View File
@@ -1,7 +1,7 @@
{ pkgs ? import <nixpkgs> { }
, diskoLib ? pkgs.callPackage ../lib { }
}:
diskoLib.makeDiskImageScript {
diskoLib.makeDiskImagesScript {
nixosConfig = pkgs.nixos [
../module.nix
../example/simple-efi.nix
+1 -1
View File
@@ -1,7 +1,7 @@
{ pkgs ? import <nixpkgs> { }
, diskoLib ? pkgs.callPackage ../lib { }
}:
diskoLib.makeDiskImage {
diskoLib.makeDiskImages {
nixosConfig = pkgs.nixos [
../module.nix
../example/simple-efi.nix