aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--hosts/common/core/nix.nix9
-rwxr-xr-xscripts/pretty-rebuild3
2 files changed, 11 insertions, 1 deletions
diff --git a/hosts/common/core/nix.nix b/hosts/common/core/nix.nix
index 587bac6..dfcbd5c 100644
--- a/hosts/common/core/nix.nix
+++ b/hosts/common/core/nix.nix
@@ -1,5 +1,14 @@
{ inputs, lib, ... }:
{
+
+ # work around very annoying TMPDIR handling
+ # see: https://github.com/NixOS/nix/issues/7154
+ boot.tmp.useTmpfs = true;
+ systemd.services."nix-daemon".environment.TMPDIR = "/nix/tmp";
+ systemd.tmpfiles.rules = [
+ "d /nix/tmp 770 root nixbld"
+ ];
+
nix = {
settings = {
trusted-users = [ "root" "@wheel" ];
diff --git a/scripts/pretty-rebuild b/scripts/pretty-rebuild
index 30025bb..9822acb 100755
--- a/scripts/pretty-rebuild
+++ b/scripts/pretty-rebuild
@@ -1,10 +1,11 @@
#!/usr/bin/env nix-shell
#!nix-shell -i zsh --packages zsh
+# sudo is used for nixos-rebuild below due to: https://github.com/NixOS/nix/issues/7154
cd /etc/nixos && \
nix flake update && \
cd && \
- nixos-rebuild switch --upgrade --show-trace && \
+ sudo env TMPDIR=/nix/tmp nixos-rebuild switch --upgrade --show-trace && \
echo && \
nixos-rebuild list-generations | cat && \
echo && \