summaryrefslogtreecommitdiff
path: root/modules/system
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2018-01-18 00:12:38 +0100
committerDaiderd Jordan <daiderd@gmail.com>2018-01-18 00:12:38 +0100
commit9454e409b778b69739ca2c08c4c06fbc80a1b598 (patch)
treefb513512f176122e830240160b761e704684b52f /modules/system
parentc0f913d2aef1aa76141df5347e801748a3f81157 (diff)
checks: fail when db permissions are wrong
Diffstat (limited to 'modules/system')
-rw-r--r--modules/system/checks.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/system/checks.nix b/modules/system/checks.nix
index ad20a31..74bd44e 100644
--- a/modules/system/checks.nix
+++ b/modules/system/checks.nix
@@ -119,6 +119,17 @@ let
exit 2
fi
'';
+
+ nixStore = ''
+ if test -w /nix/var/nix/db -a ! -O /nix/store; then
+ echo >&2 "error: the store is not owned by this user, but /nix/var/nix/db is writable"
+ echo >&2 "If you are using the daemon:"
+ echo >&2
+ echo >&2 " sudo chown -R /nix/var/nix/db"
+ echo >&2
+ exit 2
+ fi
+ '';
in
{
@@ -131,6 +142,7 @@ in
${darwinChanges}
${runLink}
${buildUsers}
+ ${nixStore}
${nixChannels}
${nixInstaller}
${nixPath}