From 8a8d387b2215f95c6543f1ee150c0f35d4e3294a Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Fri, 6 Mar 2009 12:25:53 +0000 Subject: [PATCH] Convert "installer" svn path=/nixos/branches/fix-style/; revision=14366 --- system/nixos-installer.nix | 98 ++++++++++++++++++++++++++++++++++++++ system/options.nix | 83 +------------------------------- 2 files changed, 99 insertions(+), 82 deletions(-) create mode 100644 system/nixos-installer.nix diff --git a/system/nixos-installer.nix b/system/nixos-installer.nix new file mode 100644 index 00000000000..285b3043c30 --- /dev/null +++ b/system/nixos-installer.nix @@ -0,0 +1,98 @@ +{pkgs, config, ...}: + +###### interface +let + inherit (pkgs.lib) mkOption mkIf; + + options = { + installer = { + nixpkgsURL = mkOption { + default = ""; + example = http://nixos.org/releases/nix/nixpkgs-0.11pre7577; + description = " + URL of the Nixpkgs distribution to use when building the + installation CD. + "; + }; + + repos = { + nixos = mkOption { + default = [ { type = "svn"; } ]; + example = [ { type = "svn"; url = "https://svn.nixos.org/repos/nix/nixos/branches/stdenv-updates"; target = "/etc/nixos/nixos-stdenv-updates"; } + { type = "git"; initialize = ''git clone git://mawercer.de/nixos $target''; update = "git pull origin"; target = "/etc/nixos/nixos-git"; } + ]; + description = '' + The NixOS repository from which the system will be built. + nixos-checkout will update all working + copies of the given repositories, + nixos-rebuild will use the first item + which has the attribute default = true + falling back to the first item. The type defines the + repository tool added to the path. It also defines a "valid" + repository. If the target directory already exists and it's + not valid it will be moved to the backup location + dir-date. + For svn the default target and repositories are + /etc/nixos/nixos and + https://svn.nixos.org/repos/nix/nixos/trunk. + For git repositories update is called after initialization + when the repo is initialized. The initialize code is run + from working directory dirname + target and should create the + directory + dir. (git + clone url nixos/nixpkgs/services should do) For + the executables used see . + ''; + }; + + nixpkgs = mkOption { + default = [ { type = "svn"; } ]; + description = "same as "; + }; + + services = mkOption { + default = [ { type = "svn"; } ]; + description = "same as "; + }; + }; + + repoTypes = mkOption { + default = { + svn = { valid = "[ -d .svn ]"; env = [ pkgs.coreutils pkgs.subversion ]; }; + git = { valid = "[ -d .git ]"; env = [ pkgs.coreutils pkgs.git pkgs.gnused /* FIXME: use full path to sed in nix-pull */ ]; }; + }; + description = '' + Defines, for each supported version control system + (e.g. git), the dependencies for the + mechanism, as well as a test used to determine whether a + directory is a checkout created by that version control + system. + ''; + }; + + manifests = mkOption { + default = [http://nixos.org/releases/nixpkgs/channels/nixpkgs-unstable/MANIFEST]; + example = + [ http://nixos.org/releases/nixpkgs/channels/nixpkgs-unstable/MANIFEST + http://nixos.org/releases/nixpkgs/channels/nixpkgs-stable/MANIFEST + ]; + description = " + URLs of manifests to be downloaded when you run + nixos-rebuild to speed up builds. + "; + }; + }; + }; + + +in + +###### implementation + +mkIf config.services.pulseaudio.enable { + require = [ + options + ]; + +} diff --git a/system/options.nix b/system/options.nix index df484d47451..4cff3ac9296 100644 --- a/system/options.nix +++ b/system/options.nix @@ -1697,88 +1697,6 @@ in }; - installer = { - - nixpkgsURL = mkOption { - default = ""; - example = http://nixos.org/releases/nix/nixpkgs-0.11pre7577; - description = " - URL of the Nixpkgs distribution to use when building the - installation CD. - "; - }; - - repos = { - nixos = mkOption { - default = [ { type = "svn"; } ]; - example = [ { type = "svn"; url = "https://svn.nixos.org/repos/nix/nixos/branches/stdenv-updates"; target = "/etc/nixos/nixos-stdenv-updates"; } - { type = "git"; initialize = ''git clone git://mawercer.de/nixos $target''; update = "git pull origin"; target = "/etc/nixos/nixos-git"; } - ]; - description = '' - The NixOS repository from which the system will be built. - nixos-checkout will update all working - copies of the given repositories, - nixos-rebuild will use the first item - which has the attribute default = true - falling back to the first item. The type defines the - repository tool added to the path. It also defines a "valid" - repository. If the target directory already exists and it's - not valid it will be moved to the backup location - dir-date. - For svn the default target and repositories are - /etc/nixos/nixos and - https://svn.nixos.org/repos/nix/nixos/trunk. - For git repositories update is called after initialization - when the repo is initialized. The initialize code is run - from working directory dirname - target and should create the - directory - dir. (git - clone url nixos/nixpkgs/services should do) For - the executables used see . - ''; - }; - - nixpkgs = mkOption { - default = [ { type = "svn"; } ]; - description = "same as "; - }; - - services = mkOption { - default = [ { type = "svn"; } ]; - description = "same as "; - }; - }; - - repoTypes = mkOption { - default = { - svn = { valid = "[ -d .svn ]"; env = [ pkgs.coreutils pkgs.subversion ]; }; - git = { valid = "[ -d .git ]"; env = [ pkgs.coreutils pkgs.git pkgs.gnused /* FIXME: use full path to sed in nix-pull */ ]; }; - }; - description = '' - Defines, for each supported version control system - (e.g. git), the dependencies for the - mechanism, as well as a test used to determine whether a - directory is a checkout created by that version control - system. - ''; - }; - - manifests = mkOption { - default = [http://nixos.org/releases/nixpkgs/channels/nixpkgs-unstable/MANIFEST]; - example = - [ http://nixos.org/releases/nixpkgs/channels/nixpkgs-unstable/MANIFEST - http://nixos.org/releases/nixpkgs/channels/nixpkgs-stable/MANIFEST - ]; - description = " - URLs of manifests to be downloaded when you run - nixos-rebuild to speed up builds. - "; - }; - - }; - - nesting = { children = mkOption { default = []; @@ -1859,6 +1777,7 @@ in (import ../upstart-jobs/gw6c.nix) # Gateway6 (import ../upstart-jobs/nix.nix) # nix options and daemon + (import ../system/nixos-installer.nix) #users