diff --git a/lib/tests/misc.nix b/lib/tests/misc.nix index 584a946e92cc..9b1397a7915a 100644 --- a/lib/tests/misc.nix +++ b/lib/tests/misc.nix @@ -1206,4 +1206,57 @@ runTests { expr = strings.levenshteinAtMost 3 "hello" "Holla"; expected = true; }; + + testTypeDescriptionInt = { + expr = (with types; int).description; + expected = "signed integer"; + }; + testTypeDescriptionListOfInt = { + expr = (with types; listOf int).description; + expected = "list of signed integer"; + }; + testTypeDescriptionListOfListOfInt = { + expr = (with types; listOf (listOf int)).description; + expected = "list of list of signed integer"; + }; + testTypeDescriptionListOfEitherStrOrBool = { + expr = (with types; listOf (either str bool)).description; + expected = "list of (string or boolean)"; + }; + testTypeDescriptionEitherListOfStrOrBool = { + expr = (with types; either (listOf bool) str).description; + expected = "(list of boolean) or string"; + }; + testTypeDescriptionEitherStrOrListOfBool = { + expr = (with types; either str (listOf bool)).description; + expected = "string or list of boolean"; + }; + testTypeDescriptionOneOfListOfStrOrBool = { + expr = (with types; oneOf [ (listOf bool) str ]).description; + expected = "(list of boolean) or string"; + }; + testTypeDescriptionOneOfListOfStrOrBoolOrNumber = { + expr = (with types; oneOf [ (listOf bool) str number ]).description; + expected = "(list of boolean) or string or signed integer or floating point number"; + }; + testTypeDescriptionEitherListOfBoolOrEitherStringOrNumber = { + expr = (with types; either (listOf bool) (either str number)).description; + expected = "(list of boolean) or string or signed integer or floating point number"; + }; + testTypeDescriptionEitherEitherListOfBoolOrStringOrNumber = { + expr = (with types; either (either (listOf bool) str) number).description; + expected = "(list of boolean) or string or signed integer or floating point number"; + }; + testTypeDescriptionEitherNullOrBoolOrString = { + expr = (with types; either (nullOr bool) str).description; + expected = "null or boolean or string"; + }; + testTypeDescriptionEitherListOfEitherBoolOrStrOrInt = { + expr = (with types; either (listOf (either bool str)) int).description; + expected = "(list of (boolean or string)) or signed integer"; + }; + testTypeDescriptionEitherIntOrListOrEitherBoolOrStr = { + expr = (with types; either int (listOf (either bool str))).description; + expected = "signed integer or list of (boolean or string)"; + }; } diff --git a/lib/types.nix b/lib/types.nix index f235e3419926..3750ba965558 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -113,6 +113,12 @@ rec { name , # Description of the type, defined recursively by embedding the wrapped type if any. description ? null + # A hint for whether or not this description needs parentheses. Possible values: + # - "noun": a simple noun phrase such as "positive integer" + # - "conjunction": a phrase with a potentially ambiguous "or" connective. + # - "composite": a phrase with an "of" connective + # See the `optionDescriptionPhrase` function. + , descriptionClass ? null , # Function applied to each definition that should return true if # its type-correct, false otherwise. check ? (x: true) @@ -158,10 +164,36 @@ rec { nestedTypes ? {} }: { _type = "option-type"; - inherit name check merge emptyValue getSubOptions getSubModules substSubModules typeMerge functor deprecationMessage nestedTypes; + inherit + name check merge emptyValue getSubOptions getSubModules substSubModules + typeMerge functor deprecationMessage nestedTypes descriptionClass; description = if description == null then name else description; }; + # optionDescriptionPhrase :: (str -> bool) -> optionType -> str + # + # Helper function for producing unambiguous but readable natural language + # descriptions of types. + # + # Parameters + # + # optionDescriptionPhase unparenthesize optionType + # + # `unparenthesize`: A function from descriptionClass string to boolean. + # It must return true when the class of phrase will fit unambiguously into + # the description of the caller. + # + # `optionType`: The option type to parenthesize or not. + # The option whose description we're returning. + # + # Return value + # + # The description of the `optionType`, with parentheses if there may be an + # ambiguity. + optionDescriptionPhrase = unparenthesize: t: + if unparenthesize (t.descriptionClass or null) + then t.description + else "(${t.description})"; # When adding new types don't forget to document them in # nixos/doc/manual/development/option-types.xml! @@ -170,6 +202,7 @@ rec { raw = mkOptionType rec { name = "raw"; description = "raw value"; + descriptionClass = "noun"; check = value: true; merge = mergeOneOption; }; @@ -177,6 +210,7 @@ rec { anything = mkOptionType { name = "anything"; description = "anything"; + descriptionClass = "noun"; check = value: true; merge = loc: defs: let @@ -216,12 +250,14 @@ rec { }; unspecified = mkOptionType { - name = "unspecified"; + name = "unspecified value"; + descriptionClass = "noun"; }; bool = mkOptionType { name = "bool"; description = "boolean"; + descriptionClass = "noun"; check = isBool; merge = mergeEqualOption; }; @@ -229,6 +265,7 @@ rec { int = mkOptionType { name = "int"; description = "signed integer"; + descriptionClass = "noun"; check = isInt; merge = mergeEqualOption; }; @@ -294,6 +331,7 @@ rec { float = mkOptionType { name = "float"; description = "floating point number"; + descriptionClass = "noun"; check = isFloat; merge = mergeEqualOption; }; @@ -325,6 +363,7 @@ rec { str = mkOptionType { name = "str"; description = "string"; + descriptionClass = "noun"; check = isString; merge = mergeEqualOption; }; @@ -332,6 +371,7 @@ rec { nonEmptyStr = mkOptionType { name = "nonEmptyStr"; description = "non-empty string"; + descriptionClass = "noun"; check = x: str.check x && builtins.match "[ \t\n]*" x == null; inherit (str) merge; }; @@ -344,6 +384,7 @@ rec { mkOptionType { name = "singleLineStr"; description = "(optionally newline-terminated) single-line string"; + descriptionClass = "noun"; inherit check; merge = loc: defs: lib.removeSuffix "\n" (merge loc defs); @@ -352,6 +393,7 @@ rec { strMatching = pattern: mkOptionType { name = "strMatching ${escapeNixString pattern}"; description = "string matching the pattern ${pattern}"; + descriptionClass = "noun"; check = x: str.check x && builtins.match pattern x != null; inherit (str) merge; }; @@ -364,6 +406,7 @@ rec { then "Concatenated string" # for types.string. else "strings concatenated with ${builtins.toJSON sep}" ; + descriptionClass = "noun"; check = isString; merge = loc: defs: concatStringsSep sep (getValues defs); functor = (defaultFunctor name) // { @@ -387,7 +430,7 @@ rec { passwdEntry = entryType: addCheck entryType (str: !(hasInfix ":" str || hasInfix "\n" str)) // { name = "passwdEntry ${entryType.name}"; - description = "${entryType.description}, not containing newlines or colons"; + description = "${optionDescriptionPhrase (class: class == "noun") entryType}, not containing newlines or colons"; }; attrs = mkOptionType { @@ -407,6 +450,7 @@ rec { # ("/nix/store/hash-foo"). These get a context added to them using builtins.storePath. package = mkOptionType { name = "package"; + descriptionClass = "noun"; check = x: isDerivation x || isStorePath x; merge = loc: defs: let res = mergeOneOption loc defs; @@ -427,7 +471,8 @@ rec { listOf = elemType: mkOptionType rec { name = "listOf"; - description = "list of ${elemType.description}"; + description = "list of ${optionDescriptionPhrase (class: class == "noun" || class == "composite") elemType}"; + descriptionClass = "composite"; check = isList; merge = loc: defs: map (x: x.value) (filter (x: x ? value) (concatLists (imap1 (n: def: @@ -450,13 +495,14 @@ rec { nonEmptyListOf = elemType: let list = addCheck (types.listOf elemType) (l: l != []); in list // { - description = "non-empty " + list.description; + description = "non-empty ${optionDescriptionPhrase (class: class == "noun") list}"; emptyValue = { }; # no .value attr, meaning unset }; attrsOf = elemType: mkOptionType rec { name = "attrsOf"; - description = "attribute set of ${elemType.description}"; + description = "attribute set of ${optionDescriptionPhrase (class: class == "noun" || class == "composite") elemType}"; + descriptionClass = "composite"; check = isAttrs; merge = loc: defs: mapAttrs (n: v: v.value) (filterAttrs (n: v: v ? value) (zipAttrsWith (name: defs: @@ -479,7 +525,8 @@ rec { # error that it's not defined. Use only if conditional definitions don't make sense. lazyAttrsOf = elemType: mkOptionType rec { name = "lazyAttrsOf"; - description = "lazy attribute set of ${elemType.description}"; + description = "lazy attribute set of ${optionDescriptionPhrase (class: class == "noun" || class == "composite") elemType}"; + descriptionClass = "composite"; check = isAttrs; merge = loc: defs: zipAttrsWith (name: defs: @@ -509,7 +556,7 @@ rec { # Value of given type but with no merging (i.e. `uniq list`s are not concatenated). uniq = elemType: mkOptionType rec { name = "uniq"; - inherit (elemType) description check; + inherit (elemType) description descriptionClass check; merge = mergeOneOption; emptyValue = elemType.emptyValue; getSubOptions = elemType.getSubOptions; @@ -521,7 +568,7 @@ rec { unique = { message }: type: mkOptionType rec { name = "unique"; - inherit (type) description check; + inherit (type) description descriptionClass check; merge = mergeUniqueOption { inherit message; }; emptyValue = type.emptyValue; getSubOptions = type.getSubOptions; @@ -534,7 +581,8 @@ rec { # Null or value of ... nullOr = elemType: mkOptionType rec { name = "nullOr"; - description = "null or ${elemType.description}"; + description = "null or ${optionDescriptionPhrase (class: class == "noun" || class == "conjunction") elemType}"; + descriptionClass = "conjunction"; check = x: x == null || elemType.check x; merge = loc: defs: let nrNulls = count (def: def.value == null) defs; in @@ -552,7 +600,8 @@ rec { functionTo = elemType: mkOptionType { name = "functionTo"; - description = "function that evaluates to a(n) ${elemType.description}"; + description = "function that evaluates to a(n) ${optionDescriptionPhrase (class: class == "noun" || class == "composite") elemType}"; + descriptionClass = "composite"; check = isFunction; merge = loc: defs: fnArgs: (mergeDefinitions (loc ++ [ "[function body]" ]) elemType (map (fn: { inherit (fn) file; value = fn.value fnArgs; }) defs)).mergedValue; @@ -578,6 +627,7 @@ rec { deferredModuleWith = attrs@{ staticModules ? [] }: mkOptionType { name = "deferredModule"; description = "module"; + descriptionClass = "noun"; check = x: isAttrs x || isFunction x || path.check x; merge = loc: defs: { imports = staticModules ++ map (def: lib.setDefaultModuleLocation "${def.file}, via option ${showOption loc}" def.value) defs; @@ -603,6 +653,7 @@ rec { optionType = mkOptionType { name = "optionType"; description = "optionType"; + descriptionClass = "noun"; check = value: value._type or null == "option-type"; merge = loc: defs: if length defs == 1 @@ -749,6 +800,10 @@ rec { "value ${show (builtins.head values)} (singular enum)" else "one of ${concatMapStringsSep ", " show values}"; + descriptionClass = + if builtins.length values < 2 + then "noun" + else "conjunction"; check = flip elem values; merge = mergeEqualOption; functor = (defaultFunctor name) // { payload = values; binOp = a: b: unique (a ++ b); }; @@ -757,7 +812,8 @@ rec { # Either value of type `t1` or `t2`. either = t1: t2: mkOptionType rec { name = "either"; - description = "${t1.description} or ${t2.description}"; + description = "${optionDescriptionPhrase (class: class == "noun" || class == "conjunction") t1} or ${optionDescriptionPhrase (class: class == "noun" || class == "conjunction" || class == "composite") t2}"; + descriptionClass = "conjunction"; check = x: t1.check x || t2.check x; merge = loc: defs: let @@ -795,7 +851,7 @@ rec { coercedType.description})"; mkOptionType rec { name = "coercedTo"; - description = "${finalType.description} or ${coercedType.description} convertible to it"; + description = "${optionDescriptionPhrase (class: class == "noun") finalType} or ${optionDescriptionPhrase (class: class == "noun") coercedType} convertible to it"; check = x: (coercedType.check x && finalType.check (coerceFunc x)) || finalType.check x; merge = loc: defs: let diff --git a/nixos/modules/services/hardware/usbrelayd.nix b/nixos/modules/services/hardware/usbrelayd.nix index d45edb149c01..01d3a5ba8bee 100644 --- a/nixos/modules/services/hardware/usbrelayd.nix +++ b/nixos/modules/services/hardware/usbrelayd.nix @@ -34,10 +34,6 @@ in services.udev.packages = [ pkgs.usbrelayd ]; systemd.packages = [ pkgs.usbrelayd ]; - users.users.usbrelay = { - isSystemUser = true; - group = "usbrelay"; - }; users.groups.usbrelay = { }; }; diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index bcdc88ff63df..a3bff27626d8 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -121,7 +121,7 @@ let "final.target" "kexec.target" "systemd-kexec.service" - ] ++ lib.optional (cfg.package.withUtmp or true) "systemd-update-utmp.service" ++ [ + ] ++ lib.optional cfg.package.withUtmp "systemd-update-utmp.service" ++ [ # Password entry. "systemd-ask-password-console.path" diff --git a/pkgs/applications/misc/madonctl/default.nix b/pkgs/applications/misc/madonctl/default.nix index 2a65fc25af2f..141bdac87da7 100644 --- a/pkgs/applications/misc/madonctl/default.nix +++ b/pkgs/applications/misc/madonctl/default.nix @@ -1,31 +1,38 @@ -{ lib, buildGoPackage, fetchFromGitHub }: +{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, madonctl }: -buildGoPackage rec { +buildGoModule rec { pname = "madonctl"; - version = "1.1.0"; - - goPackagePath = "github.com/McKael/madonctl"; + version = "2.3.2"; src = fetchFromGitHub { owner = "McKael"; repo = "madonctl"; - rev = "v${version}"; - sha256 = "1dnc1xaafhwhhf5afhb0wc2wbqq0s1r7qzj5k0xzc58my541gadc"; + rev = "v${version}"; + sha256 = "sha256-mo185EKjLkiujAKcAFM1XqkXWvcfYbnv+r3dF9ywaf8="; }; - # How to update: - # go get -u github.com/McKael/madonctl - # cd $GOPATH/src/github.com/McKael/madonctl - # git checkout v - # go2nix save + vendorSha256 = null; - goDeps = ./deps.nix; + nativeBuildInputs = [ installShellFiles ]; + + ldflags = [ "-s" "-w" ]; + + postInstall = '' + installShellCompletion --cmd madonctl \ + --bash <($out/bin/madonctl completion bash) \ + --zsh <($out/bin/madonctl completion zsh) + ''; + + passthru.tests.version = testers.testVersion { + package = madonctl; + command = "madonctl version"; + }; meta = with lib; { description = "CLI for the Mastodon social network API"; homepage = "https://github.com/McKael/madonctl"; license = licenses.mit; platforms = platforms.unix; - maintainers = with maintainers; [ ]; + maintainers = with maintainers; [ aaronjheng ]; }; } diff --git a/pkgs/applications/misc/madonctl/deps.nix b/pkgs/applications/misc/madonctl/deps.nix deleted file mode 100644 index 9f94bb09ce4e..000000000000 --- a/pkgs/applications/misc/madonctl/deps.nix +++ /dev/null @@ -1,228 +0,0 @@ -# This file was generated by https://github.com/kamilchm/go2nix v1.2.0 -[ - { - goPackagePath = "github.com/McKael/madon"; - fetch = { - type = "git"; - url = "https://github.com/McKael/madon"; - rev = "e580cd41ac42bbb0b2ea5b3843b3f1f854db357c"; - sha256 = "0jvvfkf3wlzisvcq54xv3jxncx178ks5wxd6cx8k8215437b3hra"; - }; - } - { - goPackagePath = "github.com/fsnotify/fsnotify"; - fetch = { - type = "git"; - url = "https://github.com/fsnotify/fsnotify"; - rev = "4da3e2cfbabc9f751898f250b49f2439785783a1"; - sha256 = "1y2l9jaf99j6gidcfdgq3hifxyiwv4f7awpll80p170ixdbqxvl3"; - }; - } - { - goPackagePath = "github.com/ghodss/yaml"; - fetch = { - type = "git"; - url = "https://github.com/ghodss/yaml"; - rev = "0ca9ea5df5451ffdf184b4428c902747c2c11cd7"; - sha256 = "0skwmimpy7hlh7pva2slpcplnm912rp3igs98xnqmn859kwa5v8g"; - }; - } - { - goPackagePath = "github.com/gorilla/websocket"; - fetch = { - type = "git"; - url = "https://github.com/gorilla/websocket"; - rev = "a91eba7f97777409bc2c443f5534d41dd20c5720"; - sha256 = "13cg6wwkk2ddqbm0nh9fpx4mq7f6qym12ch4lvs53n028ycdgw87"; - }; - } - { - goPackagePath = "github.com/hashicorp/hcl"; - fetch = { - type = "git"; - url = "https://github.com/hashicorp/hcl"; - rev = "392dba7d905ed5d04a5794ba89f558b27e2ba1ca"; - sha256 = "1rfm67kma2hpakabf7hxlj196jags4rpjpcirwg4kan4g9b6j0kb"; - }; - } - { - goPackagePath = "github.com/kr/text"; - fetch = { - type = "git"; - url = "https://github.com/kr/text"; - rev = "7cafcd837844e784b526369c9bce262804aebc60"; - sha256 = "0br693pf6vdr1sfvzdz6zxq7hjpdgci0il4wj0v636r8lyy21vsx"; - }; - } - { - goPackagePath = "github.com/m0t0k1ch1/gomif"; - fetch = { - type = "git"; - url = "https://github.com/m0t0k1ch1/gomif"; - rev = "f5864f63e1ed5a138f015cc2cb71a2e99c148d21"; - sha256 = "0djg8chax1g0m02xz84ic19758jzv5m50b7vpwjkpjk3181j5z9k"; - }; - } - { - goPackagePath = "github.com/magiconair/properties"; - fetch = { - type = "git"; - url = "https://github.com/magiconair/properties"; - rev = "51463bfca2576e06c62a8504b5c0f06d61312647"; - sha256 = "0d7hr78y8gg2mrm5z4jjgm2w3awkznz383b7wvyzk3l33jw6i288"; - }; - } - { - goPackagePath = "github.com/mattn/go-isatty"; - fetch = { - type = "git"; - url = "https://github.com/mattn/go-isatty"; - rev = "fc9e8d8ef48496124e79ae0df75490096eccf6fe"; - sha256 = "1r5f9gkavkb1w6sr0qs5kj16706xirl3qnlq3hqpszkw9w27x65a"; - }; - } - { - goPackagePath = "github.com/mitchellh/mapstructure"; - fetch = { - type = "git"; - url = "https://github.com/mitchellh/mapstructure"; - rev = "cc8532a8e9a55ea36402aa21efdf403a60d34096"; - sha256 = "0705c0hq7b993sabnjy65yymvpy9w1j84bg9bjczh5607z16nw86"; - }; - } - { - goPackagePath = "github.com/pelletier/go-buffruneio"; - fetch = { - type = "git"; - url = "https://github.com/pelletier/go-buffruneio"; - rev = "c37440a7cf42ac63b919c752ca73a85067e05992"; - sha256 = "0l83p1gg6g5mmhmxjisrhfimhbm71lwn1r2w7d6siwwqm9q08sd2"; - }; - } - { - goPackagePath = "github.com/pelletier/go-toml"; - fetch = { - type = "git"; - url = "https://github.com/pelletier/go-toml"; - rev = "5c26a6ff6fd178719e15decac1c8196da0d7d6d1"; - sha256 = "0f4l7mq0nb2p2vjfjqx251s6jzkl646n1vw45chykwvv1sbad8nq"; - }; - } - { - goPackagePath = "github.com/pkg/errors"; - fetch = { - type = "git"; - url = "https://github.com/pkg/errors"; - rev = "c605e284fe17294bda444b34710735b29d1a9d90"; - sha256 = "1izjk4msnc6wn1mclg0ypa6i31zfwb1r3032k8q4jfbd57hp0bz6"; - }; - } - { - goPackagePath = "github.com/sendgrid/rest"; - fetch = { - type = "git"; - url = "https://github.com/sendgrid/rest"; - rev = "14de1ac72d9ae5c3c0d7c02164c52ebd3b951a4e"; - sha256 = "0wrggvgnqdmhscim52hvhg77jhksprxp52sc4ipd69kasd32b5dm"; - }; - } - { - goPackagePath = "github.com/spf13/afero"; - fetch = { - type = "git"; - url = "https://github.com/spf13/afero"; - rev = "9be650865eab0c12963d8753212f4f9c66cdcf12"; - sha256 = "12dhh6d07304lsjv7c4p95hkip0hnshqhwivdw39pbypgg0p8y34"; - }; - } - { - goPackagePath = "github.com/spf13/cast"; - fetch = { - type = "git"; - url = "https://github.com/spf13/cast"; - rev = "acbeb36b902d72a7a4c18e8f3241075e7ab763e4"; - sha256 = "0w25s6gjbbwv47b9208hysyqqphd6pib3d2phg24mjy4wigkm050"; - }; - } - { - goPackagePath = "github.com/spf13/cobra"; - fetch = { - type = "git"; - url = "https://github.com/spf13/cobra"; - rev = "ca5710c94eabe15aa1f74490b8e5976dc652e8c6"; - sha256 = "1z5fxh9akwn95av6ra8p6804nhyxjc63m0s6abxi3l424n30b08i"; - }; - } - { - goPackagePath = "github.com/spf13/jwalterweatherman"; - fetch = { - type = "git"; - url = "https://github.com/spf13/jwalterweatherman"; - rev = "8f07c835e5cc1450c082fe3a439cf87b0cbb2d99"; - sha256 = "1dhl6kdbyczhnsgiyc8mcb7kmxd9garx8gy3q2gx5mmv96xxzxx7"; - }; - } - { - goPackagePath = "github.com/spf13/pflag"; - fetch = { - type = "git"; - url = "https://github.com/spf13/pflag"; - rev = "e57e3eeb33f795204c1ca35f56c44f83227c6e66"; - sha256 = "13mhx4i913jil32j295m3a36jzvq1y64xig0naadiz7q9ja011r2"; - }; - } - { - goPackagePath = "github.com/spf13/viper"; - fetch = { - type = "git"; - url = "https://github.com/spf13/viper"; - rev = "0967fc9aceab2ce9da34061253ac10fb99bba5b2"; - sha256 = "016syis0rvccp2indjqi1vnz3wk7c9dhkvkgam0j79sb019kl80f"; - }; - } - { - goPackagePath = "golang.org/x/net"; - fetch = { - type = "git"; - url = "https://go.googlesource.com/net"; - rev = "513929065c19401a1c7b76ecd942f9f86a0c061b"; - sha256 = "19ziin0k3n45nccjbk094f61hr198wzqnas93cmcxdja8f8fz27q"; - }; - } - { - goPackagePath = "golang.org/x/oauth2"; - fetch = { - type = "git"; - url = "https://go.googlesource.com/oauth2"; - rev = "f047394b6d14284165300fd82dad67edb3a4d7f6"; - sha256 = "1l1a2iz1nmfmzzbjj1h8066prag4jvjqh13iv1jdlh05fgv6769i"; - }; - } - { - goPackagePath = "golang.org/x/sys"; - fetch = { - type = "git"; - url = "https://go.googlesource.com/sys"; - rev = "a2e06a18b0d52d8cb2010e04b372a1965d8e3439"; - sha256 = "0m0r2w2qk8jkdk21h52n66g4yqckmzpx3mph73cilkhvdfgwfd21"; - }; - } - { - goPackagePath = "golang.org/x/text"; - fetch = { - type = "git"; - url = "https://go.googlesource.com/text"; - rev = "19e51611da83d6be54ddafce4a4af510cb3e9ea4"; - sha256 = "09pcfzx7nrma0gjv93jx57c28farf8m1qm4x07vk5505wlcgvvfl"; - }; - } - { - goPackagePath = "gopkg.in/yaml.v2"; - fetch = { - type = "git"; - url = "https://gopkg.in/yaml.v2"; - rev = "cd8b52f8269e0feb286dfeef29f8fe4d5b397e0b"; - sha256 = "1hj2ag9knxflpjibck0n90jrhsrqz7qvad4qnif7jddyapi9bqzl"; - }; - } -] diff --git a/pkgs/applications/networking/flexget/default.nix b/pkgs/applications/networking/flexget/default.nix index 13b326b0678b..c4a76bdcfce1 100644 --- a/pkgs/applications/networking/flexget/default.nix +++ b/pkgs/applications/networking/flexget/default.nix @@ -5,14 +5,14 @@ python3Packages.buildPythonApplication rec { pname = "flexget"; - version = "3.3.26"; + version = "3.3.27"; # Fetch from GitHub in order to use `requirements.in` src = fetchFromGitHub { owner = "flexget"; repo = "flexget"; rev = "refs/tags/v${version}"; - hash = "sha256-5THgUOQv9gPUh9emWiBs/tSNsOX4ZVh+jvKEpWsy05w="; + hash = "sha256-0FHhYsm2Uwag0e2i7ip32EWjS4Fx6vA9eW1ojSBB5Hc="; }; postPatch = '' diff --git a/pkgs/development/python-modules/aioimaplib/default.nix b/pkgs/development/python-modules/aioimaplib/default.nix index 97e21dc61522..6936ac4ac448 100644 --- a/pkgs/development/python-modules/aioimaplib/default.nix +++ b/pkgs/development/python-modules/aioimaplib/default.nix @@ -16,7 +16,7 @@ buildPythonPackage rec { pname = "aioimaplib"; - version = "1.0.0"; + version = "1.0.1"; format = "setuptools"; disabled = pythonOlder "3.5"; @@ -43,9 +43,13 @@ buildPythonPackage rec { disabledTests = [ # https://github.com/bamthomas/aioimaplib/issues/77 "test_get_quotaroot" + # asyncio.exceptions.TimeoutError + "test_idle" ]; - pythonImportsCheck = [ "aioimaplib" ]; + pythonImportsCheck = [ + "aioimaplib" + ]; meta = with lib; { description = "Python asyncio IMAP4rev1 client library"; diff --git a/pkgs/development/python-modules/b2sdk/default.nix b/pkgs/development/python-modules/b2sdk/default.nix index 5c3c8c8c682c..5994f1413de8 100644 --- a/pkgs/development/python-modules/b2sdk/default.nix +++ b/pkgs/development/python-modules/b2sdk/default.nix @@ -16,14 +16,14 @@ buildPythonPackage rec { pname = "b2sdk"; - version = "1.17.3"; + version = "1.18.0"; format = "setuptools"; disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - hash = "sha256-pyPjjdQ8wzvQitlchGlfNTPwqs0PH6xgplSPUWpjtwM="; + hash = "sha256-knLyjRjUmLZtM9dJoPBeSdm7GpE0+UJhwLi/obVvPuw="; }; nativeBuildInputs = [ diff --git a/pkgs/development/python-modules/persistent/default.nix b/pkgs/development/python-modules/persistent/default.nix index 5b5462cf4757..cb0b8ecf091d 100644 --- a/pkgs/development/python-modules/persistent/default.nix +++ b/pkgs/development/python-modules/persistent/default.nix @@ -10,14 +10,14 @@ buildPythonPackage rec { pname = "persistent"; - version = "4.9.0"; + version = "4.9.1"; format = "setuptools"; disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - hash = "sha256-RwGzHYHBBCJlclrzkEUOnZFq10ucF4twEAU4U1keDGo="; + hash = "sha256-pfkeAJD5OS/TJNl/TCpjbJI5lYKCOM2i4/vMaxu8RoY="; }; nativeBuildInputs = [ diff --git a/pkgs/development/python-modules/pyxbe/default.nix b/pkgs/development/python-modules/pyxbe/default.nix index 22e19cd3bbfb..929a02ac4751 100644 --- a/pkgs/development/python-modules/pyxbe/default.nix +++ b/pkgs/development/python-modules/pyxbe/default.nix @@ -7,7 +7,7 @@ buildPythonPackage rec { pname = "pyxbe"; - version = "1.0.0"; + version = "1.0.1"; format = "setuptools"; disabled = pythonOlder "3.7"; @@ -15,7 +15,7 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = "mborgerson"; repo = pname; - rev = "v${version}"; + rev = "refs/tags/v${version}"; hash = "sha256-oOY0g1F5sxGUxXAT19Ygq5q7pnxEhIAKmyYELR1PHEA="; }; diff --git a/pkgs/development/python-modules/streamdeck/default.nix b/pkgs/development/python-modules/streamdeck/default.nix index 7d7f00710377..28d547f52ad1 100644 --- a/pkgs/development/python-modules/streamdeck/default.nix +++ b/pkgs/development/python-modules/streamdeck/default.nix @@ -8,11 +8,11 @@ buildPythonPackage rec { pname = "streamdeck"; - version = "0.9.1"; + version = "0.9.2"; src = fetchPypi { inherit pname version; - sha256 = "0116a376afc18f3abbf79cc1a4409f81472e19197d5641b9e97e697d105cbdc0"; + sha256 = "sha256-XhNB/flNju2XdOMbVo7X4dhGCqNEV1314PDFC9Ma3nw="; }; patches = [ diff --git a/pkgs/development/python-modules/thermobeacon-ble/default.nix b/pkgs/development/python-modules/thermobeacon-ble/default.nix index db9f5746ba6c..cce24dae6b5e 100644 --- a/pkgs/development/python-modules/thermobeacon-ble/default.nix +++ b/pkgs/development/python-modules/thermobeacon-ble/default.nix @@ -11,7 +11,7 @@ buildPythonPackage rec { pname = "thermobeacon-ble"; - version = "0.3.1"; + version = "0.3.2"; format = "pyproject"; disabled = pythonOlder "3.9"; @@ -20,7 +20,7 @@ buildPythonPackage rec { owner = "bluetooth-devices"; repo = pname; rev = "v${version}"; - hash = "sha256-OvSvhOcJSThKyLXHhiwEZtCrYt6+KB5iArUKjfoi2OI="; + hash = "sha256-wzDujKJkUzbzZZ9FYTz78cYF06n8REF1TQiAbePDFJc="; }; nativeBuildInputs = [ diff --git a/pkgs/development/python-modules/types-protobuf/default.nix b/pkgs/development/python-modules/types-protobuf/default.nix index 645b495852b0..803e6fce2512 100644 --- a/pkgs/development/python-modules/types-protobuf/default.nix +++ b/pkgs/development/python-modules/types-protobuf/default.nix @@ -6,12 +6,12 @@ buildPythonPackage rec { pname = "types-protobuf"; - version = "3.20.2"; + version = "3.20.3"; format = "setuptools"; src = fetchPypi { inherit pname version; - sha256 = "sha256-z7drXrpRSAd5ZgMAYTTMw2FDLdBhqMy42yz5EIpFQ2k="; + sha256 = "sha256-quZASpyQKXDaM5d9G8RM665JV6XO7O1lC5r6+zYFG7I="; }; propagatedBuildInputs = [ diff --git a/pkgs/development/tools/backblaze-b2/default.nix b/pkgs/development/tools/backblaze-b2/default.nix index f8065c4f7b70..78224176e5a0 100644 --- a/pkgs/development/tools/backblaze-b2/default.nix +++ b/pkgs/development/tools/backblaze-b2/default.nix @@ -2,12 +2,12 @@ python3Packages.buildPythonApplication rec { pname = "backblaze-b2"; - version = "3.5.0"; + version = "3.6.0"; src = python3Packages.fetchPypi { inherit version; pname = "b2"; - sha256 = "sha256-vyqExulsV0wDijLotPO3RAOk9o4ne0Vq74KJKhSBrvo="; + sha256 = "sha256-qHnnUTSLY1yncqIjG+IMLoNauvgwU04qsvH7dZZ8AlI="; }; postPatch = '' @@ -32,6 +32,7 @@ python3Packages.buildPythonApplication rec { checkInputs = with python3Packages; [ backoff + more-itertools pytestCheckHook ]; diff --git a/pkgs/development/tools/database/pg_activity/default.nix b/pkgs/development/tools/database/pg_activity/default.nix index efa32358b2dc..f7e034a9a77c 100644 --- a/pkgs/development/tools/database/pg_activity/default.nix +++ b/pkgs/development/tools/database/pg_activity/default.nix @@ -2,14 +2,14 @@ python3Packages.buildPythonApplication rec { pname = "pg_activity"; - version = "2.3.1"; + version = "3.0.0"; disabled = python3Packages.pythonOlder "3.6"; src = fetchFromGitHub { owner = "dalibo"; repo = pname; rev = "refs/tags/v${version}"; - sha256 = "sha256-oStoZVFf0g1Dj2m+T+8caiKS0o1CnhtQNe/GbnlVUCM="; + sha256 = "sha256-MJZS5+i3s5fTFcgw5zt3GeJKKZ/GS66scuUAW9Fu73A="; }; propagatedBuildInputs = with python3Packages; [ diff --git a/pkgs/development/tools/dyff/default.nix b/pkgs/development/tools/dyff/default.nix index c124749b6fd0..beb3cd3f98a3 100644 --- a/pkgs/development/tools/dyff/default.nix +++ b/pkgs/development/tools/dyff/default.nix @@ -52,6 +52,6 @@ buildGoModule rec { ''; homepage = "https://github.com/homeport/dyff"; license = licenses.mit; - maintainers = with maintainers; [ edlimerkaj ]; + maintainers = with maintainers; [ edlimerkaj jceb ]; }; } diff --git a/pkgs/development/tools/esbuild/default.nix b/pkgs/development/tools/esbuild/default.nix index 7ce4e8c6e4e6..c44b6b506e21 100644 --- a/pkgs/development/tools/esbuild/default.nix +++ b/pkgs/development/tools/esbuild/default.nix @@ -2,13 +2,13 @@ buildGoModule rec { pname = "esbuild"; - version = "0.15.7"; + version = "0.15.8"; src = fetchFromGitHub { owner = "evanw"; repo = "esbuild"; rev = "v${version}"; - sha256 = "sha256-iud6nSZYclIPfM1n7xG2XCo90FjaHK/nd40jEcSnuIc="; + sha256 = "sha256-9CECbM/0sl9RR0OudyABcchbMZa8Ug5CmaWZ/DYS0m8="; }; vendorSha256 = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ="; diff --git a/pkgs/development/tools/misc/circleci-cli/default.nix b/pkgs/development/tools/misc/circleci-cli/default.nix index 4df111b7a8bb..012cf9301d21 100644 --- a/pkgs/development/tools/misc/circleci-cli/default.nix +++ b/pkgs/development/tools/misc/circleci-cli/default.nix @@ -2,16 +2,16 @@ buildGoModule rec { pname = "circleci-cli"; - version = "0.1.21091"; + version = "0.1.21194"; src = fetchFromGitHub { owner = "CircleCI-Public"; repo = pname; rev = "v${version}"; - sha256 = "sha256-k8NeqGlhxYLZ4KAuX7eyCi5dIjYIx2z8Xb2JJb2H5Y0="; + sha256 = "sha256-YBo0Td4UEr27AU1yqwXNKWjfWYMuKdgmRNmNUfgL3F0="; }; - vendorSha256 = "sha256-jrAd1G/NCjXfaJmzOhMjMZfJoGHsQ1bi3HudBM0e8rE="; + vendorSha256 = "sha256-vydx3ZaVSpIn5nncuQhRVQqZ7920n1NAoZIHFvzrQgo="; nativeBuildInputs = [ installShellFiles ]; diff --git a/pkgs/development/tools/rust/cargo-fund/default.nix b/pkgs/development/tools/rust/cargo-fund/default.nix index 116f408fb1ea..d5fbb47f7bb4 100644 --- a/pkgs/development/tools/rust/cargo-fund/default.nix +++ b/pkgs/development/tools/rust/cargo-fund/default.nix @@ -2,16 +2,16 @@ rustPlatform.buildRustPackage rec { pname = "cargo-fund"; - version = "0.2.1"; + version = "0.2.2"; src = fetchFromGitHub { owner = "acfoltzer"; repo = pname; rev = version; - sha256 = "sha256-MlAFnwX++OYRzqhEcSjxNzmSyJiVE5t6UuCKy9J+SsQ="; + sha256 = "sha256-hUTBDC2XU82jc9TbyCYVKgWxrKG/OIc1a+fEdj5566M="; }; - cargoSha256 = "sha256-pI5iz/V7/2jH3t3W3fuLzqd6oJC3PqHIWEJhDLmjLI0="; + cargoSha256 = "sha256-cU/X+oNTMjUSODkdm+P+vVLmBJlkeQ9WTJGvQmUOQKw="; # The tests need a GitHub API token. doCheck = false; diff --git a/pkgs/development/tools/selene/default.nix b/pkgs/development/tools/selene/default.nix index 235689d97e21..e5e8d822debc 100644 --- a/pkgs/development/tools/selene/default.nix +++ b/pkgs/development/tools/selene/default.nix @@ -10,16 +10,16 @@ rustPlatform.buildRustPackage rec { pname = "selene"; - version = "0.21.0"; + version = "0.21.1"; src = fetchFromGitHub { owner = "kampfkarren"; repo = pname; rev = version; - sha256 = "sha256-iqPQD0oDPhhD7jgnbiJvUiaxj1YZeGkgQu6p1vr1Vlw="; + sha256 = "sha256-a3mslAqDzUlMLBMjxScMkR4GePmpBeH+Ottd1ENum/c="; }; - cargoSha256 = "sha256-gl4vgS/164eYP3MWRBaI3NrmlqbYZUHOwySUA7/42Qg="; + cargoSha256 = "sha256-nFtZDoNbUxO5YY+Mqu5W6AR+tH2zsBLMQ7EDK6A8qAg="; nativeBuildInputs = lib.optional robloxSupport pkg-config; diff --git a/pkgs/os-specific/linux/usbrelay/daemon.nix b/pkgs/os-specific/linux/usbrelay/daemon.nix index e5e4baae9e99..7aa1c3f153bb 100644 --- a/pkgs/os-specific/linux/usbrelay/daemon.nix +++ b/pkgs/os-specific/linux/usbrelay/daemon.nix @@ -1,4 +1,4 @@ -{ stdenv, usbrelay, python3 }: +{ stdenv, usbrelay, python3, installShellFiles }: let python = python3.withPackages (ps: with ps; [ usbrelay-py paho-mqtt ]); in @@ -16,6 +16,8 @@ stdenv.mkDerivation rec { --replace '/usr/sbin/usbrelayd' "$out/bin/usbrelayd" ''; + nativeBuildInputs = [ installShellFiles ]; + buildInputs = [ python ]; dontBuild = true; @@ -26,6 +28,7 @@ stdenv.mkDerivation rec { install -m 644 -D usbrelayd.service $out/lib/systemd/system/usbrelayd.service install -m 644 -D 50-usbrelay.rules $out/lib/udev/rules.d/50-usbrelay.rules install -m 644 -D usbrelayd.conf $out/etc/usbrelayd.conf # include this as an example + installManPage usbrelayd.8 runHook postInstall ''; diff --git a/pkgs/os-specific/linux/usbrelay/default.nix b/pkgs/os-specific/linux/usbrelay/default.nix index 25388d3b2308..c5b4f2b8a53f 100644 --- a/pkgs/os-specific/linux/usbrelay/default.nix +++ b/pkgs/os-specific/linux/usbrelay/default.nix @@ -1,13 +1,13 @@ { stdenv, lib, fetchFromGitHub, hidapi, installShellFiles }: stdenv.mkDerivation rec { pname = "usbrelay"; - version = "1.0"; + version = "1.0.1"; src = fetchFromGitHub { owner = "darrylb123"; repo = "usbrelay"; rev = version; - sha256 = "sha256-5zgpN4a+r0tmw0ISTJM+d9mo+L/qwUvpWPSsykuG0cg="; + sha256 = "sha256-2elDrO+WaaRYdTrG40Ez00qSsNVQjXE6GdOJbWPfugE="; }; nativeBuildInputs = [ diff --git a/pkgs/os-specific/linux/usbrelay/python.nix b/pkgs/os-specific/linux/usbrelay/python.nix index 02d5ac284eda..b87798940909 100644 --- a/pkgs/os-specific/linux/usbrelay/python.nix +++ b/pkgs/os-specific/linux/usbrelay/python.nix @@ -4,6 +4,10 @@ buildPythonPackage rec { pname = "usbrelay_py"; inherit (usbrelay) version src; + preConfigure = '' + cd usbrelay_py + ''; + buildInputs = [ usbrelay ]; pythonImportsCheck = [ "usbrelay_py" ]; diff --git a/pkgs/os-specific/linux/usbrelay/test.nix b/pkgs/os-specific/linux/usbrelay/test.nix index dc5847558a69..58e4375dab8d 100644 --- a/pkgs/os-specific/linux/usbrelay/test.nix +++ b/pkgs/os-specific/linux/usbrelay/test.nix @@ -42,6 +42,7 @@ import ../../../../nixos/tests/make-test-python.nix ({ pkgs, ... }: { }; testScript = '' + import os if os.waitstatus_to_exitcode(os.system("lsusb -d 16c0:05df")) != 0: print("No USB relay detected, skipping test") import sys diff --git a/pkgs/tools/admin/eksctl/default.nix b/pkgs/tools/admin/eksctl/default.nix index f4d45b003186..7410aa0d5018 100644 --- a/pkgs/tools/admin/eksctl/default.nix +++ b/pkgs/tools/admin/eksctl/default.nix @@ -2,16 +2,16 @@ buildGoModule rec { pname = "eksctl"; - version = "0.111.0"; + version = "0.112.0"; src = fetchFromGitHub { owner = "weaveworks"; repo = pname; rev = version; - sha256 = "sha256-I/EYq83snTphHlOk6SgZSYpRS3RNpD2JX1fkwqEG9j0="; + sha256 = "sha256-kY2AE5lLP1awxfPj16MAhcxO59S3lOZOUXV2EzXDHTY="; }; - vendorSha256 = "sha256-Dka0UbTxR2UsMkClq8t0//m+Ky7NEw3g9XP6PtTWOe4="; + vendorSha256 = "sha256-z/3aUSuAZSVsQ67JgUy6z3T91vKHlBjjQS4oSljl/nk="; doCheck = false; diff --git a/pkgs/tools/misc/chezmoi/default.nix b/pkgs/tools/misc/chezmoi/default.nix index 1173deeef180..d23c4faa7e54 100644 --- a/pkgs/tools/misc/chezmoi/default.nix +++ b/pkgs/tools/misc/chezmoi/default.nix @@ -2,16 +2,16 @@ buildGoModule rec { pname = "chezmoi"; - version = "2.22.1"; + version = "2.23.0"; src = fetchFromGitHub { owner = "twpayne"; repo = "chezmoi"; rev = "v${version}"; - sha256 = "sha256-IVXrFoSpwKC96oYqMrWz5Pouf2RPUJZxQppkfmNoZIg="; + sha256 = "sha256-h9FtmiOrzHdweZQr0xTw12MavbyWwTw3KeOtzXbVt8E="; }; - vendorSha256 = "sha256-riGN7d+am9DXCcFVkc2WIxmHvsNaZxHm/aEDcb8kCz4="; + vendorSha256 = "sha256-TNFplcN6vmt0z3WuMXZPYeM9xWMXfmsY912MItqRG6U="; doCheck = false; diff --git a/pkgs/tools/misc/miniserve/default.nix b/pkgs/tools/misc/miniserve/default.nix index 3d4cccbb18ec..0bf6e0927bf6 100644 --- a/pkgs/tools/misc/miniserve/default.nix +++ b/pkgs/tools/misc/miniserve/default.nix @@ -8,16 +8,16 @@ rustPlatform.buildRustPackage rec { pname = "miniserve"; - version = "0.21.0"; + version = "0.22.0"; src = fetchFromGitHub { owner = "svenstaro"; repo = "miniserve"; rev = "v${version}"; - hash = "sha256-tps/TKkG2To80zokNoSHQQPrzZnoS+lBWks/PIV586Q="; + hash = "sha256-pi+dBJE+EqQpyZAkIV7duK1g378J6BgjIiFcjV5H1fQ="; }; - cargoSha256 = "sha256-9xRxUnDEji5+3drHQtdK1ozW8nezushxZZAaUlp+jJQ="; + cargoSha256 = "sha256-nRTGKW33NO2vRkvpNVk4pT1DrHPEsSfhwf8y5pJ+n9U="; nativeBuildInputs = [ installShellFiles @@ -30,6 +30,8 @@ rustPlatform.buildRustPackage rec { checkFlags = [ "--skip=bind_ipv4_ipv6::case_2" "--skip=cant_navigate_up_the_root" + "--skip=qrcode_hidden_in_tty_when_disabled" + "--skip=qrcode_shown_in_tty_when_enabled" ]; postInstall = ''