From a86ae923d7c660cba592c58cec38c32faa2f545b Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Fri, 6 Mar 2009 12:25:35 +0000 Subject: [PATCH] Convert "nixos-environment" in particular: (override) nix, extraPackages, checkConfigurationOptions svn path=/nixos/branches/fix-style/; revision=14360 --- system/nixos-environment.nix | 67 ++++++++++++++++++++++++++++++++++++ system/options.nix | 60 ++------------------------------ 2 files changed, 69 insertions(+), 58 deletions(-) create mode 100644 system/nixos-environment.nix diff --git a/system/nixos-environment.nix b/system/nixos-environment.nix new file mode 100644 index 00000000000..a2e0ae46cdf --- /dev/null +++ b/system/nixos-environment.nix @@ -0,0 +1,67 @@ + +{pkgs, config, ...}: +let + inherit (pkgs.lib) mergeOneOption mkOption mkIf; +in +{ + require = [ + { + + environment = { + checkConfigurationOptions = mkOption { + default = true; + example = false; + description = " + If all configuration options must be checked. Non-existing options fail build. + "; + }; + + nix = mkOption { + default = pkgs.nixUnstable; + example = pkgs.nixCustomFun /root/nix.tar.gz; + merge = mergeOneOption; + description = " + Use non-default Nix easily. Be careful, though, not to break everything. + "; + }; + + extraPackages = mkOption { + default = []; + example = [pkgs.firefox pkgs.thunderbird]; + description = " + This option allows you to add additional packages to the system + path. These packages are automatically available to all users, + and they are automatically updated every time you rebuild the + system configuration. (The latter is the main difference with + installing them in the default profile, + /nix/var/nix/profiles/default. The value + of this option must be a function that returns a list of + packages. The function will be called with the Nix Packages + collection as its argument for convenience. + "; + }; + + + pathsToLink = mkOption { + default = ["/bin" "/sbin" "/lib" "/share" "/man" "/info" "/etc"]; + example = ["/"]; + description = " + Lists directories to be symlinked in `/var/run/current-system/sw'. + "; + }; + + cleanStart = mkOption { + default = false; + example = true; + description = " + There are some times when you want really small system for specific + purpose and do not want default package list. Setting + cleanStart to true allows you + to create a system with empty path - only extraPackages will be + included. + "; + }; + }; + } + ]; +} diff --git a/system/options.nix b/system/options.nix index 9e30c505345..c0e09721259 100644 --- a/system/options.nix +++ b/system/options.nix @@ -2116,64 +2116,6 @@ in }; - environment = { - - pathsToLink = mkOption { - default = ["/bin" "/sbin" "/lib" "/share" "/man" "/info" "/etc"]; - example = ["/"]; - description = " - Lists directories to be symlinked in `/var/run/current-system/sw'. - "; - }; - - cleanStart = mkOption { - default = false; - example = true; - description = " - There are some times when you want really small system for specific - purpose and do not want default package list. Setting - cleanStart to true allows you - to create a system with empty path - only extraPackages will be - included. - "; - }; - - extraPackages = mkOption { - default = []; - example = [pkgs.firefox pkgs.thunderbird]; - description = " - This option allows you to add additional packages to the system - path. These packages are automatically available to all users, - and they are automatically updated every time you rebuild the - system configuration. (The latter is the main difference with - installing them in the default profile, - /nix/var/nix/profiles/default. The value - of this option must be a function that returns a list of - packages. The function will be called with the Nix Packages - collection as its argument for convenience. - "; - }; - - nix = mkOption { - default = pkgs.nixUnstable; - example = pkgs.nixCustomFun /root/nix.tar.gz; - merge = mergeOneOption; - description = " - Use non-default Nix easily. Be careful, though, not to break everything. - "; - }; - - checkConfigurationOptions = mkOption { - default = true; - example = false; - description = " - If all configuration options must be checked. Non-existing options fail build. - "; - }; - - }; - - nesting = { children = mkOption { default = []; @@ -2215,6 +2157,8 @@ in # environment (import ../etc/default.nix) + (import ../system/nixos-environment.nix) + # users (import ../system/users-groups.nix)