temp
This commit is contained in:
@@ -17,6 +17,8 @@ in
|
||||
|
||||
enableSwap = mkBoolOpt false "Enable swap";
|
||||
|
||||
enableLuks = mkBoolOpt false "Enable Luks";
|
||||
|
||||
swapSize = mkOpt types.str "16G" "size of swap part";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -56,6 +56,62 @@ let
|
||||
};
|
||||
};
|
||||
|
||||
# BTRFS root partition configuration
|
||||
encBtrfsRoot = {
|
||||
name = "cryptroot";
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "luks";
|
||||
name = "cryptroot";
|
||||
extraOpenArgs = [
|
||||
"--allow-discards"
|
||||
"--perf-no_read_workqueue"
|
||||
"--perf-no_write_workqueue"
|
||||
];
|
||||
settings = {crypttabExtraOpts = ["fido2-device=auto" "token-timeout=10"];};
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = [ "-f" ]; # Override existing partition
|
||||
# Subvolumes must set a mountpoint in order to be mounted,
|
||||
# unless their parent is mounted
|
||||
subvolumes = {
|
||||
"home" = {
|
||||
mountOptions = [ "compress=zstd" ];
|
||||
mountpoint = "/home";
|
||||
};
|
||||
"root" = {
|
||||
mountOptions = [
|
||||
"compress=zstd"
|
||||
"noatime"
|
||||
];
|
||||
mountpoint = "/root";
|
||||
};
|
||||
"nix" = {
|
||||
mountOptions = [
|
||||
"compress=zstd"
|
||||
"noatime"
|
||||
];
|
||||
mountpoint = "/nix";
|
||||
};
|
||||
"etc" = {
|
||||
mountOptions = [
|
||||
"compress=zstd"
|
||||
"noatime"
|
||||
];
|
||||
mountpoint = "/etc";
|
||||
};
|
||||
"log" = {
|
||||
mountOptions = [
|
||||
"compress=zstd"
|
||||
"noatime"
|
||||
];
|
||||
mountpoint = "/var/log";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# BCacheFS root partition configuration
|
||||
bcachefsRoot = {
|
||||
name = "bcachefs-root";
|
||||
@@ -108,7 +164,7 @@ in
|
||||
size = cfg.swapSize;
|
||||
};
|
||||
|
||||
root = if cfg.filesystem == "btrfs" then btrfsRoot else bcachefsRoot;
|
||||
root = if cfg.filesystem == "btrfs" then ( if cfg.enableLuks then encBtrfsRoot else btrfsRoot) else bcachefsRoot;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user