mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-12-04 05:56:14 +01:00
ef38ff156f
Signed-off-by: magic_rb <magic_rb@redalder.org>
95 lines
1.9 KiB
Nix
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";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|