dotfiles/nixos/systems/saw/disko.nix
magic_rb ef38ff156f
Add saw the media bedside PC
Signed-off-by: magic_rb <magic_rb@redalder.org>
2024-11-17 16:24:38 +01:00

95 lines
1.9 KiB
Nix

{
lib,
config,
...
}: {
boot.initrd.systemd.enable = true;
boot.loader.efi = {
efiSysMountPoint = "/boot";
};
boot.loader.grub = {
devices = ["nodev"];
efiInstallAsRemovable = true;
efiSupport = true;
};
fileSystems = {
"/persist".neededForBoot = true;
"/nix" = lib.mapAttrs (_: lib.mkForce) {
fsType = "auto";
device = "/persist/nix";
options = ["x-initrd.mount" "bind"];
neededForBoot = true;
};
};
disko.devices = {
nodev."/tmp" = {
fsType = "tmpfs";
mountOptions = [
"size=256M"
"mode=755"
"noexec"
];
};
nodev."/" = {
fsType = "tmpfs";
mountOptions = [
"size=128M"
"mode=755"
"noexec"
];
};
nodev."/nix" = {
fsType = "ext4";
device = "/dev/disk/by-id/ata-SK_hynix_SC311_SATA_128GB_MJ88N52701150940J-part3";
mountOptions = [
"X-mount.subdir=nix"
];
preMountHook = ''
tmpdir=$(mktemp -d)
mount /dev/disk/by-id/ata-SK_hynix_SC311_SATA_128GB_MJ88N52701150940J-part3 $tmpdir
mkdir $tmpdir/nix
umount $tmpdir
'';
};
disk.ssd = {
device = "/dev/disk/by-id/ata-SK_hynix_SC311_SATA_128GB_MJ88N52701150940J";
type = "disk";
content = {
type = "gpt";
partitions = {
ESP = {
type = "EF00";
size = "2048M";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = ["umask=0077"];
};
};
swap = {
size = "8192M";
content.type = "swap";
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/persist";
};
};
};
};
};
};
}