diff --git a/lib/lists.nix b/lib/lists.nix index 05216c1a66eb..b12b78754a38 100644 --- a/lib/lists.nix +++ b/lib/lists.nix @@ -1,4 +1,6 @@ -/* General list operations. */ +/** + General list operations. +*/ { lib }: let inherit (lib.strings) toInt; @@ -9,45 +11,112 @@ rec { inherit (builtins) head tail length isList elemAt concatLists filter elem genList map; - /* Create a list consisting of a single element. `singleton x` is - sometimes more convenient with respect to indentation than `[x]` - when x spans multiple lines. + /** + Create a list consisting of a single element. `singleton x` is + sometimes more convenient with respect to indentation than `[x]` + when x spans multiple lines. - Type: singleton :: a -> [a] + # Inputs - Example: - singleton "foo" - => [ "foo" ] + `x` + + : 1\. Function argument + + # Type + + ``` + singleton :: a -> [a] + ``` + + # Examples + :::{.example} + ## `lib.lists.singleton` usage example + + ```nix + singleton "foo" + => [ "foo" ] + ``` + + ::: */ singleton = x: [x]; - /* Apply the function to each element in the list. Same as `map`, but arguments - flipped. + /** + Apply the function to each element in the list. + Same as `map`, but arguments flipped. - Type: forEach :: [a] -> (a -> b) -> [b] + # Inputs - Example: - forEach [ 1 2 ] (x: - toString x - ) - => [ "1" "2" ] + `xs` + + : 1\. Function argument + + `f` + + : 2\. Function argument + + # Type + + ``` + forEach :: [a] -> (a -> b) -> [b] + ``` + + # Examples + :::{.example} + ## `lib.lists.forEach` usage example + + ```nix + forEach [ 1 2 ] (x: + toString x + ) + => [ "1" "2" ] + ``` + + ::: */ forEach = xs: f: map f xs; - /* “right fold” a binary function `op` between successive elements of - `list` with `nul` as the starting value, i.e., - `foldr op nul [x_1 x_2 ... x_n] == op x_1 (op x_2 ... (op x_n nul))`. + /** + “right fold” a binary function `op` between successive elements of + `list` with `nul` as the starting value, i.e., + `foldr op nul [x_1 x_2 ... x_n] == op x_1 (op x_2 ... (op x_n nul))`. - Type: foldr :: (a -> b -> b) -> b -> [a] -> b - Example: - concat = foldr (a: b: a + b) "z" - concat [ "a" "b" "c" ] - => "abcz" - # different types - strange = foldr (int: str: toString (int + 1) + str) "a" - strange [ 1 2 3 4 ] - => "2345a" + # Inputs + + `op` + + : 1\. Function argument + + `nul` + + : 2\. Function argument + + `list` + + : 3\. Function argument + + # Type + + ``` + foldr :: (a -> b -> b) -> b -> [a] -> b + ``` + + # Examples + :::{.example} + ## `lib.lists.foldr` usage example + + ```nix + concat = foldr (a: b: a + b) "z" + concat [ "a" "b" "c" ] + => "abcz" + # different types + strange = foldr (int: str: toString (int + 1) + str) "a" + strange [ 1 2 3 4 ] + => "2345a" + ``` + + ::: */ foldr = op: nul: list: let @@ -58,24 +127,53 @@ rec { else op (elemAt list n) (fold' (n + 1)); in fold' 0; - /* `fold` is an alias of `foldr` for historic reasons */ + /** + `fold` is an alias of `foldr` for historic reasons + */ # FIXME(Profpatsch): deprecate? fold = foldr; - /* “left fold”, like `foldr`, but from the left: - `foldl op nul [x_1 x_2 ... x_n] == op (... (op (op nul x_1) x_2) ... x_n)`. + /** + “left fold”, like `foldr`, but from the left: - Type: foldl :: (b -> a -> b) -> b -> [a] -> b + `foldl op nul [x_1 x_2 ... x_n] == op (... (op (op nul x_1) x_2) ... x_n)`. - Example: - lconcat = foldl (a: b: a + b) "z" - lconcat [ "a" "b" "c" ] - => "zabc" - # different types - lstrange = foldl (str: int: str + toString (int + 1)) "a" - lstrange [ 1 2 3 4 ] - => "a2345" + # Inputs + + `op` + + : 1\. Function argument + + `nul` + + : 2\. Function argument + + `list` + + : 3\. Function argument + + # Type + + ``` + foldl :: (b -> a -> b) -> b -> [a] -> b + ``` + + # Examples + :::{.example} + ## `lib.lists.foldl` usage example + + ```nix + lconcat = foldl (a: b: a + b) "z" + lconcat [ "a" "b" "c" ] + => "zabc" + # different types + lstrange = foldl (str: int: str + toString (int + 1)) "a" + lstrange [ 1 2 3 4 ] + => "a2345" + ``` + + ::: */ foldl = op: nul: list: let @@ -85,7 +183,7 @@ rec { else op (foldl' (n - 1)) (elemAt list n); in foldl' (length list - 1); - /* + /** Reduce a list by applying a binary operator from left to right, starting with an initial accumulator. @@ -119,22 +217,43 @@ rec { op (op (... (op (op (op acc₀ x₀) x₁) x₂) ...) xₙ₋₁) xₙ ``` - Type: foldl' :: (acc -> x -> acc) -> acc -> [x] -> acc + # Inputs - Example: - foldl' (acc: x: acc + x) 0 [1 2 3] - => 6 - */ - foldl' = - /* The binary operation to run, where the two arguments are: + `op` + + : The binary operation to run, where the two arguments are: 1. `acc`: The current accumulator value: Either the initial one for the first iteration, or the result of the previous iteration 2. `x`: The corresponding list element for this iteration - */ + + `acc` + + : The initial accumulator value + + `list` + + : The list to fold + + # Type + + ``` + foldl' :: (acc -> x -> acc) -> acc -> [x] -> acc + ``` + + # Examples + :::{.example} + ## `lib.lists.foldl'` usage example + + ```nix + foldl' (acc: x: acc + x) 0 [1 2 3] + => 6 + ``` + + ::: + */ + foldl' = op: - # The initial accumulator value acc: - # The list to fold list: # The builtin `foldl'` is a bit lazier than one might expect. @@ -143,107 +262,254 @@ rec { builtins.seq acc (builtins.foldl' op acc list); - /* Map with index starting from 0 + /** + Map with index starting from 0 - Type: imap0 :: (int -> a -> b) -> [a] -> [b] + # Inputs - Example: - imap0 (i: v: "${v}-${toString i}") ["a" "b"] - => [ "a-0" "b-1" ] + `f` + + : 1\. Function argument + + `list` + + : 2\. Function argument + + # Type + + ``` + imap0 :: (int -> a -> b) -> [a] -> [b] + ``` + + # Examples + :::{.example} + ## `lib.lists.imap0` usage example + + ```nix + imap0 (i: v: "${v}-${toString i}") ["a" "b"] + => [ "a-0" "b-1" ] + ``` + + ::: */ imap0 = f: list: genList (n: f n (elemAt list n)) (length list); - /* Map with index starting from 1 + /** + Map with index starting from 1 - Type: imap1 :: (int -> a -> b) -> [a] -> [b] - Example: - imap1 (i: v: "${v}-${toString i}") ["a" "b"] - => [ "a-1" "b-2" ] + # Inputs + + `f` + + : 1\. Function argument + + `list` + + : 2\. Function argument + + # Type + + ``` + imap1 :: (int -> a -> b) -> [a] -> [b] + ``` + + # Examples + :::{.example} + ## `lib.lists.imap1` usage example + + ```nix + imap1 (i: v: "${v}-${toString i}") ["a" "b"] + => [ "a-1" "b-2" ] + ``` + + ::: */ imap1 = f: list: genList (n: f (n + 1) (elemAt list n)) (length list); - /* Map and concatenate the result. + /** + Map and concatenate the result. - Type: concatMap :: (a -> [b]) -> [a] -> [b] + # Type - Example: - concatMap (x: [x] ++ ["z"]) ["a" "b"] - => [ "a" "z" "b" "z" ] + ``` + concatMap :: (a -> [b]) -> [a] -> [b] + ``` + + # Examples + :::{.example} + ## `lib.lists.concatMap` usage example + + ```nix + concatMap (x: [x] ++ ["z"]) ["a" "b"] + => [ "a" "z" "b" "z" ] + ``` + + ::: */ concatMap = builtins.concatMap; - /* Flatten the argument into a single list; that is, nested lists are - spliced into the top-level lists. + /** + Flatten the argument into a single list; that is, nested lists are + spliced into the top-level lists. - Example: - flatten [1 [2 [3] 4] 5] - => [1 2 3 4 5] - flatten 1 - => [1] + + # Inputs + + `x` + + : 1\. Function argument + + + # Examples + :::{.example} + ## `lib.lists.flatten` usage example + + ```nix + flatten [1 [2 [3] 4] 5] + => [1 2 3 4 5] + flatten 1 + => [1] + ``` + + ::: */ flatten = x: if isList x then concatMap (y: flatten y) x else [x]; - /* Remove elements equal to 'e' from a list. Useful for buildInputs. + /** + Remove elements equal to 'e' from a list. Useful for buildInputs. - Type: remove :: a -> [a] -> [a] - Example: - remove 3 [ 1 3 4 3 ] - => [ 1 4 ] + # Inputs + + `e` + + : Element to remove from `list` + + `list` + + : The list + + # Type + + ``` + remove :: a -> [a] -> [a] + ``` + + # Examples + :::{.example} + ## `lib.lists.remove` usage example + + ```nix + remove 3 [ 1 3 4 3 ] + => [ 1 4 ] + ``` + + ::: */ remove = - # Element to remove from the list e: filter (x: x != e); - /* Find the sole element in the list matching the specified - predicate, returns `default` if no such element exists, or - `multiple` if there are multiple matching elements. + /** + Find the sole element in the list matching the specified + predicate. - Type: findSingle :: (a -> bool) -> a -> a -> [a] -> a + Returns `default` if no such element exists, or + `multiple` if there are multiple matching elements. - Example: - findSingle (x: x == 3) "none" "multiple" [ 1 3 3 ] - => "multiple" - findSingle (x: x == 3) "none" "multiple" [ 1 3 ] - => 3 - findSingle (x: x == 3) "none" "multiple" [ 1 9 ] - => "none" + + # Inputs + + `pred` + + : Predicate + + `default` + + : Default value to return if element was not found. + + `multiple` + + : Default value to return if more than one element was found + + `list` + + : Input list + + # Type + + ``` + findSingle :: (a -> bool) -> a -> a -> [a] -> a + ``` + + # Examples + :::{.example} + ## `lib.lists.findSingle` usage example + + ```nix + findSingle (x: x == 3) "none" "multiple" [ 1 3 3 ] + => "multiple" + findSingle (x: x == 3) "none" "multiple" [ 1 3 ] + => 3 + findSingle (x: x == 3) "none" "multiple" [ 1 9 ] + => "none" + ``` + + ::: */ findSingle = - # Predicate pred: - # Default value to return if element was not found. default: - # Default value to return if more than one element was found multiple: - # Input list list: let found = filter pred list; len = length found; in if len == 0 then default else if len != 1 then multiple else head found; - /* Find the first index in the list matching the specified - predicate or return `default` if no such element exists. + /** + Find the first index in the list matching the specified + predicate or return `default` if no such element exists. - Type: findFirstIndex :: (a -> Bool) -> b -> [a] -> (Int | b) + # Inputs - Example: - findFirstIndex (x: x > 3) null [ 0 6 4 ] - => 1 - findFirstIndex (x: x > 9) null [ 0 6 4 ] - => null + `pred` + + : Predicate + + `default` + + : Default value to return + + `list` + + : Input list + + # Type + + ``` + findFirstIndex :: (a -> Bool) -> b -> [a] -> (Int | b) + ``` + + # Examples + :::{.example} + ## `lib.lists.findFirstIndex` usage example + + ```nix + findFirstIndex (x: x > 3) null [ 0 6 4 ] + => 1 + findFirstIndex (x: x > 9) null [ 0 6 4 ] + => null + ``` + + ::: */ findFirstIndex = - # Predicate pred: - # Default value to return default: - # Input list list: let # A naive recursive implementation would be much simpler, but @@ -278,23 +544,46 @@ rec { else resultIndex; - /* Find the first element in the list matching the specified - predicate or return `default` if no such element exists. + /** + Find the first element in the list matching the specified + predicate or return `default` if no such element exists. - Type: findFirst :: (a -> bool) -> a -> [a] -> a + # Inputs - Example: - findFirst (x: x > 3) 7 [ 1 6 4 ] - => 6 - findFirst (x: x > 9) 7 [ 1 6 4 ] - => 7 + `pred` + + : Predicate + + `default` + + : Default value to return + + `list` + + : Input list + + # Type + + ``` + findFirst :: (a -> bool) -> a -> [a] -> a + ``` + + # Examples + :::{.example} + ## `lib.lists.findFirst` usage example + + ```nix + findFirst (x: x > 3) 7 [ 1 6 4 ] + => 6 + findFirst (x: x > 9) 7 [ 1 6 4 ] + => 7 + ``` + + ::: */ findFirst = - # Predicate pred: - # Default value to return default: - # Input list list: let index = findFirstIndex pred null list; @@ -304,152 +593,359 @@ rec { else elemAt list index; - /* Return true if function `pred` returns true for at least one - element of `list`. + /** + Return true if function `pred` returns true for at least one + element of `list`. - Type: any :: (a -> bool) -> [a] -> bool + # Inputs - Example: - any isString [ 1 "a" { } ] - => true - any isString [ 1 { } ] - => false + `pred` + + : Predicate + + `list` + + : Input list + + # Type + + ``` + any :: (a -> bool) -> [a] -> bool + ``` + + # Examples + :::{.example} + ## `lib.lists.any` usage example + + ```nix + any isString [ 1 "a" { } ] + => true + any isString [ 1 { } ] + => false + ``` + + ::: */ any = builtins.any; - /* Return true if function `pred` returns true for all elements of - `list`. + /** + Return true if function `pred` returns true for all elements of + `list`. - Type: all :: (a -> bool) -> [a] -> bool + # Inputs - Example: - all (x: x < 3) [ 1 2 ] - => true - all (x: x < 3) [ 1 2 3 ] - => false + `pred` + + : Predicate + + `list` + + : Input list + + # Type + + ``` + all :: (a -> bool) -> [a] -> bool + ``` + + # Examples + :::{.example} + ## `lib.lists.all` usage example + + ```nix + all (x: x < 3) [ 1 2 ] + => true + all (x: x < 3) [ 1 2 3 ] + => false + ``` + + ::: */ all = builtins.all; - /* Count how many elements of `list` match the supplied predicate - function. + /** + Count how many elements of `list` match the supplied predicate + function. - Type: count :: (a -> bool) -> [a] -> int + # Inputs - Example: - count (x: x == 3) [ 3 2 3 4 6 ] - => 2 + `pred` + + : Predicate + + # Type + + ``` + count :: (a -> bool) -> [a] -> int + ``` + + # Examples + :::{.example} + ## `lib.lists.count` usage example + + ```nix + count (x: x == 3) [ 3 2 3 4 6 ] + => 2 + ``` + + ::: */ count = - # Predicate pred: foldl' (c: x: if pred x then c + 1 else c) 0; - /* Return a singleton list or an empty list, depending on a boolean - value. Useful when building lists with optional elements - (e.g. `++ optional (system == "i686-linux") firefox`). + /** + Return a singleton list or an empty list, depending on a boolean + value. Useful when building lists with optional elements + (e.g. `++ optional (system == "i686-linux") firefox`). - Type: optional :: bool -> a -> [a] + # Inputs - Example: - optional true "foo" - => [ "foo" ] - optional false "foo" - => [ ] + `cond` + + : 1\. Function argument + + `elem` + + : 2\. Function argument + + # Type + + ``` + optional :: bool -> a -> [a] + ``` + + # Examples + :::{.example} + ## `lib.lists.optional` usage example + + ```nix + optional true "foo" + => [ "foo" ] + optional false "foo" + => [ ] + ``` + + ::: */ optional = cond: elem: if cond then [elem] else []; - /* Return a list or an empty list, depending on a boolean value. + /** + Return a list or an empty list, depending on a boolean value. - Type: optionals :: bool -> [a] -> [a] + # Inputs - Example: - optionals true [ 2 3 ] - => [ 2 3 ] - optionals false [ 2 3 ] - => [ ] + `cond` + + : Condition + + `elems` + + : List to return if condition is true + + # Type + + ``` + optionals :: bool -> [a] -> [a] + ``` + + # Examples + :::{.example} + ## `lib.lists.optionals` usage example + + ```nix + optionals true [ 2 3 ] + => [ 2 3 ] + optionals false [ 2 3 ] + => [ ] + ``` + + ::: */ optionals = - # Condition cond: - # List to return if condition is true elems: if cond then elems else []; - /* If argument is a list, return it; else, wrap it in a singleton - list. If you're using this, you should almost certainly - reconsider if there isn't a more "well-typed" approach. + /** + If argument is a list, return it; else, wrap it in a singleton + list. If you're using this, you should almost certainly + reconsider if there isn't a more "well-typed" approach. - Example: - toList [ 1 2 ] - => [ 1 2 ] - toList "hi" - => [ "hi "] + # Inputs + + `x` + + : 1\. Function argument + + # Examples + :::{.example} + ## `lib.lists.toList` usage example + + ```nix + toList [ 1 2 ] + => [ 1 2 ] + toList "hi" + => [ "hi "] + ``` + + ::: */ toList = x: if isList x then x else [x]; - /* Return a list of integers from `first` up to and including `last`. + /** + Return a list of integers from `first` up to and including `last`. - Type: range :: int -> int -> [int] + # Inputs - Example: - range 2 4 - => [ 2 3 4 ] - range 3 2 - => [ ] + `first` + + : First integer in the range + + `last` + + : Last integer in the range + + # Type + + ``` + range :: int -> int -> [int] + ``` + + # Examples + :::{.example} + ## `lib.lists.range` usage example + + ```nix + range 2 4 + => [ 2 3 4 ] + range 3 2 + => [ ] + ``` + + ::: */ range = - # First integer in the range first: - # Last integer in the range last: if first > last then [] else genList (n: first + n) (last - first + 1); - /* Return a list with `n` copies of an element. + /** + Return a list with `n` copies of an element. - Type: replicate :: int -> a -> [a] + # Inputs - Example: - replicate 3 "a" - => [ "a" "a" "a" ] - replicate 2 true - => [ true true ] + `n` + + : 1\. Function argument + + `elem` + + : 2\. Function argument + + # Type + + ``` + replicate :: int -> a -> [a] + ``` + + # Examples + :::{.example} + ## `lib.lists.replicate` usage example + + ```nix + replicate 3 "a" + => [ "a" "a" "a" ] + replicate 2 true + => [ true true ] + ``` + + ::: */ replicate = n: elem: genList (_: elem) n; - /* Splits the elements of a list in two lists, `right` and - `wrong`, depending on the evaluation of a predicate. + /** + Splits the elements of a list in two lists, `right` and + `wrong`, depending on the evaluation of a predicate. - Type: (a -> bool) -> [a] -> { right :: [a]; wrong :: [a]; } + # Inputs - Example: - partition (x: x > 2) [ 5 1 2 3 4 ] - => { right = [ 5 3 4 ]; wrong = [ 1 2 ]; } + `pred` + + : Predicate + + `list` + + : Input list + + # Type + + ``` + (a -> bool) -> [a] -> { right :: [a]; wrong :: [a]; } + ``` + + # Examples + :::{.example} + ## `lib.lists.partition` usage example + + ```nix + partition (x: x > 2) [ 5 1 2 3 4 ] + => { right = [ 5 3 4 ]; wrong = [ 1 2 ]; } + ``` + + ::: */ partition = builtins.partition; - /* Splits the elements of a list into many lists, using the return value of a predicate. - Predicate should return a string which becomes keys of attrset `groupBy` returns. + /** + Splits the elements of a list into many lists, using the return value of a predicate. + Predicate should return a string which becomes keys of attrset `groupBy` returns. + `groupBy'` allows to customise the combining function and initial value - `groupBy'` allows to customise the combining function and initial value + # Inputs - Example: - groupBy (x: boolToString (x > 2)) [ 5 1 2 3 4 ] - => { true = [ 5 3 4 ]; false = [ 1 2 ]; } - groupBy (x: x.name) [ {name = "icewm"; script = "icewm &";} - {name = "xfce"; script = "xfce4-session &";} - {name = "icewm"; script = "icewmbg &";} - {name = "mate"; script = "gnome-session &";} - ] - => { icewm = [ { name = "icewm"; script = "icewm &"; } - { name = "icewm"; script = "icewmbg &"; } ]; - mate = [ { name = "mate"; script = "gnome-session &"; } ]; - xfce = [ { name = "xfce"; script = "xfce4-session &"; } ]; - } + `op` - groupBy' builtins.add 0 (x: boolToString (x > 2)) [ 5 1 2 3 4 ] - => { true = 12; false = 3; } + : 1\. Function argument + + `nul` + + : 2\. Function argument + + `pred` + + : 3\. Function argument + + `lst` + + : 4\. Function argument + + + # Examples + :::{.example} + ## `lib.lists.groupBy'` usage example + + ```nix + groupBy (x: boolToString (x > 2)) [ 5 1 2 3 4 ] + => { true = [ 5 3 4 ]; false = [ 1 2 ]; } + groupBy (x: x.name) [ {name = "icewm"; script = "icewm &";} + {name = "xfce"; script = "xfce4-session &";} + {name = "icewm"; script = "icewmbg &";} + {name = "mate"; script = "gnome-session &";} + ] + => { icewm = [ { name = "icewm"; script = "icewm &"; } + { name = "icewm"; script = "icewmbg &"; } ]; + mate = [ { name = "mate"; script = "gnome-session &"; } ]; + xfce = [ { name = "xfce"; script = "xfce4-session &"; } ]; + } + + groupBy' builtins.add 0 (x: boolToString (x > 2)) [ 5 1 2 3 4 ] + => { true = 12; false = 3; } + ``` + + ::: */ groupBy' = op: nul: pred: lst: mapAttrs (name: foldl op nul) (groupBy pred lst); @@ -461,68 +957,153 @@ rec { r // { ${key} = (r.${key} or []) ++ [e]; } ) {}); - /* Merges two lists of the same size together. If the sizes aren't the same - the merging stops at the shortest. How both lists are merged is defined - by the first argument. + /** + Merges two lists of the same size together. If the sizes aren't the same + the merging stops at the shortest. How both lists are merged is defined + by the first argument. - Type: zipListsWith :: (a -> b -> c) -> [a] -> [b] -> [c] + # Inputs - Example: - zipListsWith (a: b: a + b) ["h" "l"] ["e" "o"] - => ["he" "lo"] + `f` + + : Function to zip elements of both lists + + `fst` + + : First list + + `snd` + + : Second list + + # Type + + ``` + zipListsWith :: (a -> b -> c) -> [a] -> [b] -> [c] + ``` + + # Examples + :::{.example} + ## `lib.lists.zipListsWith` usage example + + ```nix + zipListsWith (a: b: a + b) ["h" "l"] ["e" "o"] + => ["he" "lo"] + ``` + + ::: */ zipListsWith = - # Function to zip elements of both lists f: - # First list fst: - # Second list snd: genList (n: f (elemAt fst n) (elemAt snd n)) (min (length fst) (length snd)); - /* Merges two lists of the same size together. If the sizes aren't the same - the merging stops at the shortest. + /** + Merges two lists of the same size together. If the sizes aren't the same + the merging stops at the shortest. - Type: zipLists :: [a] -> [b] -> [{ fst :: a; snd :: b; }] + # Inputs - Example: - zipLists [ 1 2 ] [ "a" "b" ] - => [ { fst = 1; snd = "a"; } { fst = 2; snd = "b"; } ] + `fst` + + : First list + + `snd` + + : Second list + + # Type + + ``` + zipLists :: [a] -> [b] -> [{ fst :: a; snd :: b; }] + ``` + + # Examples + :::{.example} + ## `lib.lists.zipLists` usage example + + ```nix + zipLists [ 1 2 ] [ "a" "b" ] + => [ { fst = 1; snd = "a"; } { fst = 2; snd = "b"; } ] + ``` + + ::: */ zipLists = zipListsWith (fst: snd: { inherit fst snd; }); - /* Reverse the order of the elements of a list. + /** + Reverse the order of the elements of a list. - Type: reverseList :: [a] -> [a] + # Inputs - Example: + `xs` - reverseList [ "b" "o" "j" ] - => [ "j" "o" "b" ] + : 1\. Function argument + + # Type + + ``` + reverseList :: [a] -> [a] + ``` + + # Examples + :::{.example} + ## `lib.lists.reverseList` usage example + + ```nix + reverseList [ "b" "o" "j" ] + => [ "j" "o" "b" ] + ``` + + ::: */ reverseList = xs: let l = length xs; in genList (n: elemAt xs (l - n - 1)) l; - /* Depth-First Search (DFS) for lists `list != []`. + /** + Depth-First Search (DFS) for lists `list != []`. - `before a b == true` means that `b` depends on `a` (there's an - edge from `b` to `a`). + `before a b == true` means that `b` depends on `a` (there's an + edge from `b` to `a`). - Example: - listDfs true hasPrefix [ "/home/user" "other" "/" "/home" ] - == { minimal = "/"; # minimal element - visited = [ "/home/user" ]; # seen elements (in reverse order) - rest = [ "/home" "other" ]; # everything else - } - listDfs true hasPrefix [ "/home/user" "other" "/" "/home" "/" ] - == { cycle = "/"; # cycle encountered at this element - loops = [ "/" ]; # and continues to these elements - visited = [ "/" "/home/user" ]; # elements leading to the cycle (in reverse order) - rest = [ "/home" "other" ]; # everything else + # Inputs - */ + `stopOnCycles` + + : 1\. Function argument + + `before` + + : 2\. Function argument + + `list` + + : 3\. Function argument + + + # Examples + :::{.example} + ## `lib.lists.listDfs` usage example + + ```nix + listDfs true hasPrefix [ "/home/user" "other" "/" "/home" ] + == { minimal = "/"; # minimal element + visited = [ "/home/user" ]; # seen elements (in reverse order) + rest = [ "/home" "other" ]; # everything else + } + + listDfs true hasPrefix [ "/home/user" "other" "/" "/home" "/" ] + == { cycle = "/"; # cycle encountered at this element + loops = [ "/" ]; # and continues to these elements + visited = [ "/" "/home/user" ]; # elements leading to the cycle (in reverse order) + rest = [ "/home" "other" ]; # everything else + ``` + + ::: + */ listDfs = stopOnCycles: before: list: let dfs' = us: visited: rest: @@ -540,28 +1121,46 @@ rec { (tail b.right ++ b.wrong); in dfs' (head list) [] (tail list); - /* Sort a list based on a partial ordering using DFS. This - implementation is O(N^2), if your ordering is linear, use `sort` - instead. + /** + Sort a list based on a partial ordering using DFS. This + implementation is O(N^2), if your ordering is linear, use `sort` + instead. - `before a b == true` means that `b` should be after `a` - in the result. + `before a b == true` means that `b` should be after `a` + in the result. - Example: - toposort hasPrefix [ "/home/user" "other" "/" "/home" ] - == { result = [ "/" "/home" "/home/user" "other" ]; } + # Inputs - toposort hasPrefix [ "/home/user" "other" "/" "/home" "/" ] - == { cycle = [ "/home/user" "/" "/" ]; # path leading to a cycle - loops = [ "/" ]; } # loops back to these elements + `before` - toposort hasPrefix [ "other" "/home/user" "/home" "/" ] - == { result = [ "other" "/" "/home" "/home/user" ]; } + : 1\. Function argument - toposort (a: b: a < b) [ 3 2 1 ] == { result = [ 1 2 3 ]; } + `list` - */ + : 2\. Function argument + + + # Examples + :::{.example} + ## `lib.lists.toposort` usage example + + ```nix + toposort hasPrefix [ "/home/user" "other" "/" "/home" ] + == { result = [ "/" "/home" "/home/user" "other" ]; } + + toposort hasPrefix [ "/home/user" "other" "/" "/home" "/" ] + == { cycle = [ "/home/user" "/" "/" ]; # path leading to a cycle + loops = [ "/" ]; } # loops back to these elements + + toposort hasPrefix [ "other" "/home/user" "/home" "/" ] + == { result = [ "other" "/" "/home" "/home/user" ]; } + + toposort (a: b: a < b) [ 3 2 1 ] == { result = [ 1 2 3 ]; } + ``` + + ::: + */ toposort = before: list: let dfsthis = listDfs true before list; @@ -581,24 +1180,45 @@ rec { else # there are no cycles { result = [ dfsthis.minimal ] ++ toporest.result; }; - /* Sort a list based on a comparator function which compares two - elements and returns true if the first argument is strictly below - the second argument. The returned list is sorted in an increasing - order. The implementation does a quick-sort. + /** + Sort a list based on a comparator function which compares two + elements and returns true if the first argument is strictly below + the second argument. The returned list is sorted in an increasing + order. The implementation does a quick-sort. - See also [`sortOn`](#function-library-lib.lists.sortOn), which applies the - default comparison on a function-derived property, and may be more efficient. + See also [`sortOn`](#function-library-lib.lists.sortOn), which applies the + default comparison on a function-derived property, and may be more efficient. - Example: - sort (p: q: p < q) [ 5 3 7 ] - => [ 3 5 7 ] + # Inputs - Type: - sort :: (a -> a -> Bool) -> [a] -> [a] + `comparator` + + : 1\. Function argument + + `list` + + : 2\. Function argument + + # Type + + ``` + sort :: (a -> a -> Bool) -> [a] -> [a] + ``` + + # Examples + :::{.example} + ## `lib.lists.sort` usage example + + ```nix + sort (p: q: p < q) [ 5 3 7 ] + => [ 3 5 7 ] + ``` + + ::: */ sort = builtins.sort; - /* + /** Sort a list based on the default comparison of a derived property `b`. The items are returned in `b`-increasing order. @@ -614,12 +1234,33 @@ rec { sortOn f == sort (p: q: f p < f q) ``` - Example: - sortOn stringLength [ "aa" "b" "cccc" ] - => [ "b" "aa" "cccc" ] - Type: - sortOn :: (a -> b) -> [a] -> [a], for comparable b + # Inputs + + `f` + + : 1\. Function argument + + `list` + + : 2\. Function argument + + # Type + + ``` + sortOn :: (a -> b) -> [a] -> [a], for comparable b + ``` + + # Examples + :::{.example} + ## `lib.lists.sortOn` usage example + + ```nix + sortOn stringLength [ "aa" "b" "cccc" ] + => [ "b" "aa" "cccc" ] + ``` + + ::: */ sortOn = f: list: let @@ -634,17 +1275,40 @@ rec { (a: b: head a < head b) pairs); - /* Compare two lists element-by-element. + /** + Compare two lists element-by-element. - Example: - compareLists compare [] [] - => 0 - compareLists compare [] [ "a" ] - => -1 - compareLists compare [ "a" ] [] - => 1 - compareLists compare [ "a" "b" ] [ "a" "c" ] - => -1 + # Inputs + + `cmp` + + : 1\. Function argument + + `a` + + : 2\. Function argument + + `b` + + : 3\. Function argument + + + # Examples + :::{.example} + ## `lib.lists.compareLists` usage example + + ```nix + compareLists compare [] [] + => 0 + compareLists compare [] [ "a" ] + => -1 + compareLists compare [ "a" ] [] + => 1 + compareLists compare [ "a" "b" ] [ "a" "c" ] + => -1 + ``` + + ::: */ compareLists = cmp: a: b: if a == [] @@ -658,16 +1322,32 @@ rec { then compareLists cmp (tail a) (tail b) else rel; - /* Sort list using "Natural sorting". - Numeric portions of strings are sorted in numeric order. + /** + Sort list using "Natural sorting". + Numeric portions of strings are sorted in numeric order. - Example: - naturalSort ["disk11" "disk8" "disk100" "disk9"] - => ["disk8" "disk9" "disk11" "disk100"] - naturalSort ["10.46.133.149" "10.5.16.62" "10.54.16.25"] - => ["10.5.16.62" "10.46.133.149" "10.54.16.25"] - naturalSort ["v0.2" "v0.15" "v0.0.9"] - => [ "v0.0.9" "v0.2" "v0.15" ] + + # Inputs + + `lst` + + : 1\. Function argument + + + # Examples + :::{.example} + ## `lib.lists.naturalSort` usage example + + ```nix + naturalSort ["disk11" "disk8" "disk100" "disk9"] + => ["disk8" "disk9" "disk11" "disk100"] + naturalSort ["10.46.133.149" "10.5.16.62" "10.54.16.25"] + => ["10.5.16.62" "10.46.133.149" "10.54.16.25"] + naturalSort ["v0.2" "v0.15" "v0.0.9"] + => [ "v0.0.9" "v0.2" "v0.15" ] + ``` + + ::: */ naturalSort = lst: let @@ -677,61 +1357,149 @@ rec { in map (x: elemAt x 1) (sort less prepared); - /* Return the first (at most) N elements of a list. + /** + Return the first (at most) N elements of a list. - Type: take :: int -> [a] -> [a] - Example: - take 2 [ "a" "b" "c" "d" ] - => [ "a" "b" ] - take 2 [ ] - => [ ] + # Inputs + + `count` + + : Number of elements to take + + `list` + + : Input list + + # Type + + ``` + take :: int -> [a] -> [a] + ``` + + # Examples + :::{.example} + ## `lib.lists.take` usage example + + ```nix + take 2 [ "a" "b" "c" "d" ] + => [ "a" "b" ] + take 2 [ ] + => [ ] + ``` + + ::: */ take = - # Number of elements to take count: sublist 0 count; - /* Remove the first (at most) N elements of a list. + /** + Remove the first (at most) N elements of a list. - Type: drop :: int -> [a] -> [a] - Example: - drop 2 [ "a" "b" "c" "d" ] - => [ "c" "d" ] - drop 2 [ ] - => [ ] + # Inputs + + `count` + + : Number of elements to drop + + `list` + + : Input list + + # Type + + ``` + drop :: int -> [a] -> [a] + ``` + + # Examples + :::{.example} + ## `lib.lists.drop` usage example + + ```nix + drop 2 [ "a" "b" "c" "d" ] + => [ "c" "d" ] + drop 2 [ ] + => [ ] + ``` + + ::: */ drop = - # Number of elements to drop count: - # Input list list: sublist count (length list) list; - /* Whether the first list is a prefix of the second list. + /** + Whether the first list is a prefix of the second list. - Type: hasPrefix :: [a] -> [a] -> bool - Example: + # Inputs + + `list1` + + : 1\. Function argument + + `list2` + + : 2\. Function argument + + # Type + + ``` + hasPrefix :: [a] -> [a] -> bool + ``` + + # Examples + :::{.example} + ## `lib.lists.hasPrefix` usage example + + ```nix hasPrefix [ 1 2 ] [ 1 2 3 4 ] => true hasPrefix [ 0 1 ] [ 1 2 3 4 ] => false + ``` + + ::: */ hasPrefix = list1: list2: take (length list1) list2 == list1; - /* Remove the first list as a prefix from the second list. - Error if the first list isn't a prefix of the second list. + /** + Remove the first list as a prefix from the second list. + Error if the first list isn't a prefix of the second list. - Type: removePrefix :: [a] -> [a] -> [a] + # Inputs - Example: + `list1` + + : 1\. Function argument + + `list2` + + : 2\. Function argument + + # Type + + ``` + removePrefix :: [a] -> [a] -> [a] + ``` + + # Examples + :::{.example} + ## `lib.lists.removePrefix` usage example + + ```nix removePrefix [ 1 2 ] [ 1 2 3 4 ] => [ 3 4 ] removePrefix [ 0 1 ] [ 1 2 3 4 ] => + ``` + + ::: */ removePrefix = list1: @@ -741,23 +1509,46 @@ rec { else throw "lib.lists.removePrefix: First argument is not a list prefix of the second argument"; - /* Return a list consisting of at most `count` elements of `list`, - starting at index `start`. + /** + Return a list consisting of at most `count` elements of `list`, + starting at index `start`. - Type: sublist :: int -> int -> [a] -> [a] + # Inputs - Example: - sublist 1 3 [ "a" "b" "c" "d" "e" ] - => [ "b" "c" "d" ] - sublist 1 3 [ ] - => [ ] + `start` + + : Index at which to start the sublist + + `count` + + : Number of elements to take + + `list` + + : Input list + + # Type + + ``` + sublist :: int -> int -> [a] -> [a] + ``` + + # Examples + :::{.example} + ## `lib.lists.sublist` usage example + + ```nix + sublist 1 3 [ "a" "b" "c" "d" "e" ] + => [ "b" "c" "d" ] + sublist 1 3 [ ] + => [ ] + ``` + + ::: */ sublist = - # Index at which to start the sublist start: - # Number of elements to take count: - # Input list list: let len = length list; in genList @@ -766,17 +1557,40 @@ rec { else if start + count > len then len - start else count); - /* The common prefix of two lists. + /** + The common prefix of two lists. - Type: commonPrefix :: [a] -> [a] -> [a] - Example: + # Inputs + + `list1` + + : 1\. Function argument + + `list2` + + : 2\. Function argument + + # Type + + ``` + commonPrefix :: [a] -> [a] -> [a] + ``` + + # Examples + :::{.example} + ## `lib.lists.commonPrefix` usage example + + ```nix commonPrefix [ 1 2 3 4 5 6 ] [ 1 2 4 8 ] => [ 1 2 ] commonPrefix [ 1 2 3 ] [ 1 2 3 4 5 ] => [ 1 2 3 ] commonPrefix [ 1 2 3 ] [ 4 5 6 ] => [ ] + ``` + + ::: */ commonPrefix = list1: @@ -792,87 +1606,225 @@ rec { in take commonPrefixLength list1; - /* Return the last element of a list. + /** + Return the last element of a list. - This function throws an error if the list is empty. + This function throws an error if the list is empty. - Type: last :: [a] -> a - Example: - last [ 1 2 3 ] - => 3 + # Inputs + + `list` + + : 1\. Function argument + + # Type + + ``` + last :: [a] -> a + ``` + + # Examples + :::{.example} + ## `lib.lists.last` usage example + + ```nix + last [ 1 2 3 ] + => 3 + ``` + + ::: */ last = list: assert lib.assertMsg (list != []) "lists.last: list must not be empty!"; elemAt list (length list - 1); - /* Return all elements but the last. + /** + Return all elements but the last. - This function throws an error if the list is empty. + This function throws an error if the list is empty. - Type: init :: [a] -> [a] - Example: - init [ 1 2 3 ] - => [ 1 2 ] + # Inputs + + `list` + + : 1\. Function argument + + # Type + + ``` + init :: [a] -> [a] + ``` + + # Examples + :::{.example} + ## `lib.lists.init` usage example + + ```nix + init [ 1 2 3 ] + => [ 1 2 ] + ``` + + ::: */ init = list: assert lib.assertMsg (list != []) "lists.init: list must not be empty!"; take (length list - 1) list; - /* Return the image of the cross product of some lists by a function. + /** + Return the image of the cross product of some lists by a function. - Example: - crossLists (x:y: "${toString x}${toString y}") [[1 2] [3 4]] - => [ "13" "14" "23" "24" ] + + # Examples + :::{.example} + ## `lib.lists.crossLists` usage example + + ```nix + crossLists (x:y: "${toString x}${toString y}") [[1 2] [3 4]] + => [ "13" "14" "23" "24" ] + ``` + + ::: */ crossLists = warn "lib.crossLists is deprecated, use lib.cartesianProductOfSets instead." (f: foldl (fs: args: concatMap (f: map f args) fs) [f]); - /* Remove duplicate elements from the list. O(n^2) complexity. + /** + Remove duplicate elements from the `list`. O(n^2) complexity. - Type: unique :: [a] -> [a] - Example: - unique [ 3 2 3 4 ] - => [ 3 2 4 ] - */ + # Inputs + + `list` + + : Input list + + # Type + + ``` + unique :: [a] -> [a] + ``` + + # Examples + :::{.example} + ## `lib.lists.unique` usage example + + ```nix + unique [ 3 2 3 4 ] + => [ 3 2 4 ] + ``` + + ::: + */ unique = foldl' (acc: e: if elem e acc then acc else acc ++ [ e ]) []; - /* Check if list contains only unique elements. O(n^2) complexity. + /** + Check if list contains only unique elements. O(n^2) complexity. - Type: allUnique :: [a] -> bool - Example: - allUnique [ 3 2 3 4 ] - => false - allUnique [ 3 2 4 1 ] - => true - */ + # Inputs + + `list` + + : 1\. Function argument + + # Type + + ``` + allUnique :: [a] -> bool + ``` + + # Examples + :::{.example} + ## `lib.lists.allUnique` usage example + + ```nix + allUnique [ 3 2 3 4 ] + => false + allUnique [ 3 2 4 1 ] + => true + ``` + + ::: + */ allUnique = list: (length (unique list) == length list); - /* Intersects list 'e' and another list. O(nm) complexity. + /** + Intersects list 'list1' and another list (`list2`). - Example: - intersectLists [ 1 2 3 ] [ 6 3 2 ] - => [ 3 2 ] + O(nm) complexity. + + # Inputs + + `list1` + + : First list + + `list2` + + : Second list + + + # Examples + :::{.example} + ## `lib.lists.intersectLists` usage example + + ```nix + intersectLists [ 1 2 3 ] [ 6 3 2 ] + => [ 3 2 ] + ``` + + ::: */ intersectLists = e: filter (x: elem x e); - /* Subtracts list 'e' from another list. O(nm) complexity. + /** + Subtracts list 'e' from another list (`list2`). - Example: - subtractLists [ 3 2 ] [ 1 2 3 4 5 3 ] - => [ 1 4 5 ] + O(nm) complexity. + + # Inputs + + `e` + + : First list + + `list2` + + : Second list + + + # Examples + :::{.example} + ## `lib.lists.subtractLists` usage example + + ```nix + subtractLists [ 3 2 ] [ 1 2 3 4 5 3 ] + => [ 1 4 5 ] + ``` + + ::: */ subtractLists = e: filter (x: !(elem x e)); - /* Test if two lists have no common element. - It should be slightly more efficient than (intersectLists a b == []) + /** + Test if two lists have no common element. + It should be slightly more efficient than (intersectLists a b == []) + + # Inputs + + `a` + + : 1\. Function argument + + `b` + + : 2\. Function argument */ mutuallyExclusive = a: b: length a == 0 || !(any (x: elem x a) b); diff --git a/nixos/modules/services/continuous-integration/hydra/default.nix b/nixos/modules/services/continuous-integration/hydra/default.nix index b1d44e67658b..10e1f0532c84 100644 --- a/nixos/modules/services/continuous-integration/hydra/default.nix +++ b/nixos/modules/services/continuous-integration/hydra/default.nix @@ -178,6 +178,24 @@ in description = lib.mdDoc "Whether to run the server in debug mode."; }; + maxServers = mkOption { + type = types.int; + default = 25; + description = lib.mdDoc "Maximum number of starman workers to spawn."; + }; + + minSpareServers = mkOption { + type = types.int; + default = 4; + description = lib.mdDoc "Minimum number of spare starman workers to keep."; + }; + + maxSpareServers = mkOption { + type = types.int; + default = 5; + description = lib.mdDoc "Maximum number of spare starman workers to keep."; + }; + extraConfig = mkOption { type = types.lines; description = lib.mdDoc "Extra lines for the Hydra configuration."; @@ -224,6 +242,16 @@ in ###### implementation config = mkIf cfg.enable { + assertions = [ + { + assertion = cfg.maxServers != 0 && cfg.maxSpareServers != 0 && cfg.minSpareServers != 0; + message = "services.hydra.{minSpareServers,maxSpareServers,minSpareServers} cannot be 0"; + } + { + assertion = cfg.minSpareServers < cfg.maxSpareServers; + message = "services.hydra.minSpareServers cannot be bigger than servives.hydra.maxSpareServers"; + } + ]; users.groups.hydra = { gid = config.ids.gids.hydra; @@ -258,7 +286,7 @@ in using_frontend_proxy = 1 base_uri = ${cfg.hydraURL} notification_sender = ${cfg.notificationSender} - max_servers = 25 + max_servers = ${toString cfg.maxServers} ${optionalString (cfg.logo != null) '' hydra_logo = ${cfg.logo} ''} @@ -359,8 +387,8 @@ in serviceConfig = { ExecStart = "@${hydra-package}/bin/hydra-server hydra-server -f -h '${cfg.listenHost}' " - + "-p ${toString cfg.port} --max_spare_servers 5 --max_servers 25 " - + "--max_requests 100 ${optionalString cfg.debugServer "-d"}"; + + "-p ${toString cfg.port} --min_spare_servers ${toString cfg.minSpareServers} --max_spare_servers ${toString cfg.maxSpareServers} " + + "--max_servers ${toString cfg.maxServers} --max_requests 100 ${optionalString cfg.debugServer "-d"}"; User = "hydra-www"; PermissionsStartOnly = true; Restart = "always"; diff --git a/nixos/modules/system/boot/binfmt.nix b/nixos/modules/system/boot/binfmt.nix index 08e3dce70844..2242c9da62d0 100644 --- a/nixos/modules/system/boot/binfmt.nix +++ b/nixos/modules/system/boot/binfmt.nix @@ -331,6 +331,7 @@ in { "proc-sys-fs-binfmt_misc.mount" "systemd-binfmt.service" ]; + services.systemd-binfmt.after = [ "systemd-tmpfiles-setup.service" ]; services.systemd-binfmt.restartTriggers = [ (builtins.toJSON config.boot.binfmt.registrations) ]; }) ]; diff --git a/pkgs/applications/audio/goattracker/default.nix b/pkgs/applications/audio/goattracker/default.nix index 148dd8788634..17373c1d5a52 100644 --- a/pkgs/applications/audio/goattracker/default.nix +++ b/pkgs/applications/audio/goattracker/default.nix @@ -58,7 +58,7 @@ in stdenv.mkDerivation (finalAttrs: { convert goattrk2.bmp goattracker.png install -Dm644 goattracker.png $out/share/icons/hicolor/32x32/apps/goattracker.png - install -Dm644 ../linux/goattracker.1 -t $out/share/man/man1/goattracker.1 + ${lib.optionalString (!isStereo) "install -Dm644 ../linux/goattracker.1 $out/share/man/man1/goattracker.1"} runHook postInstall ''; diff --git a/pkgs/applications/misc/1password/default.nix b/pkgs/applications/misc/1password/default.nix index b7df39ee2b08..895ba87f4f1e 100644 --- a/pkgs/applications/misc/1password/default.nix +++ b/pkgs/applications/misc/1password/default.nix @@ -12,12 +12,12 @@ let if extension == "zip" then fetchzip args else fetchurl args; pname = "1password-cli"; - version = "2.25.0"; + version = "2.25.1"; sources = rec { - aarch64-linux = fetch "linux_arm64" "sha256-Fs7psSWGqQqnUpGtU0nv1Mv+GysL/wD8AeVbMUDJ9pg=" "zip"; - i686-linux = fetch "linux_386" "sha256-Vqk2COKRtDkOn7960VknyHx7sZVHZ4GP+aaC1rU4eqc=" "zip"; - x86_64-linux = fetch "linux_amd64" "sha256-rMIZU92A13eiUqr35C+RTg3OTE9u8hcYJRinHoPWYTE=" "zip"; - aarch64-darwin = fetch "apple_universal" "sha256-JO7Hh8PUnW5D3GCJFPcVfIYXzHV6HkckqFnGK9vH7Qs=" "pkg"; + aarch64-linux = fetch "linux_arm64" "sha256-3LUfqTaLpJal/tjtRzTztm8H4wl1g4VSHWiFRukAqvE=" "zip"; + i686-linux = fetch "linux_386" "sha256-QJu4SHfM4zzHP14MKaSydAeFCvAPa4wsMh+JvWGR7J4=" "zip"; + x86_64-linux = fetch "linux_amd64" "sha256-erZCpCH5Q4VqGO045qKP5KAp07xKgMKrVrY54btT5BM=" "zip"; + aarch64-darwin = fetch "apple_universal" "sha256-kOAbr5MrDylgEQGMYUDklKCNNkZalVfJBcUwSZSMFH0=" "pkg"; x86_64-darwin = aarch64-darwin; }; platforms = builtins.attrNames sources; diff --git a/pkgs/applications/networking/cluster/krelay/default.nix b/pkgs/applications/networking/cluster/krelay/default.nix index ce890323a86a..ff274c4fb3d2 100644 --- a/pkgs/applications/networking/cluster/krelay/default.nix +++ b/pkgs/applications/networking/cluster/krelay/default.nix @@ -2,16 +2,16 @@ buildGoModule rec { pname = "krelay"; - version = "0.0.6"; + version = "0.0.7"; src = fetchFromGitHub { owner = "knight42"; repo = pname; rev = "v${version}"; - sha256 = "sha256-hyjseBIyPdY/xy163bGtfNR1rN/cQczJO53gu4/WmiU="; + hash = "sha256-FB+N4gSjAG/HyL5a/D44G4VVzlAQZ8Vjt+YUclCcy3w="; }; - vendorHash = "sha256-uDLc1W3jw3F+23C5S65Tcljiurobw4IRw7gYzZyBxQ0="; + vendorHash = "sha256-Nktv3yRrK2AypCzvQDH9gax65GJEXq6Fb3eBWvltQVk="; subPackages = [ "cmd/client" ]; @@ -22,7 +22,7 @@ buildGoModule rec { ''; meta = with lib; { - description = "A better alternative to `kubectl port-forward` that can forward TCP or UDP traffic to IP/Host which is accessible inside the cluster."; + description = "A drop-in replacement for `kubectl port-forward` with some enhanced features"; homepage = "https://github.com/knight42/krelay"; changelog = "https://github.com/knight42/krelay/releases/tag/v${version}"; license = licenses.mit; diff --git a/pkgs/applications/networking/p2p/stig/default.nix b/pkgs/applications/networking/p2p/stig/default.nix index 2119e80a93f4..b36ad59194d2 100644 --- a/pkgs/applications/networking/p2p/stig/default.nix +++ b/pkgs/applications/networking/p2p/stig/default.nix @@ -62,6 +62,8 @@ python310Packages.buildPythonApplication rec { description = "TUI and CLI for the BitTorrent client Transmission"; homepage = "https://github.com/rndusr/stig"; license = licenses.gpl3Plus; - maintainers = with maintainers; [ doronbehar ]; + # Too many broken tests, and it fails to launch + broken = true; + maintainers = with maintainers; [ ]; }; } diff --git a/pkgs/applications/version-management/gitea/default.nix b/pkgs/applications/version-management/gitea/default.nix index e5b05f211f62..4cc1be3bd642 100644 --- a/pkgs/applications/version-management/gitea/default.nix +++ b/pkgs/applications/version-management/gitea/default.nix @@ -20,12 +20,12 @@ buildGoModule rec { pname = "gitea"; - version = "1.21.7"; + version = "1.21.8"; # not fetching directly from the git repo, because that lacks several vendor files for the web UI src = fetchurl { url = "https://dl.gitea.com/gitea/${version}/gitea-src-${version}.tar.gz"; - hash = "sha256-d/3BPOSez7M2Xh2x9H2KsDIZ69PHinHIzQ6ekt/yWas="; + hash = "sha256-nJ357ckglXRcl205Cg4tg9ewmLn2MkKUDU3PpwBVlik="; }; vendorHash = null; diff --git a/pkgs/applications/networking/asn/default.nix b/pkgs/by-name/as/asn/package.nix similarity index 100% rename from pkgs/applications/networking/asn/default.nix rename to pkgs/by-name/as/asn/package.nix diff --git a/pkgs/by-name/be/bepass/package.nix b/pkgs/by-name/be/bepass/package.nix new file mode 100644 index 000000000000..9e74015f8d4c --- /dev/null +++ b/pkgs/by-name/be/bepass/package.nix @@ -0,0 +1,61 @@ +{ lib +, buildGoModule +, fetchFromGitHub +, enableGUI ? false # upstream working in progress +, pkg-config +, glfw +, xorg +, libXcursor +, libXrandr +, libXinerama +, xinput +, libXi +, libXxf86vm +}: +buildGoModule rec{ + pname = "bepass"; + version = "1.6.2"; + + src = fetchFromGitHub { + owner = "bepass-org"; + repo = "bepass"; + rev = "v${version}"; + hash = "sha256-ruOhPWNs1WWM3r6X+6ch0HoDCu/a+IkBQiCr0Wh6yS8="; + }; + + vendorHash = "sha256-SiggDy6vc19yIw15g45yjl8gscE91zUoR6woECbAtR0="; + + subPackages = [ + "cmd/cli" + ]; + proxyVendor = true; + nativeBuildInputs = lib.optionals enableGUI [ pkg-config ]; + buildInputs = lib.optionals enableGUI [ + glfw + xorg.libXft + libXcursor + libXrandr + libXinerama + libXi + xinput + libXxf86vm + ]; + + ldflags = [ + "-s" + "-w" + ]; + + postInstall = '' + mv $out/bin/cli $out/bin/bepass + ''; + + meta = with lib; { + homepage = "https://github.com/bepass-org/bepass"; + description = "A simple DPI bypass tool written in go"; + license = licenses.mit; + mainProgram = "bepass"; + maintainers = with maintainers; [ oluceps ]; + broken = enableGUI; + }; +} diff --git a/pkgs/by-name/co/cockpit/package.nix b/pkgs/by-name/co/cockpit/package.nix index b5cee2033ddd..46ae83705426 100644 --- a/pkgs/by-name/co/cockpit/package.nix +++ b/pkgs/by-name/co/cockpit/package.nix @@ -44,13 +44,13 @@ in stdenv.mkDerivation rec { pname = "cockpit"; - version = "311"; + version = "312"; src = fetchFromGitHub { owner = "cockpit-project"; repo = "cockpit"; rev = "refs/tags/${version}"; - hash = "sha256-RsOLYvwLu0eNmSZJoCi1dcB2a3JqMbus/gOyL74kCB4="; + hash = "sha256-X3IsUaqXlg/SlqHo9jK+hONY/6LAIAfRO9rAwCQcq64="; fetchSubmodules = true; }; diff --git a/pkgs/by-name/do/docfd/package.nix b/pkgs/by-name/do/docfd/package.nix index 41d4f3cbf543..8baa36826a70 100644 --- a/pkgs/by-name/do/docfd/package.nix +++ b/pkgs/by-name/do/docfd/package.nix @@ -1,8 +1,13 @@ -{ lib, ocamlPackages, fetchFromGitHub, python3, dune_3, makeWrapper, poppler_utils, fzf }: +{ lib +, ocamlPackages +, fetchFromGitHub +, python3 +, dune_3 +}: ocamlPackages.buildDunePackage rec { pname = "docfd"; - version = "2.2.0"; + version = "3.0.0"; minimalOCamlVersion = "5.1"; @@ -10,27 +15,37 @@ ocamlPackages.buildDunePackage rec { owner = "darrenldl"; repo = "docfd"; rev = version; - hash = "sha256-v6V9+/Ra19Xy6nCLe/ODJ1uVBwNkQO4lKcxcr2pmxIY="; + hash = "sha256-pJ5LlOfC+9NRfY7ng9LAxEnjr+mtJmhRNTo9Im6Lkbo="; }; - nativeBuildInputs = [ python3 dune_3 makeWrapper ]; - buildInputs = with ocamlPackages; [ oseq spelll notty nottui lwd cmdliner domainslib digestif yojson eio_main containers-data timedesc ]; - - postInstall = '' - # docfd needs pdftotext from popler_utils to allow pdf search - # also fzf for "docfd ?" usage - wrapProgram $out/bin/docfd --prefix PATH : "${lib.makeBinPath [ poppler_utils fzf ]}" - ''; + nativeBuildInputs = [ python3 dune_3 ]; + buildInputs = with ocamlPackages; [ + cmdliner + containers-data + digestif + domainslib + eio_main + lwd + nottui + notty + ocolor + oseq + spelll + timedesc + yojson + ]; meta = with lib; { description = "TUI multiline fuzzy document finder"; longDescription = '' - TUI multiline fuzzy document finder. - Think interactive grep for both text files and PDFs, but word/token based - instead of regex and line based, so you can search across lines easily. - Docfd aims to provide good UX via integration with common text editors - and PDF viewers, so you can jump directly to a search result with a - single key press. + Think interactive grep for both text and other document files, but + word/token based instead of regex and line based, so you can search + across lines easily. Aims to provide good UX via integration with + common text editors and other file viewers. + Optional dependencies: + fzf - for fuzzy file picker with "docfd ?". + poppler_utils - for pdf search. + pandoc - for .epub, .odt, .docx, .fb2, .ipynb, .html, & .htm files. ''; homepage = "https://github.com/darrenldl/docfd"; license = licenses.mit; diff --git a/pkgs/by-name/gg/gg/package.nix b/pkgs/by-name/gg/gg/package.nix new file mode 100644 index 000000000000..c07dd9bc99d5 --- /dev/null +++ b/pkgs/by-name/gg/gg/package.nix @@ -0,0 +1,41 @@ +{ lib +, buildGoModule +, fetchFromGitHub +, installShellFiles +}: +buildGoModule rec{ + pname = "gg"; + version = "0.2.18"; + + src = fetchFromGitHub { + owner = "mzz2017"; + repo = "gg"; + rev = "v${version}"; + hash = "sha256-07fP3dVFs4MZrFOH/8/4e3LHjFGZd7pNu6J3LBOWAd8="; + }; + + vendorHash = "sha256-fnM4ycqDyruCdCA1Cr4Ki48xeQiTG4l5dLVuAafEm14="; + + ldflags = [ + "-s" + "-w" + ]; + + nativeBuildInputs = [ installShellFiles ]; + + postInstall = '' + installShellCompletion --cmd gg \ + --bash completion/bash/gg \ + --fish completion/fish/gg.fish \ + --zsh completion/zsh/_gg + ''; + + meta = with lib; { + homepage = "https://github.com/mzz2017/gg"; + description = "Command-line tool for one-click proxy in your research and development"; + license = licenses.agpl3Only; + mainProgram = "gg"; + maintainers = with maintainers; [ oluceps ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/by-name/gi/git-releaser/package.nix b/pkgs/by-name/gi/git-releaser/package.nix index d615430bc935..10cf95a2ec7e 100644 --- a/pkgs/by-name/gi/git-releaser/package.nix +++ b/pkgs/by-name/gi/git-releaser/package.nix @@ -6,13 +6,13 @@ buildGoModule rec { pname = "git-releaser"; - version = "0.1.6"; + version = "0.1.7"; src = fetchFromGitHub { owner = "git-releaser"; repo = "git-releaser"; rev = "refs/tags/v${version}"; - hash = "sha256-nKmHTqnpWoWMyXxsD/+pk+uSeqZSG18h2T6sJ/wEr/w="; + hash = "sha256-bXW2/FpZnYV/zZ/DlaW2pUe2RUHLElPwqHm/J5gKJZI="; }; vendorHash = "sha256-RROA+nvdZnGfkUuB+ksUWGG16E8tqdyMQss2z/XWGd8="; diff --git a/pkgs/by-name/gn/gnome-graphs/package.nix b/pkgs/by-name/gn/gnome-graphs/package.nix new file mode 100644 index 000000000000..fb8f5bc1ae43 --- /dev/null +++ b/pkgs/by-name/gn/gnome-graphs/package.nix @@ -0,0 +1,71 @@ +{ lib +, python3Packages +, fetchFromGitLab +, meson +, ninja +, vala +, pkg-config +, gobject-introspection +, blueprint-compiler +, wrapGAppsHook4 +, desktop-file-utils +, shared-mime-info +, libadwaita +}: + +python3Packages.buildPythonApplication rec { + pname = "gnome-graphs"; + version = "1.7.2"; + pyproject = false; + + src = fetchFromGitLab { + domain = "gitlab.gnome.org"; + owner = "World"; + repo = "Graphs"; + rev = "v${version}"; + hash = "sha256-CgCLOkKrMEN0Jnib5NZyVa+s3ico2ANt0ALGa4we3Ak="; + }; + + nativeBuildInputs = [ + meson + ninja + vala + pkg-config + gobject-introspection + blueprint-compiler + wrapGAppsHook4 + desktop-file-utils + shared-mime-info + ]; + + buildInputs = [ + libadwaita + ]; + + propagatedBuildInputs = with python3Packages; [ + pygobject3 + numpy + numexpr + sympy + scipy + matplotlib + ]; + + dontWrapGApps = true; + + preFixup = '' + makeWrapperArgs+=( + "''${gappsWrapperArgs[@]}" + --prefix LD_LIBRARY_PATH : $out/lib + ) + ''; + + meta = with lib; { + description = "A simple, yet powerful tool that allows you to plot and manipulate your data with ease"; + homepage = "https://apps.gnome.org/Graphs"; + license = licenses.gpl3Plus; + mainProgram = "graphs"; + maintainers = with maintainers; [ aleksana ]; + platforms = platforms.linux; # locale.bindtextdomain only available on linux + }; +} diff --git a/pkgs/by-name/hy/hyprcursor/package.nix b/pkgs/by-name/hy/hyprcursor/package.nix new file mode 100644 index 000000000000..37add539a530 --- /dev/null +++ b/pkgs/by-name/hy/hyprcursor/package.nix @@ -0,0 +1,52 @@ +{ lib +, stdenv +, fetchFromGitHub +, cmake +, pkg-config +, cairo +, hyprlang +, librsvg +, libzip +, nix-update-script +}: +stdenv.mkDerivation (finalAttrs: { + pname = "hyprcursor"; + version = "0.1.4"; + + src = fetchFromGitHub { + owner = "hyprwm"; + repo = "hyprcursor"; + rev = "refs/tags/v${finalAttrs.version}"; + hash = "sha256-m5I69a5t+xXxNMQrFuzKgPR6nrFiWDEDnEqlVwTy4C4="; + }; + + nativeBuildInputs = [ + cmake + pkg-config + ]; + + buildInputs = [ + cairo + hyprlang + librsvg + libzip + ]; + + outputs = [ + "out" + "dev" + "lib" + ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + homepage = "https://github.com/hyprwm/hyprcursor"; + description = "The hyprland cursor format, library and utilities"; + changelog = "https://github.com/hyprwm/hyprcursor/releases/tag/v${finalAttrs.version}"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ iynaix ]; + mainProgram = "hyprcursor-util"; + platforms = lib.platforms.linux; + }; +}) diff --git a/pkgs/by-name/hy/hyprlock/package.nix b/pkgs/by-name/hy/hyprlock/package.nix index 5872e860474c..5bac39c63d49 100644 --- a/pkgs/by-name/hy/hyprlock/package.nix +++ b/pkgs/by-name/hy/hyprlock/package.nix @@ -18,13 +18,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "hyprlock"; - version = "0.1.0"; + version = "0.2.0"; src = fetchFromGitHub { owner = "hyprwm"; repo = "hyprlock"; rev = "v${finalAttrs.version}"; - hash = "sha256-SX3VRcewkqeAIY6ptgfk9+C6KB9aCEUOacb2pKl3kO0="; + hash = "sha256-1p6Y/8+ETaz7GQ8wsXLUTrk2dD0YN9ySOfwjRp2TSG4="; }; strictDeps = true; diff --git a/pkgs/by-name/id/idb-companion/package.nix b/pkgs/by-name/id/idb-companion/package.nix new file mode 100644 index 000000000000..f133373acfa6 --- /dev/null +++ b/pkgs/by-name/id/idb-companion/package.nix @@ -0,0 +1,35 @@ +{ lib +, stdenv +, fetchurl +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "idb-companion"; + version = "1.1.8"; + + src = fetchurl { + url = "https://github.com/facebook/idb/releases/download/v${finalAttrs.version}/idb-companion.universal.tar.gz"; + hash = "sha256-O3LMappbGiKhiCBahAkNOilDR6hGGA79dVzxo8hI4+c="; + }; + + sourceRoot = "idb-companion.universal"; + + installPhase = '' + runHook preInstall + + mkdir -p $out + cp -r . $out/ + + runHook postInstall + ''; + + meta = with lib; { + description = "A powerful command line tool for automating iOS simulators and devices"; + homepage = "https://github.com/facebook/idb"; + license = licenses.mit; + platforms = platforms.darwin; + mainProgram = "idb_companion"; + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; + maintainers = with maintainers; [ siddarthkay ]; + }; +}) diff --git a/pkgs/by-name/mb/mbpoll/package.nix b/pkgs/by-name/mb/mbpoll/package.nix new file mode 100644 index 000000000000..6a972506bfca --- /dev/null +++ b/pkgs/by-name/mb/mbpoll/package.nix @@ -0,0 +1,30 @@ +{ lib +, stdenv +, cmake +, pkg-config +, fetchFromGitHub +, libmodbus +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "mbpoll"; + version = "1.5"; + + src = fetchFromGitHub { + owner = "epsilonrt"; + repo = "mbpoll"; + rev = "v${finalAttrs.version}"; + hash = "sha256-rHjLDgfKtpREemttWt0pr7VtBjwZCSplUR4OWNBVW0c="; + }; + + buildInputs = [ libmodbus ]; + nativeBuildInputs = [ cmake pkg-config ]; + + meta = with lib; { + description = "Command line utility to communicate with ModBus slave (RTU or TCP)"; + homepage = "https://epsilonrt.fr"; + license = licenses.gpl3; + mainProgram = "mbpoll"; + platforms = platforms.linux; + }; +}) diff --git a/pkgs/by-name/nd/ndstrim/package.nix b/pkgs/by-name/nd/ndstrim/package.nix new file mode 100644 index 000000000000..403bd831a76b --- /dev/null +++ b/pkgs/by-name/nd/ndstrim/package.nix @@ -0,0 +1,50 @@ +{ lib +, fetchFromGitHub +, fetchpatch +, rustPlatform +}: + +rustPlatform.buildRustPackage rec { + pname = "ndstrim"; + version = "0.2.1"; + + src = fetchFromGitHub { + owner = "Nemris"; + repo = "ndstrim"; + rev = "v${version}"; + hash = "sha256-KgtejBbFg6+klc8OpCs1CIb+7uVPCtP0/EM671vxauk="; + }; + + patches = [ + # https://github.com/Nemris/ndstrim/pull/1 + (fetchpatch { + name = "update-cargo-lock.patch"; + url = "https://github.com/Nemris/ndstrim/commit/8147bb31a8fb5765f33562957a61cb6ddbe65513.patch"; + hash = "sha256-HsCc5un9dg0gRkRjwxtjms0cugqWhcTthGfcF50EgYA="; + }) + ]; + + cargoHash = "sha256-k5SlsIWHEZaYwk5cmLb1QMs3lk0VGGwiGd1TSQJC3Ss="; + + # TODO: remove this after upstream merge above patch. + # Without the workaround below the build results in the following error: + # Validating consistency between /build/source/Cargo.lock and /build/ndstrim-0.2.1-vendor.tar.gz/Cargo.lock + # + # < version = "0.2.1" + # --- + # > version = "0.1.0" + # + # ERROR: cargoHash or cargoSha256 is out of date + postPatch = '' + cargoSetupPostPatchHook() { true; } + ''; + + meta = with lib; { + description = "Trim the excess padding found in Nintendo DS(i) ROMs"; + homepage = "https://github.com/Nemris/ndstrim"; + license = licenses.mit; + platforms = platforms.unix; + maintainers = with maintainers; [ thiagokokada ]; + mainProgram = "ndstrim"; + }; +} diff --git a/pkgs/by-name/ne/netscanner/package.nix b/pkgs/by-name/ne/netscanner/package.nix new file mode 100644 index 000000000000..1e2beb336ad3 --- /dev/null +++ b/pkgs/by-name/ne/netscanner/package.nix @@ -0,0 +1,38 @@ +{ lib +, rustPlatform +, fetchFromGitHub +, makeWrapper +, iw +}: +let + pname = "netscanner"; + version = "0.4.1"; +in +rustPlatform.buildRustPackage { + inherit pname version; + + nativeBuildInputs = [ makeWrapper ]; + + src = fetchFromGitHub { + owner = "Chleba"; + repo = "netscanner"; + rev = "refs/tags/v${version}"; + hash = "sha256-E9WQpWqXWIhY1cq/5hqBbNBffe/nFLBelnFPW0tS5Ng="; + }; + + cargoHash = "sha256-G2ePiVmHyZ7a4gn7ZGg5y4lhfbWoWGh4+fG9pMHZueg="; + + postFixup = '' + wrapProgram $out/bin/netscanner \ + --prefix PATH : "${lib.makeBinPath [iw]}" + ''; + + meta = { + description = "Network scanner with features like WiFi scanning, packetdump and more"; + homepage = "https://github.com/Chleba/netscanner"; + changelog = "https://github.com/Chleba/netscanner/releases/tag/v${version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ NotAShelf ]; + mainProgram = "netscanner"; + }; +} diff --git a/pkgs/by-name/pn/pnpm-shell-completion/package.nix b/pkgs/by-name/pn/pnpm-shell-completion/package.nix new file mode 100644 index 000000000000..b789a1024a72 --- /dev/null +++ b/pkgs/by-name/pn/pnpm-shell-completion/package.nix @@ -0,0 +1,36 @@ +{ + rustPlatform, + fetchFromGitHub, + lib, + installShellFiles, +}: + +rustPlatform.buildRustPackage rec { + pname = "pnpm-shell-completion"; + version = "0.5.3"; + + src = fetchFromGitHub { + owner = "g-plane"; + repo = "pnpm-shell-completion"; + rev = "v${version}"; + hash = "sha256-UKuAUN1uGNy/1Fm4vXaTWBClHgda+Vns9C4ugfHm+0s="; + }; + + cargoHash = "sha256-Kf28hQ5PUHeH5ZSRSRdfHljlqIYU8MN0zQsyT0Sa2+4="; + + nativeBuildInputs = [ installShellFiles ]; + + postInstall = '' + installShellCompletion --cmd pnpm \ + --fish pnpm.fish \ + --zsh pnpm-shell-completion.plugin.zsh + ''; + + meta = with lib; { + homepage = "https://github.com/g-plane/pnpm-shell-completion"; + description = "Complete your pnpm command fastly"; + license = licenses.mit; + maintainers = with maintainers; [ donovanglover ]; + mainProgram = "pnpm-shell-completion"; + }; +} diff --git a/pkgs/by-name/ta/tana/package.nix b/pkgs/by-name/ta/tana/package.nix new file mode 100644 index 000000000000..0034f72725c6 --- /dev/null +++ b/pkgs/by-name/ta/tana/package.nix @@ -0,0 +1,111 @@ +{ libX11 +, libxcb +, libXcomposite +, libXdamage +, libXext +, libXfixes +, libXrandr +, stdenv +, lib +, alsa-lib +, at-spi2-atk +, atkmm +, cairo +, cups +, dbus +, expat +, glib +, gtk3 +, libdrm +, libglvnd +, libxkbcommon +, mesa +, nspr +, nss +, pango +, systemd +, fetchurl +, autoPatchelfHook +, dpkg +}: +let + glLibs = [ libglvnd mesa ]; + libs = [ + alsa-lib + atkmm + at-spi2-atk + cairo + cups + dbus + expat + glib + gtk3 + libdrm + libX11 + libxcb + libXcomposite + libXdamage + libXext + libXfixes + libxkbcommon + libXrandr + nspr + nss + pango + ]; + buildInputs = glLibs ++ libs; + runpathPackages = glLibs ++ [ stdenv.cc.cc stdenv.cc.libc ]; + version = "1.0.15"; +in +stdenv.mkDerivation { + pname = "tana"; + inherit version buildInputs; + + src = fetchurl { + url = "https://github.com/tanainc/tana-desktop-releases/releases/download/v${version}/tana_${version}_amd64.deb"; + hash = "sha256-94AyAwNFN5FCol97US1Pv8IN1+WMRA3St9kL2w+9FJU="; + }; + + nativeBuildInputs = [ + autoPatchelfHook + dpkg + ]; + + appendRunpaths = map (pkg: "${lib.getLib pkg}/lib") runpathPackages ++ [ "${placeholder "out"}/lib/tana" ]; + + # Needed for Zygote + runtimeDependencies = [ + systemd + ]; + + installPhase = '' + runHook preInstall + mkdir -p $out + cp -r usr/* $out + runHook postInstall + ''; + + postFixup = '' + substituteInPlace $out/share/applications/tana.desktop \ + --replace "Exec=tana" "Exec=$out/bin/tana" \ + --replace "Name=tana" "Name=Tana" + ''; + + meta = with lib; { + description = "Tana is an intelligent all-in-one workspace"; + longDescription = '' + At its core, Tana is an outline editor which can be extended to + cover multiple use-cases and different workflows. + For individuals, it supports GTD, P.A.R.A., Zettelkasten note-taking + out of the box. Teams can leverage the powerful project management + views, like Kanban. + To complete all, a powerful AI system is integrated to help with most + of the tasks. + ''; + homepage = "https://tana.inc"; + license = licenses.unfree; + maintainers = [ maintainers.massimogengarelli ]; + platforms = platforms.linux; + mainProgram = "tana"; + }; +} diff --git a/pkgs/by-name/uv/uv/Cargo.lock b/pkgs/by-name/uv/uv/Cargo.lock index c3898d12ea70..4c7b3d7182fe 100644 --- a/pkgs/by-name/uv/uv/Cargo.lock +++ b/pkgs/by-name/uv/uv/Cargo.lock @@ -490,6 +490,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + [[package]] name = "charset" version = "0.1.3" @@ -512,7 +518,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.0", + "windows-targets 0.52.4", ] [[package]] @@ -804,9 +810,9 @@ dependencies = [ [[package]] name = "ctrlc" -version = "3.4.2" +version = "3.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b467862cc8610ca6fc9a1532d7777cee0804e678ab45410897b9396495994a0b" +checksum = "672465ae37dc1bc6380a6547a8883d5dd397b0f1faaad4f265726cc7042a5345" dependencies = [ "nix", "windows-sys 0.52.0", @@ -1343,7 +1349,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.2.3", + "indexmap 2.2.5", "slab", "tokio", "tokio-util", @@ -1509,7 +1515,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core", + "windows-core 0.52.0", ] [[package]] @@ -1565,9 +1571,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.3" +version = "2.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" +checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" dependencies = [ "equivalent", "hashbrown 0.14.3", @@ -2025,12 +2031,13 @@ dependencies = [ [[package]] name = "nix" -version = "0.27.1" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ "bitflags 2.4.2", "cfg-if", + "cfg_aliases", "libc", ] @@ -2279,7 +2286,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.2.3", + "indexmap 2.2.5", ] [[package]] @@ -2374,7 +2381,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5699cc8a63d1aa2b1ee8e12b9ad70ac790d65788cd36101fa37f87ea46c4cef" dependencies = [ "base64 0.21.7", - "indexmap 2.2.3", + "indexmap 2.2.5", "line-wrap", "quick-xml", "serde", @@ -2493,9 +2500,9 @@ dependencies = [ [[package]] name = "pubgrub" version = "0.2.1" -source = "git+https://github.com/zanieb/pubgrub?rev=332f02b0e436ca8449c7ef5e15b992dd5f35908b#332f02b0e436ca8449c7ef5e15b992dd5f35908b" +source = "git+https://github.com/zanieb/pubgrub?rev=b5ead05c954b81690aec40255a1c36ec248e90af#b5ead05c954b81690aec40255a1c36ec248e90af" dependencies = [ - "indexmap 2.2.3", + "indexmap 2.2.5", "log", "priority-queue", "rustc-hash", @@ -2605,7 +2612,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b80f889b6d413c3f8963a2c7db03f95dd6e1d85e1074137cb2013ea2faa8898" dependencies = [ - "indexmap 2.2.3", + "indexmap 2.2.5", "pep440_rs", "pep508_rs", "serde", @@ -2738,9 +2745,9 @@ dependencies = [ [[package]] name = "reflink-copy" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "767be24c0da52e7448d495b8d162506a9aa125426651d547d545d6c2b4b65b62" +checksum = "52b1349400e2ffd64a9fb5ed9008e33c0b8ef86bd5bae8f73080839c7082f1d5" dependencies = [ "cfg-if", "rustix", @@ -2816,7 +2823,6 @@ dependencies = [ "pep508_rs", "regex", "reqwest", - "reqwest-middleware", "serde", "serde_json", "tempfile", @@ -2874,6 +2880,7 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", + "webpki-roots", "winreg", ] @@ -3883,7 +3890,7 @@ version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99e68c159e8f5ba8a28c4eb7b0c0c190d77bb479047ca713270048145a9ad28a" dependencies = [ - "indexmap 2.2.3", + "indexmap 2.2.5", "serde", "serde_spanned", "toml_datetime", @@ -3970,6 +3977,16 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "tracing-serde" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +dependencies = [ + "serde", + "tracing-core", +] + [[package]] name = "tracing-subscriber" version = "0.3.18" @@ -3980,12 +3997,15 @@ dependencies = [ "nu-ansi-term 0.46.0", "once_cell", "regex", + "serde", + "serde_json", "sharded-slab", "smallvec", "thread_local", "tracing", "tracing-core", "tracing-log", + "tracing-serde", ] [[package]] @@ -4179,7 +4199,7 @@ checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" [[package]] name = "uv" -version = "0.1.17" +version = "0.1.18" dependencies = [ "anstream", "anyhow", @@ -4199,7 +4219,7 @@ dependencies = [ "flate2", "fs-err", "futures", - "indexmap 2.2.3", + "indexmap 2.2.5", "indicatif", "indoc", "insta", @@ -4341,6 +4361,8 @@ dependencies = [ "rmp-serde", "rust-netrc", "rustc-hash", + "rustls", + "rustls-native-certs", "serde", "serde_json", "sha2", @@ -4359,6 +4381,7 @@ dependencies = [ "uv-normalize", "uv-version", "uv-warnings", + "webpki-roots", ] [[package]] @@ -4634,7 +4657,7 @@ dependencies = [ "either", "fs-err", "futures", - "indexmap 2.2.3", + "indexmap 2.2.5", "insta", "install-wheel-rs", "itertools 0.12.1", @@ -4691,7 +4714,7 @@ dependencies = [ [[package]] name = "uv-version" -version = "0.1.17" +version = "0.1.18" [[package]] name = "uv-virtualenv" @@ -4789,9 +4812,9 @@ dependencies = [ [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -4916,6 +4939,12 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.25.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" + [[package]] name = "weezl" version = "0.1.8" @@ -4968,12 +4997,12 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.52.0" +version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49" dependencies = [ - "windows-core", - "windows-targets 0.52.0", + "windows-core 0.54.0", + "windows-targets 0.52.4", ] [[package]] @@ -4982,7 +5011,26 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.4", +] + +[[package]] +name = "windows-core" +version = "0.54.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12661b9c89351d684a50a8a643ce5f608e20243b9fb84687800163429f161d65" +dependencies = [ + "windows-result", + "windows-targets 0.52.4", +] + +[[package]] +name = "windows-result" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd19df78e5168dfb0aedc343d1d1b8d422ab2db6756d2dc3fef75035402a3f64" +dependencies = [ + "windows-targets 0.52.4", ] [[package]] @@ -5000,7 +5048,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.4", ] [[package]] @@ -5020,17 +5068,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", ] [[package]] @@ -5041,9 +5089,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" [[package]] name = "windows_aarch64_msvc" @@ -5053,9 +5101,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" [[package]] name = "windows_i686_gnu" @@ -5065,9 +5113,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" [[package]] name = "windows_i686_msvc" @@ -5077,9 +5125,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" [[package]] name = "windows_x86_64_gnu" @@ -5089,9 +5137,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" [[package]] name = "windows_x86_64_gnullvm" @@ -5101,9 +5149,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" [[package]] name = "windows_x86_64_msvc" @@ -5113,9 +5161,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" [[package]] name = "winnow" diff --git a/pkgs/by-name/uv/uv/package.nix b/pkgs/by-name/uv/uv/package.nix index 25d0e7360e19..eacac082fa5b 100644 --- a/pkgs/by-name/uv/uv/package.nix +++ b/pkgs/by-name/uv/uv/package.nix @@ -6,24 +6,25 @@ , pkg-config , rustPlatform , stdenv +, nix-update-script }: rustPlatform.buildRustPackage rec { pname = "uv"; - version = "0.1.17"; + version = "0.1.18"; src = fetchFromGitHub { owner = "astral-sh"; repo = "uv"; rev = version; - hash = "sha256-nXH/9/c2UeG7LOJo0ZnozdI9df5cmVwICvgi0kRjgMU="; + hash = "sha256-lHvSfp+pCECVbuwSj7zNmheA1pleHaitKG0wf24s/CY="; }; cargoLock = { lockFile = ./Cargo.lock; outputHashes = { "async_zip-0.0.16" = "sha256-M94ceTCtyQc1AtPXYrVGplShQhItqZZa/x5qLiL+gs0="; - "pubgrub-0.2.1" = "sha256-1teDXUkXPbL7LZAYrlm2w5CEyb8g0bDqNhg5Jn0/puc="; + "pubgrub-0.2.1" = "sha256-C3A6WzpmR3l8MgUCFzoDdehLVRgk3/2VbCVFUS+iS9M="; }; }; @@ -47,6 +48,8 @@ rustPlatform.buildRustPackage rec { OPENSSL_NO_VENDOR = true; }; + passthru.updateScript = nix-update-script { }; + meta = with lib; { description = "An extremely fast Python package installer and resolver, written in Rust"; homepage = "https://github.com/astral-sh/uv"; diff --git a/pkgs/tools/X11/xdg-user-dirs/default.nix b/pkgs/by-name/xd/xdg-user-dirs/package.nix similarity index 58% rename from pkgs/tools/X11/xdg-user-dirs/default.nix rename to pkgs/by-name/xd/xdg-user-dirs/package.nix index f988f3cfe975..f1d4e97bc7da 100644 --- a/pkgs/tools/X11/xdg-user-dirs/default.nix +++ b/pkgs/by-name/xd/xdg-user-dirs/package.nix @@ -1,17 +1,30 @@ -{ lib, stdenv, fetchurl, libxslt, docbook_xsl, gettext, libiconv, makeWrapper }: +{ + lib, + stdenv, + fetchurl, + libxslt, + docbook_xsl, + gettext, + libiconv, + makeWrapper, +}: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "xdg-user-dirs"; version = "0.18"; src = fetchurl { - url = "https://user-dirs.freedesktop.org/releases/xdg-user-dirs-${version}.tar.gz"; - sha256 = "sha256-7G8G10lc26N6cyA5+bXhV4vLKWV2/eDaQO2y9SIg3zw="; + url = "https://user-dirs.freedesktop.org/releases/xdg-user-dirs-${finalAttrs.version}.tar.gz"; + hash = "sha256-7G8G10lc26N6cyA5+bXhV4vLKWV2/eDaQO2y9SIg3zw="; }; buildInputs = lib.optionals stdenv.isDarwin [ libiconv ]; - nativeBuildInputs = [ makeWrapper libxslt docbook_xsl ] ++ lib.optionals stdenv.isDarwin [ gettext ]; + nativeBuildInputs = [ + makeWrapper + libxslt + docbook_xsl + ] ++ lib.optionals stdenv.isDarwin [ gettext ]; preFixup = '' # fallback values need to be last @@ -23,7 +36,8 @@ stdenv.mkDerivation rec { homepage = "http://freedesktop.org/wiki/Software/xdg-user-dirs"; description = "A tool to help manage well known user directories like the desktop folder and the music folder"; license = licenses.gpl2; - maintainers = with maintainers; [ ]; + maintainers = with maintainers; [ donovanglover ]; platforms = platforms.unix; + mainProgram = "xdg-user-dirs-update"; }; -} +}) diff --git a/pkgs/data/fonts/sarasa-gothic/default.nix b/pkgs/data/fonts/sarasa-gothic/default.nix index f3a6b242b595..35f098442c22 100644 --- a/pkgs/data/fonts/sarasa-gothic/default.nix +++ b/pkgs/data/fonts/sarasa-gothic/default.nix @@ -2,13 +2,13 @@ stdenvNoCC.mkDerivation rec { pname = "sarasa-gothic"; - version = "1.0.6"; + version = "1.0.5"; src = fetchurl { # Use the 'ttc' files here for a smaller closure size. # (Using 'ttf' files gives a closure size about 15x larger, as of November 2021.) url = "https://github.com/be5invis/Sarasa-Gothic/releases/download/v${version}/Sarasa-TTC-${version}.7z"; - hash = "sha256-zoQilSAd5BpLCbTxU0Baupdc1VUxENvNEc9phFVFUoo="; + hash = "sha256-OPoX6GNCilA8Lj9kLO6RHapU7mpZTiNa/8LL72TG1Wk="; }; sourceRoot = "."; diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix index 24ea17d0d86e..09e1a62393a3 100644 --- a/pkgs/development/libraries/ffmpeg/generic.nix +++ b/pkgs/development/libraries/ffmpeg/generic.nix @@ -71,7 +71,7 @@ , withOpenmpt ? withFullDeps # Tracked music files decoder , withOpus ? withHeadlessDeps # Opus de/encoder , withPlacebo ? withFullDeps && !stdenv.isDarwin # libplacebo video processing library -, withPulse ? withSmallDeps && !stdenv.isDarwin # Pulseaudio input support +, withPulse ? withSmallDeps && stdenv.isLinux # Pulseaudio input support , withRav1e ? withFullDeps # AV1 encoder (focused on speed and safety) , withRtmp ? false # RTMP[E] support , withSamba ? withFullDeps && !stdenv.isDarwin && withGPLv3 # Samba protocol @@ -82,13 +82,13 @@ , withSrt ? withHeadlessDeps # Secure Reliable Transport (SRT) protocol , withSsh ? withHeadlessDeps # SFTP protocol , withSvg ? withFullDeps # SVG protocol -, withSvtav1 ? withHeadlessDeps && !stdenv.isAarch64 # AV1 encoder/decoder (focused on speed and correctness) +, withSvtav1 ? withHeadlessDeps && !stdenv.isAarch64 && !stdenv.hostPlatform.isMinGW # AV1 encoder/decoder (focused on speed and correctness) , withTensorflow ? false # Tensorflow dnn backend support , withTheora ? withHeadlessDeps # Theora encoder -, withV4l2 ? withHeadlessDeps && !stdenv.isDarwin # Video 4 Linux support +, withV4l2 ? withHeadlessDeps && stdenv.isLinux # Video 4 Linux support , withV4l2M2m ? withV4l2 , withVaapi ? withHeadlessDeps && (with stdenv; isLinux || isFreeBSD) # Vaapi hardware acceleration -, withVdpau ? withSmallDeps # Vdpau hardware acceleration +, withVdpau ? withSmallDeps && !stdenv.hostPlatform.isMinGW # Vdpau hardware acceleration , withVidStab ? withFullDeps && withGPL # Video stabilization , withVmaf ? withFullDeps && !stdenv.isAarch64 && lib.versionAtLeast version "5" # Netflix's VMAF (Video Multi-Method Assessment Fusion) , withVoAmrwbenc ? withFullDeps && withVersion3 # AMR-WB encoder @@ -714,7 +714,7 @@ stdenv.mkDerivation (finalAttrs: { addOpenGLRunpath ${placeholder "lib"}/lib/libavutil.so '' # https://trac.ffmpeg.org/ticket/10809 - + optionalString (versionAtLeast version "5.0" && withVulkan) '' + + optionalString (versionAtLeast version "5.0" && withVulkan && !stdenv.hostPlatform.isMinGW) '' patchelf $lib/lib/libavcodec.so --add-needed libvulkan.so --add-rpath ${lib.makeLibraryPath [ vulkan-loader ]} ''; @@ -741,6 +741,8 @@ stdenv.mkDerivation (finalAttrs: { ++ optional (withGPL && withUnfree) unfree; pkgConfigModules = [ "libavutil" ]; platforms = platforms.all; + # See https://github.com/NixOS/nixpkgs/pull/295344#issuecomment-1992263658 + broken = stdenv.hostPlatform.isMinGW && stdenv.hostPlatform.is64bit; maintainers = with maintainers; [ atemu arthsmn jopejoe1 ]; mainProgram = "ffmpeg"; }; diff --git a/pkgs/development/python-modules/airthings-ble/default.nix b/pkgs/development/python-modules/airthings-ble/default.nix index aa418733a6cc..91ceae7ea288 100644 --- a/pkgs/development/python-modules/airthings-ble/default.nix +++ b/pkgs/development/python-modules/airthings-ble/default.nix @@ -1,5 +1,6 @@ { lib , async-interrupt +, async-timeout , bleak , bleak-retry-connector , buildPythonPackage @@ -11,21 +12,21 @@ buildPythonPackage rec { pname = "airthings-ble"; - version = "0.6.1"; + version = "0.7.0"; pyproject = true; disabled = pythonOlder "3.9"; src = fetchFromGitHub { owner = "vincegio"; - repo = pname; - rev = "refs/tags/v${version}"; + repo = "airthings-ble"; + rev = "refs/tags/${version}"; hash = "sha256-A7Nrg0O+WVoHP+m8pz6idnNcxulwPYmMt9DfhKTHG24="; }; postPatch = '' substituteInPlace pyproject.toml \ - --replace "-v -Wdefault --cov=airthings_ble --cov-report=term-missing:skip-covered" "" + --replace-fail "-v -Wdefault --cov=airthings_ble --cov-report=term-missing:skip-covered" "" ''; nativeBuildInputs = [ @@ -36,6 +37,8 @@ buildPythonPackage rec { async-interrupt bleak bleak-retry-connector + ] ++ lib.optionals (pythonOlder "3.11") [ + async-timeout ]; nativeCheckInputs = [ diff --git a/pkgs/development/python-modules/beaker/default.nix b/pkgs/development/python-modules/beaker/default.nix index 58f7515c10d6..b55b8ce93c69 100644 --- a/pkgs/development/python-modules/beaker/default.nix +++ b/pkgs/development/python-modules/beaker/default.nix @@ -20,7 +20,7 @@ }: buildPythonPackage rec { - pname = "Beaker"; + pname = "beaker"; version = "1.11.0"; # The pypy release do not contains the tests diff --git a/pkgs/development/python-modules/blebox-uniapi/default.nix b/pkgs/development/python-modules/blebox-uniapi/default.nix index e91abe0b8f06..3381c0d1ccf8 100644 --- a/pkgs/development/python-modules/blebox-uniapi/default.nix +++ b/pkgs/development/python-modules/blebox-uniapi/default.nix @@ -12,7 +12,7 @@ buildPythonPackage rec { pname = "blebox-uniapi"; - version = "2.2.2"; + version = "2.3.0"; pyproject = true; disabled = pythonOlder "3.9"; @@ -21,7 +21,7 @@ buildPythonPackage rec { owner = "blebox"; repo = "blebox_uniapi"; rev = "refs/tags/v${version}"; - hash = "sha256-q1plIIcPY94zRD17srz5vMJzkk6K/xbbNIRB6zLlUo0="; + hash = "sha256-nqxbwHzx2cnojw/XX9XQoVvOCCd88tulY0m9xEHU3m4="; }; postPatch = '' diff --git a/pkgs/development/python-modules/hypercorn/default.nix b/pkgs/development/python-modules/hypercorn/default.nix index d8e6936e8dc3..bc9cddc48bf0 100644 --- a/pkgs/development/python-modules/hypercorn/default.nix +++ b/pkgs/development/python-modules/hypercorn/default.nix @@ -15,14 +15,14 @@ }: buildPythonPackage rec { - pname = "Hypercorn"; + pname = "hypercorn"; version = "0.14.3"; disabled = pythonOlder "3.7"; format = "pyproject"; src = fetchFromGitHub { owner = "pgjones"; - repo = pname; + repo = "Hypercorn"; rev = version; hash = "sha256-ECREs8UwqTWUweUrwnUwpVotCII2v4Bz7ZCk3DSAd8I="; }; diff --git a/pkgs/development/python-modules/pyipp/default.nix b/pkgs/development/python-modules/pyipp/default.nix index 3046d879ba61..bfeb5e4a5eee 100644 --- a/pkgs/development/python-modules/pyipp/default.nix +++ b/pkgs/development/python-modules/pyipp/default.nix @@ -15,7 +15,7 @@ buildPythonPackage rec { pname = "pyipp"; - version = "0.14.5"; + version = "0.15.0"; format = "pyproject"; disabled = pythonOlder "3.9"; @@ -24,7 +24,7 @@ buildPythonPackage rec { owner = "ctalkington"; repo = "python-ipp"; rev = "refs/tags/${version}"; - hash = "sha256-2YaQZWHrvz1OwD47WUl4UKoYXQBiemCWLM8m/zkipCU="; + hash = "sha256-k7NSCmugGov+lJXWeopUwKkGKL/EGhvxSSiby4CcmFM="; }; postPatch = '' diff --git a/pkgs/development/python-modules/pyqtwebengine/default.nix b/pkgs/development/python-modules/pyqtwebengine/default.nix index 4ad16f6ea0a6..ec15596b4048 100644 --- a/pkgs/development/python-modules/pyqtwebengine/default.nix +++ b/pkgs/development/python-modules/pyqtwebengine/default.nix @@ -9,14 +9,15 @@ let inherit (pythonPackages) buildPythonPackage python isPy27 pyqt5 sip pyqt-builder; inherit (darwin) autoSignDarwinBinariesHook; in buildPythonPackage (rec { - pname = "PyQtWebEngine"; + pname = "pyqtwebengine"; version = "5.15.6"; format = "pyproject"; disabled = isPy27; src = fetchPypi { - inherit pname version; + pname = "PyQtWebEngine"; + inherit version; sha256 = "sha256-riQe8qYceCk5xYtSwq6lOtmbMPOTTINY1eCm67P9ByE="; }; diff --git a/pkgs/development/python-modules/pysdl2/default.nix b/pkgs/development/python-modules/pysdl2/default.nix index 4903dbbbc241..0ab7010f0923 100644 --- a/pkgs/development/python-modules/pysdl2/default.nix +++ b/pkgs/development/python-modules/pysdl2/default.nix @@ -1,7 +1,7 @@ { stdenv, lib, substituteAll, fetchPypi, buildPythonPackage, SDL2, SDL2_ttf, SDL2_image, SDL2_gfx, SDL2_mixer }: buildPythonPackage rec { - pname = "PySDL2"; + pname = "pysdl2"; version = "0.9.16"; # The tests use OpenGL using find_library, which would have to be @@ -12,7 +12,8 @@ buildPythonPackage rec { pythonImportsCheck = [ "sdl2" ]; src = fetchPypi { - inherit pname version; + pname = "PySDL2"; + inherit version; hash = "sha256-ECdAa62+zdMP5W6AClp2rX1ycaOuwLes94DuJqAPLUA="; }; diff --git a/pkgs/development/python-modules/python-fontconfig/default.nix b/pkgs/development/python-modules/python-fontconfig/default.nix index 9a1416e0dbd6..7eab74cb280e 100644 --- a/pkgs/development/python-modules/python-fontconfig/default.nix +++ b/pkgs/development/python-modules/python-fontconfig/default.nix @@ -5,11 +5,12 @@ let fontDirectories = [ freefont_ttf ]; }; in buildPythonPackage rec { - pname = "Python-fontconfig"; + pname = "python-fontconfig"; version = "0.5.1"; src = fetchPypi { - inherit pname version; + pname = "Python-fontconfig"; + inherit version; sha256 = "154rfd0ygcbj9y8m32n537b457yijpfx9dvmf76vi0rg4ikf7kxp"; }; diff --git a/pkgs/development/python-modules/pywavelets/default.nix b/pkgs/development/python-modules/pywavelets/default.nix index 778148178cfb..a4d8117fc372 100644 --- a/pkgs/development/python-modules/pywavelets/default.nix +++ b/pkgs/development/python-modules/pywavelets/default.nix @@ -9,12 +9,13 @@ }: buildPythonPackage rec { - pname = "PyWavelets"; + pname = "pywavelets"; version = "1.4.1"; disabled = isPy27; src = fetchPypi { - inherit pname version; + pname = "PyWavelets"; + inherit version; hash = "sha256-ZDevPd8IMRjCbY+Xq0OwckuVbJ+Vjp6niGWfaig0upM="; }; diff --git a/pkgs/development/python-modules/qtpy/default.nix b/pkgs/development/python-modules/qtpy/default.nix index e534704a7c4a..59e03f836899 100644 --- a/pkgs/development/python-modules/qtpy/default.nix +++ b/pkgs/development/python-modules/qtpy/default.nix @@ -13,14 +13,15 @@ }: buildPythonPackage rec { - pname = "QtPy"; + pname = "qtpy"; version = "2.4.0"; format = "setuptools"; disabled = pythonOlder "3.7"; src = fetchPypi { - inherit pname version; + pname = "QtPy"; + inherit version; hash = "sha256-2y1QgWeqYQZ4FWXI2lxvFIfeusujNRnO3DX6iZfUJNQ="; }; diff --git a/pkgs/development/python-modules/robomachine/default.nix b/pkgs/development/python-modules/robomachine/default.nix index 613b47a8e601..afcdf0ed3599 100644 --- a/pkgs/development/python-modules/robomachine/default.nix +++ b/pkgs/development/python-modules/robomachine/default.nix @@ -10,12 +10,13 @@ }: buildPythonPackage rec { - pname = "RoboMachine"; + pname = "robomachine"; version = "0.10.0"; format = "pyproject"; src = fetchPypi { - inherit pname version; + pname = "RoboMachine"; + inherit version; hash = "sha256-XrxHaV9U7mZ2TvySHGm6qw1AsoukppzwPq4wufIjL+k="; }; diff --git a/pkgs/development/python-modules/xstatic-asciinema-player/default.nix b/pkgs/development/python-modules/xstatic-asciinema-player/default.nix index d970f0888aa8..7651ce57c10d 100644 --- a/pkgs/development/python-modules/xstatic-asciinema-player/default.nix +++ b/pkgs/development/python-modules/xstatic-asciinema-player/default.nix @@ -4,11 +4,12 @@ }: buildPythonPackage rec { - pname = "XStatic-asciinema-player"; + pname = "xstatic-asciinema-player"; version = "2.6.1.1"; src = fetchPypi { - inherit version pname; + pname = "XStatic-asciinema-player"; + inherit version; sha256 = "sha256-yA6WC067St82Dm6StaCKdWrRBhmNemswetIO8iodfcw="; }; diff --git a/pkgs/development/python-modules/xstatic-bootbox/default.nix b/pkgs/development/python-modules/xstatic-bootbox/default.nix index 6e5200d2a887..49c0f7d783fb 100644 --- a/pkgs/development/python-modules/xstatic-bootbox/default.nix +++ b/pkgs/development/python-modules/xstatic-bootbox/default.nix @@ -4,11 +4,12 @@ }: buildPythonPackage rec { - pname = "XStatic-Bootbox"; + pname = "xstatic-bootbox"; version = "5.5.1.1"; src = fetchPypi { - inherit version pname; + pname = "XStatic-Bootbox"; + inherit version; sha256 = "4b2120bb33a1d8ada8f9e0532ad99987aa03879b17b08bfdc6b8326d6eb7c205"; }; diff --git a/pkgs/development/python-modules/xstatic-bootstrap/default.nix b/pkgs/development/python-modules/xstatic-bootstrap/default.nix index 0d9962e5faf5..808957f70d14 100644 --- a/pkgs/development/python-modules/xstatic-bootstrap/default.nix +++ b/pkgs/development/python-modules/xstatic-bootstrap/default.nix @@ -4,11 +4,12 @@ }: buildPythonPackage rec { - pname = "XStatic-Bootstrap"; + pname = "xstatic-bootstrap"; version = "4.5.3.1"; src = fetchPypi { - inherit version pname; + pname = "XStatic-Bootstrap"; + inherit version; sha256 = "cf67d205437b32508a88b69a7e7c5bbe2ca5a8ae71097391a6a6f510ebfd2820"; }; diff --git a/pkgs/development/python-modules/xstatic-font-awesome/default.nix b/pkgs/development/python-modules/xstatic-font-awesome/default.nix index 71028393dc8c..07bce6f3c4c0 100644 --- a/pkgs/development/python-modules/xstatic-font-awesome/default.nix +++ b/pkgs/development/python-modules/xstatic-font-awesome/default.nix @@ -4,11 +4,12 @@ }: buildPythonPackage rec { - pname = "XStatic-Font-Awesome"; + pname = "xstatic-font-awesome"; version = "6.2.1.1"; src = fetchPypi { - inherit version pname; + pname = "XStatic-Font-Awesome"; + inherit version; sha256 = "sha256-8HWHEJYShjjy4VOQINgid1TD2IXdaOfubemgEjUHaCg="; }; diff --git a/pkgs/development/python-modules/xstatic-jquery-file-upload/default.nix b/pkgs/development/python-modules/xstatic-jquery-file-upload/default.nix index ce3f8c76dfa6..29ab4f1cb062 100644 --- a/pkgs/development/python-modules/xstatic-jquery-file-upload/default.nix +++ b/pkgs/development/python-modules/xstatic-jquery-file-upload/default.nix @@ -5,11 +5,12 @@ }: buildPythonPackage rec { - pname = "XStatic-jQuery-File-Upload"; + pname = "xstatic-jquery-file-upload"; version = "10.31.0.1"; src = fetchPypi { - inherit version pname; + pname = "XStatic-jQuery-File-Upload"; + inherit version; sha256 = "7d716f26aca14732c35c54f0ba6d38187600ab472fc98a91d972d12c5a70db27"; }; diff --git a/pkgs/development/python-modules/xstatic-jquery/default.nix b/pkgs/development/python-modules/xstatic-jquery/default.nix index e2a8f8266111..bd48c889f3f0 100644 --- a/pkgs/development/python-modules/xstatic-jquery/default.nix +++ b/pkgs/development/python-modules/xstatic-jquery/default.nix @@ -4,11 +4,12 @@ }: buildPythonPackage rec { - pname = "XStatic-jQuery"; + pname = "xstatic-jquery"; version = "3.5.1.1"; src = fetchPypi { - inherit version pname; + pname = "XStatic-jQuery"; + inherit version; sha256 = "e0ae8f8ec5bbd28045ba4bca06767a38bd5fc27cf9b71f434589f59370dcd323"; }; diff --git a/pkgs/development/python-modules/xstatic-pygments/default.nix b/pkgs/development/python-modules/xstatic-pygments/default.nix index 68fc2339f559..6d8391dcb8aa 100644 --- a/pkgs/development/python-modules/xstatic-pygments/default.nix +++ b/pkgs/development/python-modules/xstatic-pygments/default.nix @@ -4,11 +4,12 @@ }: buildPythonPackage rec { - pname = "XStatic-Pygments"; + pname = "xstatic-pygments"; version = "2.9.0.1"; src = fetchPypi { - inherit version pname; + pname = "XStatic-Pygments"; + inherit version; sha256 = "082c1e9fe606fbbef474f78b6fdb19e9a2efcc7a9b7d94163cf66f7bfae75762"; }; diff --git a/pkgs/development/python-modules/xstatic/default.nix b/pkgs/development/python-modules/xstatic/default.nix index d9d6e0398355..593dd7e9dd9e 100644 --- a/pkgs/development/python-modules/xstatic/default.nix +++ b/pkgs/development/python-modules/xstatic/default.nix @@ -4,11 +4,12 @@ }: buildPythonPackage rec { - pname = "XStatic"; + pname = "xstatic"; version = "1.0.3"; src = fetchPypi { - inherit version pname; + pname = "XStatic"; + inherit version; sha256 = "sha256-QCVEzJ4XlIlEEFTwnIB4BOEV6iRpB96HwDVftPWjEmg="; }; diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index d1f179168c75..135d61fd71d7 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -232,7 +232,7 @@ stdenv.mkDerivation (finalAttrs: { # https://github.com/NixOS/nixpkgs/pull/282607 (fetchpatch { url = "https://github.com/systemd/systemd/commit/8040fa55a1cbc34dede3205a902095ecd26c21e3.patch"; - sha256 = "0l8jk0w0wavagzck0vy5m0s6fhxab0hpdr4ib111bacqrvvda3kd"; + sha256 = "0c6z7bsndbkb8m130jnjpsl138sfv3q171726n5vkyl2n9ihnavk"; }) ] ++ lib.optional stdenv.hostPlatform.isMusl ( let diff --git a/pkgs/servers/dns/pdns-recursor/default.nix b/pkgs/servers/dns/pdns-recursor/default.nix index e691336d52a9..d56b4c7c0359 100644 --- a/pkgs/servers/dns/pdns-recursor/default.nix +++ b/pkgs/servers/dns/pdns-recursor/default.nix @@ -8,11 +8,11 @@ stdenv.mkDerivation (finalAttrs: { pname = "pdns-recursor"; - version = "5.0.2"; + version = "5.0.3"; src = fetchurl { url = "https://downloads.powerdns.com/releases/pdns-recursor-${finalAttrs.version}.tar.bz2"; - hash = "sha256-qQ6LYf3BgbWWFEw1kgEYynHDuV9GZYzOfoIidQ3kXKk="; + hash = "sha256-AdFwooUOsqylAdaDijREE2WJmA1cssK1M5K3ZFnjjAc="; }; cargoDeps = rustPlatform.fetchCargoTarball { diff --git a/pkgs/servers/nosql/mongodb/6.0.nix b/pkgs/servers/nosql/mongodb/6.0.nix index edc7ee047466..b17c41916928 100644 --- a/pkgs/servers/nosql/mongodb/6.0.nix +++ b/pkgs/servers/nosql/mongodb/6.0.nix @@ -9,6 +9,9 @@ buildMongoDB { version = "6.0.13"; sha256 = "sha256-BD3XrTdv4sCa3h37o1A2s3/R0R8zHiR59a4pY0RxLGU="; patches = [ + # Patches a bug that it couldn't build MongoDB 6.0 on gcc 13 because a include in ctype.h was missing + ./fix-gcc-13-ctype-6_0.patch + (fetchpatch { name = "mongodb-6.1.0-rc-more-specific-cache-alignment-types.patch"; url = "https://github.com/mongodb/mongo/commit/5435f9585f857f6145beaf6d31daf336453ba86f.patch"; diff --git a/pkgs/servers/nosql/mongodb/fix-gcc-13-ctype-6_0.patch b/pkgs/servers/nosql/mongodb/fix-gcc-13-ctype-6_0.patch new file mode 100644 index 000000000000..5473997e56c9 --- /dev/null +++ b/pkgs/servers/nosql/mongodb/fix-gcc-13-ctype-6_0.patch @@ -0,0 +1,12 @@ +diff --git a/src/mongo/util/ctype.h b/src/mongo/util/ctype.h +index a3880e2..78ee57e 100644 +--- a/src/mongo/util/ctype.h ++++ b/src/mongo/util/ctype.h +@@ -67,6 +67,7 @@ + #pragma once + + #include ++#include + + namespace mongo::ctype { + namespace detail { diff --git a/pkgs/tools/misc/fastfetch/default.nix b/pkgs/tools/misc/fastfetch/default.nix index 2e727896905d..7c76a4219f66 100644 --- a/pkgs/tools/misc/fastfetch/default.nix +++ b/pkgs/tools/misc/fastfetch/default.nix @@ -43,13 +43,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "fastfetch"; - version = "2.8.7"; + version = "2.8.8"; src = fetchFromGitHub { owner = "fastfetch-cli"; repo = "fastfetch"; rev = finalAttrs.version; - hash = "sha256-lJRTw8Z//x6tMpwfwSodTz7aVbnJPt3rac7AudqF+DA="; + hash = "sha256-IvAUlCDtrtBiaKZbhAiXqQXbpKiqIaKwMVC3NxaAqtw="; }; outputs = [ "out" "man" ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e57606d58315..de5d8f01a6d5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -278,8 +278,6 @@ with pkgs; asitop = pkgs.python3Packages.callPackage ../os-specific/darwin/asitop { }; - asn = callPackage ../applications/networking/asn { }; - asnmap = callPackage ../tools/security/asnmap { }; astrolog = callPackage ../applications/science/astronomy/astrolog { }; @@ -36204,8 +36202,6 @@ with pkgs; xdg-desktop-portal-xapp = callPackage ../development/libraries/xdg-desktop-portal-xapp { }; - xdg-user-dirs = callPackage ../tools/X11/xdg-user-dirs { }; - xdg-utils = callPackage ../tools/X11/xdg-utils {}; xdgmenumaker = callPackage ../applications/misc/xdgmenumaker { };