mirror of
https://github.com/NixOS/nix
synced 2025-06-24 22:11:15 +02:00
Factor out isRootUser
function
This commit is contained in:
parent
eeecbb9c36
commit
e4d9b207c2
11 changed files with 30 additions and 15 deletions
|
@ -1414,7 +1414,7 @@ static int main_nix_env(int argc, char * * argv)
|
|||
replaceSymlink(
|
||||
defaultChannelsDir(),
|
||||
nixExprPath + "/channels");
|
||||
if (getuid() != 0)
|
||||
if (!isRootUser())
|
||||
replaceSymlink(
|
||||
rootChannelsDir(),
|
||||
nixExprPath + "/channels_root");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue