Fix building many things in nix.
Nix 2.30.0 (2025-07-07) changed the build directory from /tmp to /nix/var/nix/builds which broke a number of builds because my ZFS datasets were utf8only. This adds a role to mount tmpfs to /nix/var/nix/builds to restore the old behavior.
This commit is contained in:
parent
24b089a313
commit
888613a229
@ -14,6 +14,7 @@
|
||||
./roles/base
|
||||
./roles/bluetooth
|
||||
./roles/boot
|
||||
./roles/build_in_ram
|
||||
./roles/chromecast
|
||||
./roles/chromium
|
||||
./roles/d2
|
||||
@ -177,7 +178,6 @@
|
||||
(final: prev: {
|
||||
grub2 = (final.callPackage ./package/grub { });
|
||||
})
|
||||
(disableTests "git")
|
||||
];
|
||||
|
||||
# This option defines the first version of NixOS you have installed on this particular machine,
|
||||
|
||||
@ -16,8 +16,8 @@
|
||||
me.buildingPortable = true;
|
||||
me.mountPersistence = lib.mkForce false;
|
||||
me.optimizations.enable = lib.mkForce false;
|
||||
me.image_based_appliance.enable = true;
|
||||
|
||||
# TODO: image based appliance?
|
||||
# Not doing image_based_appliance because this might be an install ISO, in which case we'd need nix to do the install.
|
||||
# me.image_based_appliance.enable = true;
|
||||
};
|
||||
}
|
||||
|
||||
@ -68,6 +68,7 @@
|
||||
me.base.enable = true;
|
||||
me.bluetooth.enable = true;
|
||||
me.boot.enable = true;
|
||||
me.build_in_ram.enable = true;
|
||||
me.chromecast.enable = true;
|
||||
me.chromium.enable = true;
|
||||
me.d2.enable = true;
|
||||
|
||||
@ -62,6 +62,7 @@
|
||||
me.base.enable = true;
|
||||
me.bluetooth.enable = true;
|
||||
me.boot.enable = true;
|
||||
me.build_in_ram.enable = true;
|
||||
me.chromecast.enable = true;
|
||||
me.chromium.enable = true;
|
||||
me.d2.enable = true;
|
||||
|
||||
@ -47,11 +47,16 @@
|
||||
# Enable TRIM
|
||||
# services.fstrim.enable = lib.mkDefault true;
|
||||
|
||||
me.build_in_ram.enable = true;
|
||||
me.doas.enable = true;
|
||||
me.network.enable = true;
|
||||
me.nvme.enable = true;
|
||||
me.recovery.enable = true;
|
||||
me.ssh.enable = true;
|
||||
me.sshd.enable = true;
|
||||
me.user.enable = true;
|
||||
me.zfs.enable = true;
|
||||
me.zrepl.enable = true;
|
||||
me.zsh.enable = true;
|
||||
};
|
||||
}
|
||||
|
||||
35
nix/configuration/roles/build_in_ram/default.nix
Normal file
35
nix/configuration/roles/build_in_ram/default.nix
Normal file
@ -0,0 +1,35 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
options.me = {
|
||||
build_in_ram.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether we want to install build_in_ram.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.me.build_in_ram.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
# Nix 2.30.0 (2025-07-07) changed the build directory from /tmp to /nix/var/nix/builds which broke a number of builds because my ZFS datasets were utf8only.
|
||||
fileSystems."/nix/var/nix/builds" = {
|
||||
device = "tmpfs";
|
||||
fsType = "tmpfs";
|
||||
options = [
|
||||
"size=40G" # adjust for your situation and needs
|
||||
"mode=700"
|
||||
];
|
||||
};
|
||||
}
|
||||
]
|
||||
);
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user