Skip to content

Commit 28095d3

Browse files
committed
refactor(hosts): use disko hook-defined $device variable
1 parent 2e838bc commit 28095d3

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

hosts/maia/hardware-configuration.nix

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,12 @@
6060
type = "luks";
6161
name = hostName;
6262
settings.allowDiscards = true;
63-
content = let
64-
this = config.disko.devices.disk.main.content.partitions.luks.content.content;
65-
in {
63+
content = {
6664
type = "btrfs";
6765
extraArgs = [ "-L${hostName}" ];
6866
postCreateHook = ''
6967
MNTPOINT=$(mktemp -d)
70-
mount -t btrfs "${this.device}" "$MNTPOINT"
68+
mount -t btrfs "$device" "$MNTPOINT"
7169
trap 'umount $MNTPOINT; rm -d $MNTPOINT' EXIT
7270
btrfs subvolume snapshot -r $MNTPOINT/root $MNTPOINT/root-blank
7371
'';

hosts/pleione/hardware-configuration.nix

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,12 @@
8080
type = "luks";
8181
name = hostName;
8282
settings.allowDiscards = true;
83-
content = let
84-
this = config.disko.devices.disk.main.content.partitions.luks.content.content;
85-
in {
83+
content = {
8684
type = "btrfs";
8785
extraArgs = [ "-L${hostName}" ];
8886
postCreateHook = ''
8987
MNTPOINT=$(mktemp -d)
90-
mount -t btrfs "${this.device}" "$MNTPOINT"
88+
mount -t btrfs "$device" "$MNTPOINT"
9189
trap 'umount $MNTPOINT; rm -d $MNTPOINT' EXIT
9290
btrfs subvolume snapshot -r $MNTPOINT/root $MNTPOINT/root-blank
9391
'';

hosts/taygeta/hardware-configuration.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
extraArgs = [ "-L${config.networking.hostName}" ];
4444
postCreateHook = ''
4545
MNTPOINT=$(mktemp -d)
46-
mount -t btrfs "${config.disko.devices.disk.main.content.partitions.taygeta.device}" "$MNTPOINT"
46+
mount -t btrfs "$device" "$MNTPOINT"
4747
trap 'umount $MNTPOINT; rm -d $MNTPOINT' EXIT
4848
btrfs subvolume snapshot -r $MNTPOINT/root $MNTPOINT/root-blank
4949
'';

0 commit comments

Comments
 (0)