diff options
author | Silvan Mosberger <infinisil@icloud.com> | 2019-08-08 22:48:27 +0200 |
---|---|---|
committer | Silvan Mosberger <infinisil@icloud.com> | 2019-08-31 18:19:00 +0200 |
commit | 478e7184f88db1364cc75107036f7c4decc0cc41 (patch) | |
tree | 5ff3d3a18e3aef9af4333c392a94751333754270 /pkgs/build-support/writers | |
parent | 69d58ee24506e2b3b5aff347ae3b0791110340ec (diff) | |
download | nixpkgs-478e7184f88db1364cc75107036f7c4decc0cc41.tar nixpkgs-478e7184f88db1364cc75107036f7c4decc0cc41.tar.gz nixpkgs-478e7184f88db1364cc75107036f7c4decc0cc41.tar.bz2 nixpkgs-478e7184f88db1364cc75107036f7c4decc0cc41.tar.lz nixpkgs-478e7184f88db1364cc75107036f7c4decc0cc41.tar.xz nixpkgs-478e7184f88db1364cc75107036f7c4decc0cc41.tar.zst nixpkgs-478e7184f88db1364cc75107036f7c4decc0cc41.zip |
nixos/modules: Remove all usages of types.string
And replace them with a more appropriate type Also fix up some minor module problems along the way
Diffstat (limited to 'pkgs/build-support/writers')
-rw-r--r-- | pkgs/build-support/writers/default.nix | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pkgs/build-support/writers/default.nix b/pkgs/build-support/writers/default.nix index ae7b42449fb..8dbe0dbdbd0 100644 --- a/pkgs/build-support/writers/default.nix +++ b/pkgs/build-support/writers/default.nix @@ -10,12 +10,12 @@ rec { # makeScriptWriter { interpreter = "${pkgs.dash}/bin/dash"; } "hello" "echo hello world" makeScriptWriter = { interpreter, check ? "" }: nameOrPath: content: assert lib.or (types.path.check nameOrPath) (builtins.match "([0-9A-Za-z._])[0-9A-Za-z._-]*" nameOrPath != null); - assert lib.or (types.path.check content) (types.string.check content); + assert lib.or (types.path.check content) (types.str.check content); let name = last (builtins.split "/" nameOrPath); in - pkgs.runCommand name (if (types.string.check content) then { + pkgs.runCommand name (if (types.str.check content) then { inherit content interpreter; passAsFile = [ "content" ]; } else { @@ -42,11 +42,11 @@ rec { # writeSimpleC = makeBinWriter { compileScript = name: "gcc -o $out $contentPath"; } makeBinWriter = { compileScript }: nameOrPath: content: assert lib.or (types.path.check nameOrPath) (builtins.match "([0-9A-Za-z._])[0-9A-Za-z._-]*" nameOrPath != null); - assert lib.or (types.path.check content) (types.string.check content); + assert lib.or (types.path.check content) (types.str.check content); let name = last (builtins.split "/" nameOrPath); in - pkgs.runCommand name (if (types.string.check content) then { + pkgs.runCommand name (if (types.str.check content) then { inherit content; passAsFile = [ "content" ]; } else { |