* Multi-user Nix setup has changed.
svn path=/nixos/trunk/; revision=7285
This commit is contained in:
parent
bc3f4f8352
commit
f20d572814
@ -131,21 +131,26 @@ echo "hosts: files dns" > /etc/nsswitch.conf
|
|||||||
if test -z "@readOnlyRoot@"; then
|
if test -z "@readOnlyRoot@"; then
|
||||||
|
|
||||||
for i in $(seq 1 10); do
|
for i in $(seq 1 10); do
|
||||||
account=nix-build-$i
|
account=nixbld$i
|
||||||
if ! userExists $account; then
|
if ! userExists $account; then
|
||||||
createUser $account x \
|
createUser $account x \
|
||||||
$((i + 30000)) $((i + 30000)) \
|
$((i + 30000)) 30000 \
|
||||||
'Nix build user' /var/empty /noshell
|
'Nix build user' /var/empty /noshell
|
||||||
fi
|
fi
|
||||||
accounts="$accounts $account"
|
accounts="$accounts${accounts:+,}$account"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if ! grep -q "^nixbld:" /etc/group; then
|
||||||
|
echo "nixbld:*:30000:$accounts" >> /etc/group
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -p /nix/etc/nix
|
mkdir -p /nix/etc/nix
|
||||||
cat > /nix/etc/nix/nix.conf <<EOF
|
cat > /nix/etc/nix/nix.conf <<EOF
|
||||||
build-allow-root = false
|
build-users-group = nixbld
|
||||||
build-users = $accounts
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
chown root.nixbld /nix/store
|
||||||
|
chmod 1775 /nix/store
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{ genericSubstituter, buildEnv, shell, coreutils, findutils
|
{ genericSubstituter, buildEnv, shell, coreutils, findutils
|
||||||
, utillinux, kernel, udev, upstart, setuidWrapper
|
, gnugrep, utillinux, kernel, udev, upstart, setuidWrapper
|
||||||
, path ? []
|
, path ? []
|
||||||
|
|
||||||
, # Whether the root device is root only. If so, we'll mount a
|
, # Whether the root device is root only. If so, we'll mount a
|
||||||
@ -17,6 +17,7 @@ let
|
|||||||
startPath = [
|
startPath = [
|
||||||
coreutils
|
coreutils
|
||||||
findutils
|
findutils
|
||||||
|
gnugrep
|
||||||
utillinux
|
utillinux
|
||||||
udev
|
udev
|
||||||
upstart
|
upstart
|
||||||
|
@ -195,7 +195,7 @@ rec {
|
|||||||
# everything else to bring up the system.
|
# everything else to bring up the system.
|
||||||
bootStage2 = import ../boot/boot-stage-2.nix {
|
bootStage2 = import ../boot/boot-stage-2.nix {
|
||||||
inherit (pkgs) genericSubstituter buildEnv coreutils findutils
|
inherit (pkgs) genericSubstituter buildEnv coreutils findutils
|
||||||
utillinux kernel udev upstart;
|
gnugrep utillinux kernel udev upstart;
|
||||||
inherit setuidWrapper;
|
inherit setuidWrapper;
|
||||||
inherit upstartJobs;
|
inherit upstartJobs;
|
||||||
shell = pkgs.bash + "/bin/sh";
|
shell = pkgs.bash + "/bin/sh";
|
||||||
@ -207,7 +207,6 @@ rec {
|
|||||||
pkgs.cpio
|
pkgs.cpio
|
||||||
pkgs.curl
|
pkgs.curl
|
||||||
pkgs.e2fsprogs
|
pkgs.e2fsprogs
|
||||||
pkgs.gnugrep
|
|
||||||
pkgs.gnused
|
pkgs.gnused
|
||||||
pkgs.gnutar
|
pkgs.gnutar
|
||||||
pkgs.grub
|
pkgs.grub
|
||||||
@ -243,7 +242,7 @@ rec {
|
|||||||
# The user configuration.
|
# The user configuration.
|
||||||
config = {
|
config = {
|
||||||
networking = {
|
networking = {
|
||||||
hostname = "vindaloo";
|
hostname = "nixos";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user