summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--nixos/modules/system/boot/networkd.nix7
-rw-r--r--nixos/modules/system/boot/systemd-lib.nix63
-rw-r--r--nixos/modules/system/boot/systemd-unit-options.nix51
-rw-r--r--nixos/modules/system/boot/systemd.nix18
-rw-r--r--pkgs/applications/version-management/smartgithg/default.nix6
-rw-r--r--pkgs/tools/cd-dvd/dvdisaster/default.nix4
6 files changed, 75 insertions, 74 deletions
diff --git a/nixos/modules/system/boot/networkd.nix b/nixos/modules/system/boot/networkd.nix
index 0221374ab835..b183c0f32366 100644
--- a/nixos/modules/system/boot/networkd.nix
+++ b/nixos/modules/system/boot/networkd.nix
@@ -132,7 +132,7 @@ let
   commonNetworkOptions = {
 
     enable = mkOption {
-      default = false;
+      default = true;
       type = types.bool;
       description = ''
         Whether to manage network configuration using <command>systemd-network</command>.
@@ -482,6 +482,11 @@ let
     };
   };
 
+  commonMatchText = def: ''
+    [Match]
+    ${attrsToSection def.matchConfig}
+  '';
+
   linkToUnit = name: def:
     { inherit (def) enable;
       text = commonMatchText def +
diff --git a/nixos/modules/system/boot/systemd-lib.nix b/nixos/modules/system/boot/systemd-lib.nix
index e8cfd3395cb0..873fff15d384 100644
--- a/nixos/modules/system/boot/systemd-lib.nix
+++ b/nixos/modules/system/boot/systemd-lib.nix
@@ -25,6 +25,69 @@ rec {
           ln -s /dev/null $out/${shellEscape name}
         '';
 
+  boolValues = [true false "yes" "no"];
+
+  digits = map toString (range 0 9);
+
+  isByteFormat = s:
+    let
+      l = reverseList (stringToCharacters s);
+      suffix = head l;
+      nums = tail l;
+    in elem suffix (["K" "M" "G" "T"] ++ digits)
+      && all (num: elem num digits) nums;
+
+  assertByteFormat = name: group: attr:
+    optional (attr ? ${name} && ! isByteFormat attr.${name})
+      "Systemd ${group} field `${name}' must be in byte format [0-9]+[KMGT].";
+
+  hexChars = stringToCharacters "0123456789abcdefABCDEF";
+
+  isMacAddress = s: stringLength s == 17
+    && flip all (splitString ":" s) (bytes:
+      all (byte: elem byte hexChars) (stringToCharacters bytes)
+    );
+
+  assertMacAddress = name: group: attr:
+    optional (attr ? ${name} && ! isMacAddress attr.${name})
+      "Systemd ${group} field `${name}' must be a valid mac address.";
+
+
+  assertValueOneOf = name: values: group: attr:
+    optional (attr ? ${name} && !elem attr.${name} values)
+      "Systemd ${group} field `${name}' cannot have value `${attr.${name}}'.";
+
+  assertHasField = name: group: attr:
+    optional (!(attr ? ${name}))
+      "Systemd ${group} field `${name}' must exist.";
+
+  assertRange = name: min: max: group: attr:
+    optional (attr ? ${name} && !(min <= attr.${name} && max >= attr.${name}))
+      "Systemd ${group} field `${name}' is outside the range [${toString min},${toString max}]";
+
+  assertOnlyFields = fields: group: attr:
+    let badFields = filter (name: ! elem name fields) (attrNames attr); in
+    optional (badFields != [ ])
+      "Systemd ${group} has extra fields [${concatStringsSep " " badFields}].";
+
+  checkUnitConfig = group: checks: v:
+    let errors = concatMap (c: c group v) checks; in
+    if errors == [] then true
+      else builtins.trace (concatStringsSep "\n" errors) false;
+
+  toOption = x:
+    if x == true then "true"
+    else if x == false then "false"
+    else toString x;
+
+  attrsToSection = as:
+    concatStrings (concatLists (mapAttrsToList (name: value:
+      map (x: ''
+          ${name}=${toOption x}
+        '')
+        (if isList value then value else [value]))
+        as));
+
   generateUnits = type: units: upstreamUnits: upstreamWants:
     pkgs.runCommand "${type}-units" { preferLocalBuild = true; } ''
       mkdir -p $out
diff --git a/nixos/modules/system/boot/systemd-unit-options.nix b/nixos/modules/system/boot/systemd-unit-options.nix
index 785634cbf66a..57831a5e6ef3 100644
--- a/nixos/modules/system/boot/systemd-unit-options.nix
+++ b/nixos/modules/system/boot/systemd-unit-options.nix
@@ -1,58 +1,9 @@
 { config, lib }:
 
 with lib;
+with import ./systemd-lib.nix { inherit config lib pkgs; };
 
 let
-
-  boolValues = [true false "yes" "no"];
-
-  assertValueOneOf = name: values: group: attr:
-    optional (attr ? ${name} && !elem attr.${name} values)
-      "Systemd ${group} field `${name}' cannot have value `${attr.${name}}'.";
-
-  assertHasField = name: group: attr:
-    optional (!(attr ? ${name}))
-      "Systemd ${group} field `${name}' must exist.";
-
-  assertOnlyFields = fields: group: attr:
-    let badFields = filter (name: ! elem name fields) (attrNames attr); in
-    optional (badFields != [ ])
-      "Systemd ${group} has extra fields [${concatStringsSep " " badFields}].";
-
-  assertRange = name: min: max: group: attr:
-    optional (attr ? ${name} && !(min <= attr.${name} && max >= attr.${name}))
-      "Systemd ${group} field `${name}' is outside the range [${toString min},${toString max}]";
-
-  digits = map toString (range 0 9);
-
-  isByteFormat = s:
-    let
-      l = reverseList (stringToCharacters s);
-      suffix = head l;
-      nums = tail l;
-    in elem suffix (["K" "M" "G" "T"] ++ digits)
-      && all (num: elem num digits) nums;
-
-  assertByteFormat = name: group: attr:
-    optional (attr ? ${name} && ! isByteFormat attr.${name})
-      "Systemd ${group} field `${name}' must be in byte format [0-9]+[KMGT].";
-
-  hexChars = stringToCharacters "0123456789abcdefABCDEF";
-
-  isMacAddress = s: stringLength s == 17
-    && flip all (splitString ":" s) (bytes:
-      all (byte: elem byte hexChars) (stringToCharacters bytes)
-    );
-
-  assertMacAddress = name: group: attr:
-    optional (attr ? ${name} && ! isMacAddress attr.${name})
-      "Systemd ${group} field `${name}' must be a valid mac address.";
-
-  checkUnitConfig = group: checks: v:
-    let errors = concatMap (c: c group v) checks; in
-    if errors == [] then true
-      else builtins.trace (concatStringsSep "\n" errors) false;
-
   checkService = checkUnitConfig "Service" [
     (assertValueOneOf "Type" [
       "simple" "forking" "oneshot" "dbus" "notify" "idle"
diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix
index 78aac7fe96f1..0f210d506881 100644
--- a/nixos/modules/system/boot/systemd.nix
+++ b/nixos/modules/system/boot/systemd.nix
@@ -276,19 +276,6 @@ let
     };
   };
 
-  toOption = x:
-    if x == true then "true"
-    else if x == false then "false"
-    else toString x;
-
-  attrsToSection = as:
-    concatStrings (concatLists (mapAttrsToList (name: value:
-      map (x: ''
-          ${name}=${toOption x}
-        '')
-        (if isList value then value else [value]))
-        as));
-
   commonUnitText = def: ''
       [Unit]
       ${attrsToSection def.unitConfig}
@@ -369,11 +356,6 @@ let
         '';
     };
 
-  commonMatchText = def: ''
-      [Match]
-      ${attrsToSection def.matchConfig}
-    '';
-
 in
 
 {
diff --git a/pkgs/applications/version-management/smartgithg/default.nix b/pkgs/applications/version-management/smartgithg/default.nix
index 5bb201b60d00..f2a2fadae8c7 100644
--- a/pkgs/applications/version-management/smartgithg/default.nix
+++ b/pkgs/applications/version-management/smartgithg/default.nix
@@ -7,7 +7,7 @@
 }:
 
 let
-  the_version = "6_5_3";
+  the_version = "6_5_7";
 
 in
 
@@ -15,9 +15,9 @@ stdenv.mkDerivation rec {
   name = "smartgithg-${the_version}";
 
   src = fetchurl {
-    url = "http://www.syntevo.com/download/smartgit/" +
+    url = "http://www.syntevo.com/downloads/smartgit/" +
           "smartgit-generic-${the_version}.tar.gz";
-    sha256 = "0hz1y29ipls58fizr27w6rbv7v7qbbc1h70xvjjd8c94k9ajmav9";
+    sha256 = "0db4dxp0dl173z9r8n25zdl1il240p751d2f77cw0nmyibik7q4l";
   };
 
   buildInputs = [
diff --git a/pkgs/tools/cd-dvd/dvdisaster/default.nix b/pkgs/tools/cd-dvd/dvdisaster/default.nix
index 704c3643f3c8..101d69c0903b 100644
--- a/pkgs/tools/cd-dvd/dvdisaster/default.nix
+++ b/pkgs/tools/cd-dvd/dvdisaster/default.nix
@@ -41,9 +41,9 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     homepage = http://dvdisaster.net/;
-    description = "data loss/scratch/aging protection for CD/DVD media";
+    description = "Data loss/scratch/aging protection for CD/DVD media";
     longDescription = ''
-      dvdisaster provides a margin of safety against data loss on CD and
+      Dvdisaster provides a margin of safety against data loss on CD and
       DVD media caused by scratches or aging media. It creates error correction
       data which is used to recover unreadable sectors if the disc becomes
       damaged at a later time.