summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2018-11-11 14:28:08 +0100
committerFrederik Rietdijk <fridh@fridh.nl>2018-11-11 14:28:08 +0100
commit1d3bff25db1987ab7824f483ba0d6b316d8965b2 (patch)
treeb482c2a9d9d75db4e2571abe12af3596cea2660b /lib
parent5955c5113a39be8facd831ad86f03ed665d1655f (diff)
parent02bf0e589653d34dc919b32a1d3c67b0d0bb2335 (diff)
Merge staging-next into staging
Diffstat (limited to 'lib')
-rw-r--r--lib/licenses.nix5
-rw-r--r--lib/sources.nix6
-rw-r--r--lib/types.nix3
3 files changed, 11 insertions, 3 deletions
diff --git a/lib/licenses.nix b/lib/licenses.nix
index 092cbbbdb25a..e3803c098c72 100644
--- a/lib/licenses.nix
+++ b/lib/licenses.nix
@@ -13,6 +13,11 @@ lib.mapAttrs (n: v: v // { shortName = n; }) rec {
* add it to this list. The URL mentioned above is a good source for inspiration.
*/
+ abstyles = spdx {
+ spdxId = "Abstyles";
+ fullName = "Abstyles License";
+ };
+
afl21 = spdx {
spdxId = "AFL-2.1";
fullName = "Academic Free License v2.1";
diff --git a/lib/sources.nix b/lib/sources.nix
index e64b23414e86..1a9f3f7d1f34 100644
--- a/lib/sources.nix
+++ b/lib/sources.nix
@@ -73,7 +73,7 @@ rec {
# Get the commit id of a git repo
# Example: commitIdFromGitRepo <nixpkgs/.git>
commitIdFromGitRepo =
- let readCommitFromFile = path: file:
+ let readCommitFromFile = file: path:
with builtins;
let fileName = toString path + "/" + file;
packedRefsName = toString path + "/packed-refs";
@@ -85,7 +85,7 @@ rec {
matchRef = match "^ref: (.*)$" fileContent;
in if isNull matchRef
then fileContent
- else readCommitFromFile path (lib.head matchRef)
+ else readCommitFromFile (lib.head matchRef) path
# Sometimes, the file isn't there at all and has been packed away in the
# packed-refs file, so we have to grep through it:
else if lib.pathExists packedRefsName
@@ -96,7 +96,7 @@ rec {
then throw ("Could not find " + file + " in " + packedRefsName)
else lib.head matchRef
else throw ("Not a .git directory: " + path);
- in lib.flip readCommitFromFile "HEAD";
+ in readCommitFromFile "HEAD";
pathHasContext = builtins.hasContext or (lib.hasPrefix builtins.storeDir);
diff --git a/lib/types.nix b/lib/types.nix
index ca6794e274c3..d1ece2402ad7 100644
--- a/lib/types.nix
+++ b/lib/types.nix
@@ -169,6 +169,9 @@ rec {
# s32 = sign 32 4294967296;
};
+ # Alias of u16 for a port number
+ port = ints.u16;
+
float = mkOptionType rec {
name = "float";
description = "floating point number";