diff --git a/lib/types.nix b/lib/types.nix index a7f9bf1946e..27b653ebb6c 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -103,7 +103,8 @@ rec { path = mkOptionType { name = "path"; # Hacky: there is no ‘isPath’ primop. - check = x: builtins.substring 0 1 (toString x) == "/"; + # need to check isString first because otherwise toString throws an error. + check = x: builtins.isString x && builtins.substring 0 1 (toString x) == "/"; merge = mergeOneOption; }; diff --git a/nixos/modules/config/system-path.nix b/nixos/modules/config/system-path.nix index 62390f452ba..d7979593f40 100644 --- a/nixos/modules/config/system-path.nix +++ b/nixos/modules/config/system-path.nix @@ -57,7 +57,7 @@ in environment = { systemPackages = mkOption { - type = types.listOf types.path; + type = types.listOf types.package; default = []; example = literalExample "[ pkgs.firefox pkgs.thunderbird ]"; description = ''