* Merge splash-themes.nix into the regular options infrastructure.

svn path=/nixos/trunk/; revision=7576
This commit is contained in:
Eelco Dolstra 2007-01-08 22:41:41 +00:00
parent 56da3e7887
commit 2148123b9c
5 changed files with 104 additions and 79 deletions

View file

@ -3,13 +3,15 @@
# defaults declared in options.nix if no value is given for an
# option.
lib: config:
pkgs: config:
let lib = pkgs.library; in
rec {
# The option declarations, i.e., option names with defaults and
# documentation.
declarations = import ./options.nix;
declarations = import ./options.nix {inherit pkgs;};
# Get the option named `name' from the user configuration, using
# its default value if it's not defined.

View file

@ -1,3 +1,5 @@
{pkgs}:
[
@ -237,6 +239,63 @@
}
{
name = ["services" "ttyBackgrounds" "enable"];
default = true;
description = "
Whether to enable graphical backgrounds for the virtual consoles.
";
}
{
name = ["services" "ttyBackgrounds" "defaultTheme"];
default = pkgs.fetchurl {
url = http://www.bootsplash.de/files/themes/Theme-BabyTux.tar.bz2;
md5 = "a6d89d1c1cff3b6a08e2f526f2eab4e0";
};
description = "
The default theme for the virtual consoles. Themes can be found
at http://www.bootsplash.de/.
";
}
{
name = ["services" "ttyBackgrounds" "defaultSpecificThemes"];
default = [
{ tty = 6;
theme = pkgs.fetchurl { # Yeah!
url = http://www.bootsplash.de/files/themes/Theme-Pativo.tar.bz2;
md5 = "9e13beaaadf88d43a5293e7ab757d569";
};
}
{ tty = 10;
theme = pkgs.fetchurl {
url = http://www.bootsplash.de/files/themes/Theme-GNU.tar.bz2;
md5 = "61969309d23c631e57b0a311102ef034";
};
}
];
description = "
This option sets specific themes for virtual consoles. If you
just want to set themes for additional consoles, use
<option>services.ttyBackgrounds.specificThemes</option>.
";
}
{
name = ["services" "ttyBackgrounds" "specificThemes"];
default = [
];
description = "
This option allows you to set specific themes for virtual
consoles.
";
}
{
name = ["services" "mingetty" "ttys"];
default = [1 2 3 4 5 6];

View file

@ -1,58 +0,0 @@
{fetchurl}:
rec {
# Some themes.
themeBabyTux = fetchurl {
url = http://www.bootsplash.de/files/themes/Theme-BabyTux.tar.bz2;
md5 = "a6d89d1c1cff3b6a08e2f526f2eab4e0";
};
themeFrozenBubble = fetchurl {
url = http://www.bootsplash.de/files/themes/Theme-FrozenBubble.tar.bz2;
md5 = "da49f04988ab04b7e0de117b0d25061a";
};
themePativo = fetchurl { # Yeah!
url = http://www.bootsplash.de/files/themes/Theme-Pativo.tar.bz2;
md5 = "9e13beaaadf88d43a5293e7ab757d569";
};
themeGNU = fetchurl {
url = http://www.bootsplash.de/files/themes/Theme-GNU.tar.bz2;
md5 = "61969309d23c631e57b0a311102ef034";
};
# The splash screen.
splashScreen = themeBabyTux;
# The themes to use for each tty. For each tty except the first
# entry in the list, you can omit `theme' to get the same theme as
# the first one. If a tty does not appear, it doesn't get a
# theme (i.e., it will keep a black background).
ttyBackgrounds = [
{ tty = 1;
theme = themeBabyTux;
}
{ tty = 2;
}
{ tty = 3;
theme = themeGNU;
}
{ tty = 4;
theme = themeGNU;
}
{ tty = 5;
theme = themePativo;
}
{ tty = 10; # logging console
theme = themeGNU;
}
];
}

View file

@ -7,7 +7,7 @@ rec {
# Make a configuration object from which we can retrieve option
# values.
config = import ./config.nix pkgs.library configuration;
config = import ./config.nix pkgs configuration;
pkgs = import ../pkgs/top-level/all-packages.nix {system = platform;};
@ -30,12 +30,6 @@ rec {
nix = pkgs.nixUnstable; # we need the exportReferencesGraph feature
# Splash configuration.
splashThemes = import ./splash-themes.nix {
inherit (pkgs) fetchurl;
};
rootModules =
(config.get ["boot" "initrd" "extraKernelModules"]) ++
(config.get ["boot" "initrd" "kernelModules"]);
@ -100,7 +94,7 @@ rec {
}
{ object = import ../helpers/unpack-theme.nix {
inherit (pkgs) stdenv;
theme = splashThemes.splashScreen;
theme = config.get ["services" "ttyBackgrounds" "defaultTheme"];
};
symlink = "/etc/splash";
}
@ -117,7 +111,7 @@ rec {
# The services (Upstart) configuration for the system.
upstartJobs = import ./upstart.nix {
inherit config pkgs nix splashThemes;
inherit config pkgs nix;
};

View file

@ -1,4 +1,4 @@
{config, pkgs, nix, splashThemes}:
{config, pkgs, nix}:
let
@ -66,12 +66,6 @@ import ../upstart-jobs/gather.nix {
inherit nix;
})
# Transparent TTY backgrounds.
(import ../upstart-jobs/tty-backgrounds.nix {
inherit (pkgs) stdenv splashutils;
backgrounds = splashThemes.ttyBackgrounds;
})
# Handles the maintenance/stalled event (single-user shell).
(import ../upstart-jobs/maintenance-shell.nix {
inherit (pkgs) bash;
@ -123,13 +117,47 @@ import ../upstart-jobs/gather.nix {
# The terminals on ttyX.
++ (map
(ttyNumber: makeJob (import ../upstart-jobs/mingetty.nix {
inherit (pkgs) mingetty;
inherit ttyNumber;
loginProgram = "${pkgs.pam_login}/bin/login";
inherit (pkgs) mingetty;
inherit ttyNumber;
loginProgram = "${pkgs.pam_login}/bin/login";
}))
(config.get ["services" "mingetty" "ttys"])
)
# Transparent TTY backgrounds.
++ optional ["services" "ttyBackgrounds" "enable"]
(import ../upstart-jobs/tty-backgrounds.nix {
inherit (pkgs) stdenv splashutils;
backgrounds =
let
specificThemes =
config.get ["services" "ttyBackgrounds" "defaultSpecificThemes"]
++ config.get ["services" "ttyBackgrounds" "specificThemes"];
overridenTTYs = map (x: x.tty) specificThemes;
requiredTTYs =
(config.get ["services" "mingetty" "ttys"])
++ [10] /* !!! sync with syslog.conf */ ;
# Use the default theme for all the mingetty ttys and for the
# syslog tty, except those for which a specific theme is
# specified.
defaultTTYs =
pkgs.library.filter (x: !(pkgs.library.elem x overridenTTYs)) requiredTTYs;
in
(map (ttyNumber: {
tty = ttyNumber;
theme = config.get ["services" "ttyBackgrounds" "defaultTheme"];
}) defaultTTYs)
++ specificThemes;
})
# User-defined events.
++ (map makeJob (config.get ["services" "extraJobs"]))