Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Commit

Permalink
feat(linux): hdd desktop luks (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
storopoli authored Mar 27, 2024
1 parent 8d436af commit a23e2c9
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
30 changes: 29 additions & 1 deletion linux/filesystem/desktop/disko.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ config, disks ? [ "/dev/nvme0n1" ], ... }:
{ config, disks ? [ "/dev/nvme0n1" "/dev/sda1" ], ... }:

{
disko.devices = {
Expand Down Expand Up @@ -40,7 +40,35 @@
};
};
};

sda1 = {
device = builtins.elemAt disks 1;
type = "disk";
content = {
type = "gpt";
partitions = {
luks = {
size = "100%";
content = {
type = "luks";
name = "hdd";
settings = {
allowDiscards = true;
keyFile = "/etc/hdd_luks.key";
};
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/hdd";
mountOptions = [ "noatime" ];
};
};
};
};
};
};
};

nodev = {
"/" = {
fsType = "tmpfs";
Expand Down
7 changes: 7 additions & 0 deletions linux/filesystem/desktop/filesystem.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,12 @@
options = [ "bind" ];
};

# HDD 4TB
fileSystems."/hdd" = {
device = "/dev/mapper/hdd";
fsType = "ext4";
options = [ "defaults" "noatime" ];
};

swapDevices = [ ];
}
1 change: 1 addition & 0 deletions linux/impermanence.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

files = [
"/etc/machine-id"
"/etc/hdd_luks.key"
"/var/lib/NetworkManager/NetworkManager.state"
"/var/lib/NetworkManager/secret_key"
"/var/lib/NetworkManager/seen-bssids"
Expand Down

0 comments on commit a23e2c9

Please sign in to comment.