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.
36 lines
762 B
Nix
36 lines
762 B
Nix
{
|
|
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"
|
|
];
|
|
};
|
|
}
|
|
]
|
|
);
|
|
}
|