diff options
| author | Daiderd Jordan <daiderd@gmail.com> | 2018-01-18 00:12:38 +0100 |
|---|---|---|
| committer | Daiderd Jordan <daiderd@gmail.com> | 2018-01-18 00:12:38 +0100 |
| commit | 9454e409b778b69739ca2c08c4c06fbc80a1b598 (patch) | |
| tree | fb513512f176122e830240160b761e704684b52f /modules/system | |
| parent | c0f913d2aef1aa76141df5347e801748a3f81157 (diff) | |
checks: fail when db permissions are wrong
Diffstat (limited to 'modules/system')
| -rw-r--r-- | modules/system/checks.nix | 12 |
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 "[1;31merror: the store is not owned by this user, but /nix/var/nix/db is writable[0m" + 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} |
