user updates
This commit is contained in:
@@ -9,7 +9,7 @@ let
|
||||
cfg = config.${namespace}.hardware.disko;
|
||||
isArm = builtins.match "aarch64*" system != null;
|
||||
rootDisk = "/dev/nvme0n1";
|
||||
|
||||
|
||||
# BTRFS root partition configuration
|
||||
btrfsRoot = {
|
||||
name = "btrfs-root";
|
||||
@@ -55,7 +55,7 @@ let
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
# BCacheFS root partition configuration
|
||||
bcachefsRoot = {
|
||||
size = "100%";
|
||||
|
||||
@@ -4,7 +4,10 @@ with lib;
|
||||
options.${namespace}.hardware.disko = {
|
||||
enable = mkEnableOption "enable disko";
|
||||
filesystem = mkOption {
|
||||
type = types.enum [ "bcachefs" "btrfs" ];
|
||||
type = types.enum [
|
||||
"bcachefs"
|
||||
"btrfs"
|
||||
];
|
||||
default = "btrfs";
|
||||
description = "Filesystem to use for the root partition";
|
||||
};
|
||||
|
||||
@@ -9,7 +9,7 @@ let
|
||||
cfg = config.${namespace}.hardware.disko;
|
||||
isArm = builtins.match "aarch64*" system != null;
|
||||
rootDisk = "/dev/nvme0n1";
|
||||
|
||||
|
||||
# BTRFS root partition configuration
|
||||
btrfsRoot = {
|
||||
name = "btrfs-root";
|
||||
@@ -55,7 +55,7 @@ let
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
# BCacheFS root partition configuration
|
||||
bcachefsRoot = {
|
||||
size = "100%";
|
||||
@@ -75,68 +75,68 @@ in
|
||||
config = lib.mkIf (!isArm && cfg.enable) {
|
||||
disko.devices = lib.mkMerge [
|
||||
{
|
||||
disk = {
|
||||
main = {
|
||||
device = rootDisk;
|
||||
type = "disk";
|
||||
imageSize = "32G";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = {
|
||||
type = "EF00";
|
||||
size = "100M";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [ "umask=0077" ];
|
||||
disk = {
|
||||
main = {
|
||||
device = rootDisk;
|
||||
type = "disk";
|
||||
imageSize = "32G";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = {
|
||||
type = "EF00";
|
||||
size = "100M";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [ "umask=0077" ];
|
||||
};
|
||||
};
|
||||
|
||||
root = if cfg.filesystem == "btrfs" then btrfsRoot else bcachefsRoot;
|
||||
};
|
||||
|
||||
root = if cfg.filesystem == "btrfs" then btrfsRoot else bcachefsRoot;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
bcachefs_filesystems = lib.mkIf (cfg.filesystem == "bcachefs") {
|
||||
mounted_subvolumes_in_multi = {
|
||||
type = "bcachefs_filesystem";
|
||||
# passwordFile = "/etc/nixos/pool.jwe";
|
||||
extraFormatArgs = [
|
||||
"--compression=zstd"
|
||||
bcachefs_filesystems = lib.mkIf (cfg.filesystem == "bcachefs") {
|
||||
mounted_subvolumes_in_multi = {
|
||||
type = "bcachefs_filesystem";
|
||||
# passwordFile = "/etc/nixos/pool.jwe";
|
||||
extraFormatArgs = [
|
||||
"--compression=zstd"
|
||||
];
|
||||
subvolumes = {
|
||||
"subvolumes/root" = {
|
||||
mountpoint = "/";
|
||||
mountOptions = [
|
||||
"verbose"
|
||||
];
|
||||
};
|
||||
"subvolumes/persistent" = {
|
||||
mountpoint = "/persistent";
|
||||
};
|
||||
"subvolumes/nix" = {
|
||||
mountOptions = [
|
||||
"noatime"
|
||||
];
|
||||
mountpoint = "/nix";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
(lib.mkIf (cfg.filesystem == "btrfs") {
|
||||
nodev."/" = {
|
||||
fsType = "tmpfs";
|
||||
mountOptions = [
|
||||
"mode=755"
|
||||
"defaults"
|
||||
"size=25%"
|
||||
];
|
||||
subvolumes = {
|
||||
"subvolumes/root" = {
|
||||
mountpoint = "/";
|
||||
mountOptions = [
|
||||
"verbose"
|
||||
];
|
||||
};
|
||||
"subvolumes/persistent" = {
|
||||
mountpoint = "/persistent";
|
||||
};
|
||||
"subvolumes/nix" = {
|
||||
mountOptions = [
|
||||
"noatime"
|
||||
];
|
||||
mountpoint = "/nix";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
(lib.mkIf (cfg.filesystem == "btrfs") {
|
||||
nodev."/" = {
|
||||
fsType = "tmpfs";
|
||||
mountOptions = [
|
||||
"mode=755"
|
||||
"defaults"
|
||||
"size=25%"
|
||||
];
|
||||
};
|
||||
})
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user