diff --git a/installer/nixos-checkout.nix b/installer/nixos-checkout.nix index 79e697576851..08a7a8298528 100644 --- a/installer/nixos-checkout.nix +++ b/installer/nixos-checkout.nix @@ -1,9 +1,6 @@ args : with args; -let - inherit (pkgs.lib) id all showVal escapeShellArg concatMapStrings concatMap - mapAttrs concatLists flattenAttrs filter; - inherit (builtins) getAttr hasAttr head isAttrs; -in + +with pkgs.lib; rec { # prepareRepoAttrs adds svn defaults and preparse the repo attribute sets so that they @@ -65,12 +62,12 @@ rec { # this file is automatically generated from nixos configuration file settings (installer.repos) backupTimestamp=$(date "+%Y%m%d%H%M%S") '' + concatMapStrings ( attrs : - let repoType = getAttr attrs.type config.installer.repoTypes; + let repoType = builtins.getAttr attrs.type config.installer.repoTypes; target = escapeShellArg attrs.target; in '' # ${attrs.type} repo ${target} PATH= - for path in ${builtins.toString repoType.env}; do + for path in ${toString repoType.env}; do PATH=$PATH:$path/bin:$path/sbin done if [ -d ${target} ] && { cd ${target} && { ${ repoType.valid}; }; }; then diff --git a/upstart-jobs/apache-httpd/default.nix b/upstart-jobs/apache-httpd/default.nix index aab5d331d10c..b8fb5df4d484 100644 --- a/upstart-jobs/apache-httpd/default.nix +++ b/upstart-jobs/apache-httpd/default.nix @@ -216,7 +216,7 @@ let getPort = cfg: if cfg.port != 0 then cfg.port else if cfg.enableSSL then 443 else 80; - extraModules = pkgs.lib.getAttr ["extraModules"] [] mainCfg; + extraModules = pkgs.lib.attrByPath ["extraModules"] [] mainCfg; extraForeignModules = pkgs.lib.filter builtins.isAttrs extraModules; extraApachaModules = pkgs.lib.filter (x :! (builtins.isAttrs x)) extraModules; # I'd prefer using builtins.isString here, but doesn't exist yet diff --git a/upstart-jobs/default.nix b/upstart-jobs/default.nix index 91f67f53b426..006f9e062768 100644 --- a/upstart-jobs/default.nix +++ b/upstart-jobs/default.nix @@ -2,7 +2,7 @@ ###### interface let - inherit (pkgs.lib) mkOption mapAttrs getAttr fold + inherit (pkgs.lib) mkOption mapAttrs fold mergeListOption mergeTypedOption mergeAttrsWithFunc; options = { diff --git a/upstart-jobs/xserver/default.nix b/upstart-jobs/xserver/default.nix index 6cd6de2c5c9c..496a2a9e3529 100644 --- a/upstart-jobs/xserver/default.nix +++ b/upstart-jobs/xserver/default.nix @@ -1,13 +1,13 @@ {config, pkgs, ...}: # TODO: this file need some make-up (Nicolas Pierron) +with pkgs.lib; + let kernelPackages = config.boot.kernelPackages; # List of font directories. fontDirectories = config.fonts.fonts; - inherit (pkgs.lib) mkOption; - options = { services = { @@ -282,7 +282,6 @@ in let - inherit (pkgs.lib) optional isInList getAttr mkIf; # Abbreviations. cfg = config.services.xserver; xorg = cfg.package; @@ -305,16 +304,15 @@ let videoDriver = cfg.videoDriver; resolutions = map (res: ''"${toString res.x}x${toString res.y}"'') (cfg.resolutions); - videoDriverModules = getAttr [ videoDriver ] (throw "unkown video driver : `${videoDriver}'") knownVideoDrivers; + videoDriverModules = attrByPath [videoDriver] (throw "unknown video driver: `${videoDriver}'") knownVideoDrivers; modules = - - getAttr ["modulesFirst"] [] videoDriverModules + attrByPath ["modulesFirst"] [] videoDriverModules ++ [ xorg.xorgserver xorg.xf86inputevdev ] - ++ getAttr ["modules"] [] videoDriverModules + ++ attrByPath ["modules"] [] videoDriverModules ++ (optional cfg.synaptics.enable ["${xorg.xf86inputsynaptics}"]);