Merge branch 'no-toPath'

This commit is contained in:
Shea Levy 2018-09-06 08:09:53 -04:00
commit 18337f3ece
No known key found for this signature in database
GPG Key ID: 5C0BD6957D86FE27
11 changed files with 14 additions and 15 deletions

View File

@ -501,7 +501,7 @@ rec {
isStorePath = x: isStorePath = x:
isCoercibleToString x isCoercibleToString x
&& builtins.substring 0 1 (toString x) == "/" && builtins.substring 0 1 (toString x) == "/"
&& dirOf (builtins.toPath x) == builtins.storeDir; && dirOf x == builtins.storeDir;
/* Convert string to int /* Convert string to int
Obviously, it is a bit hacky to use fromJSON that way. Obviously, it is a bit hacky to use fromJSON that way.
@ -537,11 +537,10 @@ rec {
*/ */
readPathsFromFile = rootPath: file: readPathsFromFile = rootPath: file:
let let
root = toString rootPath;
lines = lib.splitString "\n" (builtins.readFile file); lines = lib.splitString "\n" (builtins.readFile file);
removeComments = lib.filter (line: line != "" && !(lib.hasPrefix "#" line)); removeComments = lib.filter (line: line != "" && !(lib.hasPrefix "#" line));
relativePaths = removeComments lines; relativePaths = removeComments lines;
absolutePaths = builtins.map (path: builtins.toPath (root + "/" + path)) relativePaths; absolutePaths = builtins.map (path: rootPath + "/${path}") relativePaths;
in in
absolutePaths; absolutePaths;

View File

@ -112,7 +112,7 @@ runTests {
storePathAppendix = isStorePath storePathAppendix = isStorePath
"${goodPath}/bin/python"; "${goodPath}/bin/python";
nonAbsolute = isStorePath (concatStrings (tail (stringToCharacters goodPath))); nonAbsolute = isStorePath (concatStrings (tail (stringToCharacters goodPath)));
asPath = isStorePath (builtins.toPath goodPath); asPath = isStorePath goodPath;
otherPath = isStorePath "/something/else"; otherPath = isStorePath "/something/else";
otherVals = { otherVals = {
attrset = isStorePath {}; attrset = isStorePath {};
@ -357,7 +357,7 @@ runTests {
int = 42; int = 42;
bool = true; bool = true;
string = ''fno"rd''; string = ''fno"rd'';
path = /. + "/foo"; # toPath returns a string path = /. + "/foo";
null_ = null; null_ = null;
function = x: x; function = x: x;
functionArgs = { arg ? 4, foo }: arg; functionArgs = { arg ? 4, foo }: arg;

View File

@ -28,7 +28,7 @@
let extraArgs_ = extraArgs; pkgs_ = pkgs; let extraArgs_ = extraArgs; pkgs_ = pkgs;
extraModules = let e = builtins.getEnv "NIXOS_EXTRA_MODULE_PATH"; extraModules = let e = builtins.getEnv "NIXOS_EXTRA_MODULE_PATH";
in if e == "" then [] else [(import (builtins.toPath e))]; in if e == "" then [] else [(import e)];
in in
let let

View File

@ -66,7 +66,7 @@ in
''; '';
}]; }];
security.wrappers = (import (builtins.toPath "${e.enlightenment}/e-wrappers.nix")).security.wrappers; security.wrappers = (import "${e.enlightenment}/e-wrappers.nix").security.wrappers;
environment.etc = singleton environment.etc = singleton
{ source = xcfg.xkbDir; { source = xcfg.xkbDir;

View File

@ -22,8 +22,8 @@ assert null == lib.findFirst (c: "/"==c) null (lib.stringToCharacters repository
assert null == lib.findFirst (c: "/"==c) null (lib.stringToCharacters imageName); assert null == lib.findFirst (c: "/"==c) null (lib.stringToCharacters imageName);
let let
# Abuse `builtins.toPath` to collapse possible double slashes # Abuse paths to collapse possible double slashes
repoTag0 = builtins.toString (builtins.toPath "/${stripScheme registry}/${repository}/${imageName}"); repoTag0 = builtins.toString (/. + "/${stripScheme registry}/${repository}/${imageName}");
repoTag1 = lib.removePrefix "/" repoTag0; repoTag1 = lib.removePrefix "/" repoTag0;
layers = builtins.map stripNixStore imageLayers; layers = builtins.map stripNixStore imageLayers;

View File

@ -49,7 +49,7 @@ stdenv.mkDerivation rec {
'' ''
patch -p1 \ patch -p1 \
--no-backup-if-mismatch \ --no-backup-if-mismatch \
-d $out/libexec/${name} < ${ ./. + builtins.toPath ("/make_standalone_toolchain.py_" + "${version}" + ".patch") } -d $out/libexec/${name} < ${ ./. + "/make_standalone_toolchain.py_${version}.patch" }
wrapProgram ${pkg_path}/build/tools/make_standalone_toolchain.py --prefix PATH : "${runtime_paths}" wrapProgram ${pkg_path}/build/tools/make_standalone_toolchain.py --prefix PATH : "${runtime_paths}"
'' ''
} }

View File

@ -1,7 +1,7 @@
{ appleDerivation_, applePackage, pkgs, stdenv }: { appleDerivation_, applePackage, pkgs, stdenv }:
name: version: sha256: args: let name: version: sha256: args: let
n = stdenv.lib.removePrefix "lib" name; n = stdenv.lib.removePrefix "lib" name;
makeFile = ../. + builtins.toPath "/${name}/GNUmakefile"; makeFile = ../. + "/${name}/GNUmakefile";
appleDerivation = appleDerivation_ name version sha256; appleDerivation = appleDerivation_ name version sha256;
in applePackage name version sha256 (args // { in applePackage name version sha256 (args // {
appleDerivation = a: appleDerivation = a:

View File

@ -17,7 +17,7 @@ let
buildInputs = [ readline ]; buildInputs = [ readline ];
patches = [ patches = [
(./. + (builtins.toPath "/dont-create-sysconfdir-${builtins.substring 0 1 version}.patch")) (./. + "/dont-create-sysconfdir-${builtins.substring 0 1 version}.patch")
]; ];
configureFlags = [ configureFlags = [

View File

@ -19,7 +19,7 @@ buildGoPackage rec {
-X main.version=${version} -X main.version=${version}
'' ]; '' ];
goDeps = ./. + builtins.toPath "/deps-${version}.nix"; goDeps = ./. + "/deps-${version}.nix";
meta = with lib; { meta = with lib; {
description = "The plugin-driven server agent for collecting & reporting metrics."; description = "The plugin-driven server agent for collecting & reporting metrics.";

View File

@ -20,7 +20,7 @@ buildGoPackage rec {
excludedPackages = "test"; excludedPackages = "test";
# Generated with the nix2go # Generated with the nix2go
goDeps = ./. + builtins.toPath "/deps-${version}.nix"; goDeps = ./. + "/deps-${version}.nix";
meta = with lib; { meta = with lib; {
description = "An open-source distributed time series database"; description = "An open-source distributed time series database";

View File

@ -35,7 +35,7 @@ let
mkUniquePkgs = pkgs: fastUnique (a: b: a < b) # highlighting hack: > mkUniquePkgs = pkgs: fastUnique (a: b: a < b) # highlighting hack: >
# here we deal with those dummy packages needed for hyphenation filtering # here we deal with those dummy packages needed for hyphenation filtering
(map (p: if lib.isDerivation p then builtins.toPath p else "") pkgs); (map (p: if lib.isDerivation p then p.outPath else "") pkgs);
in buildEnv { in buildEnv {
name = "texlive-${extraName}-${bin.texliveYear}"; name = "texlive-${extraName}-${bin.texliveYear}";