mirror of
https://github.com/TECHNOFAB11/disko.git
synced 2025-12-12 08:00:05 +01:00
Merge branch 'master' into bcachefs-fixes
This commit is contained in:
commit
a5944cd574
8 changed files with 19 additions and 15 deletions
2
disko
2
disko
|
|
@ -72,7 +72,7 @@ while [[ $# -gt 0 ]]; do
|
|||
dry_run=y
|
||||
;;
|
||||
--root-mountpoint)
|
||||
nix_args+=(--arg rootMountPoint "$2")
|
||||
nix_args+=(--argstr rootMountPoint "$2")
|
||||
shift
|
||||
;;
|
||||
--no-deps)
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
type = "luks";
|
||||
name = "crypted1";
|
||||
keyFile = "/tmp/secret.key";
|
||||
extraArgs = [
|
||||
extraFormatArgs = [
|
||||
"--iter-time 1"
|
||||
];
|
||||
content = {
|
||||
|
|
@ -67,7 +67,7 @@
|
|||
type = "luks";
|
||||
name = "crypted2";
|
||||
keyFile = "/tmp/secret.key";
|
||||
extraArgs = [
|
||||
extraFormatArgs = [
|
||||
"--iter-time 1"
|
||||
];
|
||||
content = {
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
content = {
|
||||
type = "luks";
|
||||
name = "crypted";
|
||||
extraOpenArgs = [ "--allow-discards" ];
|
||||
keyFile = "/tmp/secret.key";
|
||||
content = {
|
||||
type = "lvm_pv";
|
||||
|
|
|
|||
6
flake.lock
generated
6
flake.lock
generated
|
|
@ -2,11 +2,11 @@
|
|||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1678594102,
|
||||
"narHash": "sha256-OHAHYiMWJFPNxuW/PcOMlSD2tvXnEYC1jxREBADHwwQ=",
|
||||
"lastModified": 1679410443,
|
||||
"narHash": "sha256-xDHO/jixWD+y5pmW5+2q4Z4O/I/nA4MAa30svnZKK+M=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "796b4a3c1d903c4b9270cd2548fe46f524eeb886",
|
||||
"rev": "c9ece0059f42e0ab53ac870104ca4049df41b133",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ buildLinux (args // {
|
|||
src = fetchFromGitHub {
|
||||
owner = "koverstreet";
|
||||
repo = "bcachefs";
|
||||
|
||||
rev = "169b584fb4c8e51aa36e4b3284f9e2e5ce6f30e4";
|
||||
sha256 = "sha256-dHKyh5sI+uZ+lSQQRIuicW9ae6uFaJosLtUbiJuMMrI=";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -15,10 +15,16 @@
|
|||
default = null;
|
||||
description = "Path to the key for encryption";
|
||||
};
|
||||
extraArgs = lib.mkOption {
|
||||
extraFormatArgs = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
description = "Extra arguments";
|
||||
description = "Extra arguments to pass to `cryptsetup luksFormat` when formatting";
|
||||
};
|
||||
extraOpenArgs = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
description = "Extra arguments to pass to `cryptsetup luksOpen` when opening";
|
||||
example = [ "--allow-discards" ];
|
||||
};
|
||||
content = diskoLib.deviceType;
|
||||
_meta = lib.mkOption {
|
||||
|
|
@ -32,8 +38,8 @@
|
|||
_create = diskoLib.mkCreateOption {
|
||||
inherit config options;
|
||||
default = { dev }: ''
|
||||
cryptsetup -q luksFormat ${dev} ${diskoLib.maybeStr config.keyFile} ${toString config.extraArgs}
|
||||
cryptsetup luksOpen ${dev} ${config.name} ${lib.optionalString (config.keyFile != null) "--key-file ${config.keyFile}"}
|
||||
cryptsetup -q luksFormat ${dev} ${diskoLib.maybeStr config.keyFile} ${toString config.extraFormatArgs}
|
||||
cryptsetup luksOpen ${dev} ${config.name} ${toString config.extraOpenArgs} ${lib.optionalString (config.keyFile != null) "--key-file ${config.keyFile}"}
|
||||
${lib.optionalString (config.content != null) (config.content._create {dev = "/dev/mapper/${config.name}";})}
|
||||
'';
|
||||
};
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
vgchange -a y
|
||||
${lib.concatMapStrings (x: x.dev or "") (lib.attrValues lvMounts)}
|
||||
'';
|
||||
fs = lvMounts.fs;
|
||||
fs = lvMounts.fs or { };
|
||||
};
|
||||
};
|
||||
_config = lib.mkOption {
|
||||
|
|
|
|||
|
|
@ -38,9 +38,7 @@
|
|||
partMounts = diskoLib.deepMergeMap (partition: partition._mount { inherit dev; }) config.partitions;
|
||||
in
|
||||
{
|
||||
dev = ''
|
||||
${lib.concatMapStrings (x: x.dev or "") (lib.attrValues partMounts)}
|
||||
'';
|
||||
dev = partMounts.dev or "";
|
||||
fs = partMounts.fs or { };
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue