mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
Changes to xserver to export configuration and to allow not to run the job on boot, changes to filesystems job to autocreate some mountpoints (/dev/shm..)
svn path=/nixos/trunk/; revision=9987
This commit is contained in:
parent
ae6104ae59
commit
55b977dcbf
3 changed files with 24 additions and 3 deletions
|
@ -154,6 +154,8 @@ let
|
||||||
libXext = pkgs.xlibs.libXext;
|
libXext = pkgs.xlibs.libXext;
|
||||||
fontDirectories = import ../system/fonts.nix {inherit pkgs config;};
|
fontDirectories = import ../system/fonts.nix {inherit pkgs config;};
|
||||||
isClone = config.services.xserver.isClone;
|
isClone = config.services.xserver.isClone;
|
||||||
|
autorun = config.services.xserver.autorun;
|
||||||
|
exportConfiguration = config.services.xserver.exportConfiguration;
|
||||||
})
|
})
|
||||||
|
|
||||||
# Apache httpd.
|
# Apache httpd.
|
||||||
|
|
|
@ -7,6 +7,7 @@ let
|
||||||
devices = map (fs: if fs ? device then fs.device else "LABEL=" + fs.label) fileSystems;
|
devices = map (fs: if fs ? device then fs.device else "LABEL=" + fs.label) fileSystems;
|
||||||
fsTypes = map (fs: if fs ? fsType then fs.fsType else "auto") fileSystems;
|
fsTypes = map (fs: if fs ? fsType then fs.fsType else "auto") fileSystems;
|
||||||
optionss = map (fs: if fs ? options then fs.options else "defaults") fileSystems;
|
optionss = map (fs: if fs ? options then fs.options else "defaults") fileSystems;
|
||||||
|
autocreates = map (fs: if fs ? autocreate then fs.autocreate else "0") fileSystems;
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
|
@ -25,6 +26,7 @@ script
|
||||||
devices=(${toString devices})
|
devices=(${toString devices})
|
||||||
fsTypes=(${toString fsTypes})
|
fsTypes=(${toString fsTypes})
|
||||||
optionss=(${toString optionss})
|
optionss=(${toString optionss})
|
||||||
|
autocreates=(${toString autocreates})
|
||||||
|
|
||||||
newDevices=1
|
newDevices=1
|
||||||
|
|
||||||
|
@ -41,12 +43,14 @@ script
|
||||||
device=\${devices[$n]}
|
device=\${devices[$n]}
|
||||||
fsType=\${fsTypes[$n]}
|
fsType=\${fsTypes[$n]}
|
||||||
options=\${optionss[$n]}
|
options=\${optionss[$n]}
|
||||||
|
autocreate=\${autocreates[$n]}
|
||||||
|
|
||||||
isLabel=
|
isLabel=
|
||||||
if echo \"$device\" | grep -q '^LABEL='; then isLabel=1; fi
|
if echo \"$device\" | grep -q '^LABEL='; then isLabel=1; fi
|
||||||
|
|
||||||
isPseudo=
|
isPseudo=
|
||||||
if test \"$fsType\" = \"nfs\" || test \"$fsType\" = \"ext3cow\"; then isPseudo=1; fi
|
if test \"$fsType\" = \"nfs\" || test \"$fsType\" = \"tmpfs\" ||
|
||||||
|
test \"$fsType\" = \"ext3cow\"; then isPseudo=1; fi
|
||||||
|
|
||||||
if ! test -n \"$isLabel\" -o -n \"$isPseudo\" -o -e \"$device\"; then
|
if ! test -n \"$isLabel\" -o -n \"$isPseudo\" -o -e \"$device\"; then
|
||||||
echo \"skipping $device, doesn't exist (yet)\"
|
echo \"skipping $device, doesn't exist (yet)\"
|
||||||
|
@ -100,6 +104,8 @@ script
|
||||||
fsck -a \"$device\" || true
|
fsck -a \"$device\" || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test \"\$autocreate\" = 1; then mkdir -p \"\$mountPoint\"; fi
|
||||||
|
|
||||||
if ${utillinux}/bin/mount -t \"$fsType\" -o \"$options\" \"$device\" \"$mountPoint\"; then
|
if ${utillinux}/bin/mount -t \"$fsType\" -o \"$options\" \"$device\" \"$mountPoint\"; then
|
||||||
newDevices=1
|
newDevices=1
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -19,6 +19,12 @@
|
||||||
|
|
||||||
, # Is Clone mode on?
|
, # Is Clone mode on?
|
||||||
isClone ? "on"
|
isClone ? "on"
|
||||||
|
|
||||||
|
, # Do we want it to run or just to prepare everything?
|
||||||
|
autorun ? true
|
||||||
|
|
||||||
|
, # Create unneeded links in /etc?
|
||||||
|
exportConfiguration ? false
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
@ -364,11 +370,18 @@ rec {
|
||||||
optional (sessionType == "kde")
|
optional (sessionType == "kde")
|
||||||
{ source = "${xkeyboard_config}/etc/X11/xkb";
|
{ source = "${xkeyboard_config}/etc/X11/xkb";
|
||||||
target = "X11/xkb";
|
target = "X11/xkb";
|
||||||
};
|
}
|
||||||
|
++
|
||||||
|
optional (exportConfiguration)
|
||||||
|
{
|
||||||
|
source = "${configFile}";
|
||||||
|
target = "X11/xorg.conf";
|
||||||
|
}
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
job = "
|
job = "
|
||||||
start on network-interfaces
|
start on ${if autorun then "network-interfaces" else "never"}
|
||||||
|
|
||||||
start script
|
start script
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue