summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/config/shells-environment.nix4
-rw-r--r--nixos/modules/config/sysctl.nix2
-rw-r--r--nixos/modules/hardware/network/b43.nix18
-rw-r--r--nixos/modules/installer/cd-dvd/channel.nix2
-rw-r--r--nixos/modules/services/misc/disnix.nix4
-rw-r--r--nixos/modules/services/networking/ssh/sshd.nix4
-rw-r--r--nixos/modules/services/torrent/transmission.nix2
-rw-r--r--nixos/modules/services/web-servers/apache-httpd/default.nix4
-rw-r--r--nixos/modules/system/activation/activation-script.nix2
9 files changed, 22 insertions, 20 deletions
diff --git a/nixos/modules/config/shells-environment.nix b/nixos/modules/config/shells-environment.nix
index e3fbdd7aaec1..0b4f75a35216 100644
--- a/nixos/modules/config/shells-environment.nix
+++ b/nixos/modules/config/shells-environment.nix
@@ -31,9 +31,9 @@ in
             res = (head defs').value;
           in
           if isList res then concatLists (getValues defs')
-          else if builtins.lessThan 1 (length defs') then
+          else if lessThan 1 (length defs') then
             throw "The option `${showOption loc}' is defined multiple times, in ${showFiles (getFiles defs)}."
-          else if !builtins.isString res then
+          else if !isString res then
             throw "The option `${showOption loc}' does not have a string value, in ${showFiles (getFiles defs)}."
           else res;
       });
diff --git a/nixos/modules/config/sysctl.nix b/nixos/modules/config/sysctl.nix
index 31441bad6157..f987c9c9e944 100644
--- a/nixos/modules/config/sysctl.nix
+++ b/nixos/modules/config/sysctl.nix
@@ -6,7 +6,7 @@ let
 
   sysctlOption = mkOptionType {
     name = "sysctl option value";
-    check = x: builtins.isBool x || builtins.isString x || builtins.isInt x;
+    check = x: isBool x || isString x || isInt x;
     merge = args: defs: (last defs).value; # FIXME: hacky way to allow overriding in configuration.nix.
   };
 
diff --git a/nixos/modules/hardware/network/b43.nix b/nixos/modules/hardware/network/b43.nix
index 8f45bd4d3f1a..03f81f92ef0b 100644
--- a/nixos/modules/hardware/network/b43.nix
+++ b/nixos/modules/hardware/network/b43.nix
@@ -1,4 +1,6 @@
-{pkgs, config, ...}:
+{ config, pkgs, ... }:
+
+with pkgs.lib;
 
 let kernelVersion = config.boot.kernelPackages.kernel.version; in
 
@@ -8,9 +10,9 @@ let kernelVersion = config.boot.kernelPackages.kernel.version; in
 
   options = {
 
-    networking.enableB43Firmware = pkgs.lib.mkOption {
+    networking.enableB43Firmware = mkOption {
       default = false;
-      type = pkgs.lib.types.bool;
+      type = types.bool;
       description = ''
         Turn on this option if you want firmware for the NICs supported by the b43 module.
       '';
@@ -21,11 +23,11 @@ let kernelVersion = config.boot.kernelPackages.kernel.version; in
 
   ###### implementation
 
-  config = pkgs.lib.mkIf config.networking.enableB43Firmware {
-    assertions = [ {
-      assertion = builtins.lessThan 0 (builtins.compareVersions kernelVersion "3.2");
-      message = "b43 firmware for kernels older than 3.2 not packaged yet!";
-    } ];
+  config = mkIf config.networking.enableB43Firmware {
+    assertions = singleton
+      { assertion = lessThan 0 (builtins.compareVersions kernelVersion "3.2");
+        message = "b43 firmware for kernels older than 3.2 not packaged yet!";
+      };
     hardware.firmware = [ pkgs.b43Firmware_5_1_138 ];
   };
 
diff --git a/nixos/modules/installer/cd-dvd/channel.nix b/nixos/modules/installer/cd-dvd/channel.nix
index bcf3dbb3f735..9aca5b89d258 100644
--- a/nixos/modules/installer/cd-dvd/channel.nix
+++ b/nixos/modules/installer/cd-dvd/channel.nix
@@ -11,7 +11,7 @@ let
   # CD.  These are installed into the "nixos" channel of the root
   # user, as expected by nixos-rebuild/nixos-install.
   channelSources = pkgs.runCommand "nixos-${config.system.nixosVersion}"
-    { expr = builtins.readFile ../../../lib/channel-expr.nix; }
+    { expr = readFile ../../../lib/channel-expr.nix; }
     ''
       mkdir -p $out/nixos
       cp -prd ${pkgs.path} $out/nixos/nixpkgs
diff --git a/nixos/modules/services/misc/disnix.nix b/nixos/modules/services/misc/disnix.nix
index 72b98d1f84a5..82526b154e7a 100644
--- a/nixos/modules/services/misc/disnix.nix
+++ b/nixos/modules/services/misc/disnix.nix
@@ -111,7 +111,7 @@ in
         // optionalAttrs (config.services.tomcat.enable) { tomcatPort = 8080; }
         // optionalAttrs (config.services.svnserve.enable) { svnBaseDir = config.services.svnserve.svnBaseDir; }
         // optionalAttrs (cfg.publishInfrastructure.enableAuthentication) (
-          optionalAttrs (config.services.mysql.enable) { mysqlUsername = "root"; mysqlPassword = builtins.readFile config.services.mysql.rootPassword; })
+          optionalAttrs (config.services.mysql.enable) { mysqlUsername = "root"; mysqlPassword = readFile config.services.mysql.rootPassword; })
         )
     ;
 
@@ -152,7 +152,7 @@ in
               ${concatMapStrings (infrastructureAttrName:
                 let infrastructureAttrValue = getAttr infrastructureAttrName (cfg.infrastructure);
                 in
-                if builtins.isInt infrastructureAttrValue then
+                if isInt infrastructureAttrValue then
                 ''${infrastructureAttrName}=${toString infrastructureAttrValue} \
                 ''
                 else
diff --git a/nixos/modules/services/networking/ssh/sshd.nix b/nixos/modules/services/networking/ssh/sshd.nix
index 7a2335847e3a..85b6ab1efecf 100644
--- a/nixos/modules/services/networking/ssh/sshd.nix
+++ b/nixos/modules/services/networking/ssh/sshd.nix
@@ -19,7 +19,7 @@ let
 
   knownHostsFile = pkgs.writeText "ssh_known_hosts" (
     flip concatMapStrings knownHosts (h:
-      "${concatStringsSep "," h.hostNames} ${builtins.readFile h.publicKeyFile}"
+      "${concatStringsSep "," h.hostNames} ${readFile h.publicKeyFile}"
     )
   );
 
@@ -59,7 +59,7 @@ let
       mode = "0444";
       source = pkgs.writeText "${u.name}-authorized_keys" ''
         ${concatStringsSep "\n" u.openssh.authorizedKeys.keys}
-        ${concatMapStrings (f: builtins.readFile f + "\n") u.openssh.authorizedKeys.keyFiles}
+        ${concatMapStrings (f: readFile f + "\n") u.openssh.authorizedKeys.keyFiles}
       '';
     };
     usersWithKeys = attrValues (flip filterAttrs config.users.extraUsers (n: u:
diff --git a/nixos/modules/services/torrent/transmission.nix b/nixos/modules/services/torrent/transmission.nix
index 063332d48628..68f9b0647c0e 100644
--- a/nixos/modules/services/torrent/transmission.nix
+++ b/nixos/modules/services/torrent/transmission.nix
@@ -15,7 +15,7 @@ let
   toOption = x:
     if x == true then "true"
     else if x == false then "false"
-    else if builtins.isInt x then toString x
+    else if isInt x then toString x
     else toString ''\"${x}\"'';
 
   # All lines in settings.json end with a ',' (comma), except for the last
diff --git a/nixos/modules/services/web-servers/apache-httpd/default.nix b/nixos/modules/services/web-servers/apache-httpd/default.nix
index d21b6da0e772..900948893489 100644
--- a/nixos/modules/services/web-servers/apache-httpd/default.nix
+++ b/nixos/modules/services/web-servers/apache-httpd/default.nix
@@ -17,8 +17,8 @@ let
   getPort = cfg: if cfg.port != 0 then cfg.port else if cfg.enableSSL then 443 else 80;
 
   extraModules = attrByPath ["extraModules"] [] mainCfg;
-  extraForeignModules = filter builtins.isAttrs extraModules;
-  extraApacheModules = filter (x: !(builtins.isAttrs x)) extraModules; # I'd prefer using builtins.isString here, but doesn't exist yet
+  extraForeignModules = filter isAttrs extraModules;
+  extraApacheModules = filter isString extraModules;
 
 
   makeServerInfo = cfg: {
diff --git a/nixos/modules/system/activation/activation-script.nix b/nixos/modules/system/activation/activation-script.nix
index e012c977164e..1545bcb8a1f9 100644
--- a/nixos/modules/system/activation/activation-script.nix
+++ b/nixos/modules/system/activation/activation-script.nix
@@ -71,7 +71,7 @@ in
 
             ${
               let
-                set' = mapAttrs (n: v: if builtins.isString v then noDepEntry v else v) set;
+                set' = mapAttrs (n: v: if isString v then noDepEntry v else v) set;
                 withHeadlines = addAttributeName set';
               in textClosureMap id (withHeadlines) (attrNames withHeadlines)
             }