Merge master into haskell-updates
This commit is contained in:
commit
ab393cab63
@ -117,8 +117,55 @@ rec {
|
||||
callPackageWith = autoArgs: fn: args:
|
||||
let
|
||||
f = if lib.isFunction fn then fn else import fn;
|
||||
auto = builtins.intersectAttrs (lib.functionArgs f) autoArgs;
|
||||
in makeOverridable f (auto // args);
|
||||
fargs = lib.functionArgs f;
|
||||
|
||||
# All arguments that will be passed to the function
|
||||
# This includes automatic ones and ones passed explicitly
|
||||
allArgs = builtins.intersectAttrs fargs autoArgs // args;
|
||||
|
||||
# A list of argument names that the function requires, but
|
||||
# wouldn't be passed to it
|
||||
missingArgs = lib.attrNames
|
||||
# Filter out arguments that have a default value
|
||||
(lib.filterAttrs (name: value: ! value)
|
||||
# Filter out arguments that would be passed
|
||||
(removeAttrs fargs (lib.attrNames allArgs)));
|
||||
|
||||
# Get a list of suggested argument names for a given missing one
|
||||
getSuggestions = arg: lib.pipe (autoArgs // args) [
|
||||
lib.attrNames
|
||||
# Only use ones that are at most 2 edits away. While mork would work,
|
||||
# levenshteinAtMost is only fast for 2 or less.
|
||||
(lib.filter (lib.strings.levenshteinAtMost 2 arg))
|
||||
# Put strings with shorter distance first
|
||||
(lib.sort (x: y: lib.strings.levenshtein x arg < lib.strings.levenshtein y arg))
|
||||
# Only take the first couple results
|
||||
(lib.take 3)
|
||||
# Quote all entries
|
||||
(map (x: "\"" + x + "\""))
|
||||
];
|
||||
|
||||
prettySuggestions = suggestions:
|
||||
if suggestions == [] then ""
|
||||
else if lib.length suggestions == 1 then ", did you mean ${lib.elemAt suggestions 0}?"
|
||||
else ", did you mean ${lib.concatStringsSep ", " (lib.init suggestions)} or ${lib.last suggestions}?";
|
||||
|
||||
errorForArg = arg:
|
||||
let
|
||||
loc = builtins.unsafeGetAttrPos arg fargs;
|
||||
# loc' can be removed once lib/minver.nix is >2.3.4, since that includes
|
||||
# https://github.com/NixOS/nix/pull/3468 which makes loc be non-null
|
||||
loc' = if loc != null then loc.file + ":" + toString loc.line
|
||||
else if ! lib.isFunction fn then
|
||||
toString fn + lib.optionalString (lib.sources.pathIsDirectory fn) "/default.nix"
|
||||
else "<unknown location>";
|
||||
in "Function called without required argument \"${arg}\" at "
|
||||
+ "${loc'}${prettySuggestions (getSuggestions arg)}";
|
||||
|
||||
# Only show the error for the first missing argument
|
||||
error = errorForArg (lib.head missingArgs);
|
||||
|
||||
in if missingArgs == [] then makeOverridable f allArgs else throw error;
|
||||
|
||||
|
||||
/* Like callPackage, but for a function that returns an attribute
|
||||
|
127
lib/strings.nix
127
lib/strings.nix
@ -774,4 +774,131 @@ rec {
|
||||
(x: if stringLength x == 0 then "unknown" else x)
|
||||
];
|
||||
|
||||
/* Computes the Levenshtein distance between two strings.
|
||||
Complexity O(n*m) where n and m are the lengths of the strings.
|
||||
Algorithm adjusted from https://stackoverflow.com/a/9750974/6605742
|
||||
|
||||
Type: levenshtein :: string -> string -> int
|
||||
|
||||
Example:
|
||||
levenshtein "foo" "foo"
|
||||
=> 0
|
||||
levenshtein "book" "hook"
|
||||
=> 1
|
||||
levenshtein "hello" "Heyo"
|
||||
=> 3
|
||||
*/
|
||||
levenshtein = a: b: let
|
||||
# Two dimensional array with dimensions (stringLength a + 1, stringLength b + 1)
|
||||
arr = lib.genList (i:
|
||||
lib.genList (j:
|
||||
dist i j
|
||||
) (stringLength b + 1)
|
||||
) (stringLength a + 1);
|
||||
d = x: y: lib.elemAt (lib.elemAt arr x) y;
|
||||
dist = i: j:
|
||||
let c = if substring (i - 1) 1 a == substring (j - 1) 1 b
|
||||
then 0 else 1;
|
||||
in
|
||||
if j == 0 then i
|
||||
else if i == 0 then j
|
||||
else lib.min
|
||||
( lib.min (d (i - 1) j + 1) (d i (j - 1) + 1))
|
||||
( d (i - 1) (j - 1) + c );
|
||||
in d (stringLength a) (stringLength b);
|
||||
|
||||
/* Returns the length of the prefix common to both strings.
|
||||
*/
|
||||
commonPrefixLength = a: b:
|
||||
let
|
||||
m = lib.min (stringLength a) (stringLength b);
|
||||
go = i: if i >= m then m else if substring i 1 a == substring i 1 b then go (i + 1) else i;
|
||||
in go 0;
|
||||
|
||||
/* Returns the length of the suffix common to both strings.
|
||||
*/
|
||||
commonSuffixLength = a: b:
|
||||
let
|
||||
m = lib.min (stringLength a) (stringLength b);
|
||||
go = i: if i >= m then m else if substring (stringLength a - i - 1) 1 a == substring (stringLength b - i - 1) 1 b then go (i + 1) else i;
|
||||
in go 0;
|
||||
|
||||
/* Returns whether the levenshtein distance between two strings is at most some value
|
||||
Complexity is O(min(n,m)) for k <= 2 and O(n*m) otherwise
|
||||
|
||||
Type: levenshteinAtMost :: int -> string -> string -> bool
|
||||
|
||||
Example:
|
||||
levenshteinAtMost 0 "foo" "foo"
|
||||
=> true
|
||||
levenshteinAtMost 1 "foo" "boa"
|
||||
=> false
|
||||
levenshteinAtMost 2 "foo" "boa"
|
||||
=> true
|
||||
levenshteinAtMost 2 "This is a sentence" "this is a sentense."
|
||||
=> false
|
||||
levenshteinAtMost 3 "This is a sentence" "this is a sentense."
|
||||
=> true
|
||||
|
||||
*/
|
||||
levenshteinAtMost = let
|
||||
infixDifferAtMost1 = x: y: stringLength x <= 1 && stringLength y <= 1;
|
||||
|
||||
# This function takes two strings stripped by their common pre and suffix,
|
||||
# and returns whether they differ by at most two by Levenshtein distance.
|
||||
# Because of this stripping, if they do indeed differ by at most two edits,
|
||||
# we know that those edits were (if at all) done at the start or the end,
|
||||
# while the middle has to have stayed the same. This fact is used in the
|
||||
# implementation.
|
||||
infixDifferAtMost2 = x: y:
|
||||
let
|
||||
xlen = stringLength x;
|
||||
ylen = stringLength y;
|
||||
# This function is only called with |x| >= |y| and |x| - |y| <= 2, so
|
||||
# diff is one of 0, 1 or 2
|
||||
diff = xlen - ylen;
|
||||
|
||||
# Infix of x and y, stripped by the left and right most character
|
||||
xinfix = substring 1 (xlen - 2) x;
|
||||
yinfix = substring 1 (ylen - 2) y;
|
||||
|
||||
# x and y but a character deleted at the left or right
|
||||
xdelr = substring 0 (xlen - 1) x;
|
||||
xdell = substring 1 (xlen - 1) x;
|
||||
ydelr = substring 0 (ylen - 1) y;
|
||||
ydell = substring 1 (ylen - 1) y;
|
||||
in
|
||||
# A length difference of 2 can only be gotten with 2 delete edits,
|
||||
# which have to have happened at the start and end of x
|
||||
# Example: "abcdef" -> "bcde"
|
||||
if diff == 2 then xinfix == y
|
||||
# A length difference of 1 can only be gotten with a deletion on the
|
||||
# right and a replacement on the left or vice versa.
|
||||
# Example: "abcdef" -> "bcdez" or "zbcde"
|
||||
else if diff == 1 then xinfix == ydelr || xinfix == ydell
|
||||
# No length difference can either happen through replacements on both
|
||||
# sides, or a deletion on the left and an insertion on the right or
|
||||
# vice versa
|
||||
# Example: "abcdef" -> "zbcdez" or "bcdefz" or "zabcde"
|
||||
else xinfix == yinfix || xdelr == ydell || xdell == ydelr;
|
||||
|
||||
in k: if k <= 0 then a: b: a == b else
|
||||
let f = a: b:
|
||||
let
|
||||
alen = stringLength a;
|
||||
blen = stringLength b;
|
||||
prelen = commonPrefixLength a b;
|
||||
suflen = commonSuffixLength a b;
|
||||
presuflen = prelen + suflen;
|
||||
ainfix = substring prelen (alen - presuflen) a;
|
||||
binfix = substring prelen (blen - presuflen) b;
|
||||
in
|
||||
# Make a be the bigger string
|
||||
if alen < blen then f b a
|
||||
# If a has over k more characters than b, even with k deletes on a, b can't be reached
|
||||
else if alen - blen > k then false
|
||||
else if k == 1 then infixDifferAtMost1 ainfix binfix
|
||||
else if k == 2 then infixDifferAtMost2 ainfix binfix
|
||||
else levenshtein ainfix binfix <= k;
|
||||
in f;
|
||||
}
|
||||
|
@ -913,4 +913,156 @@ runTests {
|
||||
};
|
||||
};
|
||||
|
||||
## Levenshtein distance functions and co.
|
||||
testCommonPrefixLengthEmpty = {
|
||||
expr = strings.commonPrefixLength "" "hello";
|
||||
expected = 0;
|
||||
};
|
||||
|
||||
testCommonPrefixLengthSame = {
|
||||
expr = strings.commonPrefixLength "hello" "hello";
|
||||
expected = 5;
|
||||
};
|
||||
|
||||
testCommonPrefixLengthDiffering = {
|
||||
expr = strings.commonPrefixLength "hello" "hey";
|
||||
expected = 2;
|
||||
};
|
||||
|
||||
testCommonSuffixLengthEmpty = {
|
||||
expr = strings.commonSuffixLength "" "hello";
|
||||
expected = 0;
|
||||
};
|
||||
|
||||
testCommonSuffixLengthSame = {
|
||||
expr = strings.commonSuffixLength "hello" "hello";
|
||||
expected = 5;
|
||||
};
|
||||
|
||||
testCommonSuffixLengthDiffering = {
|
||||
expr = strings.commonSuffixLength "test" "rest";
|
||||
expected = 3;
|
||||
};
|
||||
|
||||
testLevenshteinEmpty = {
|
||||
expr = strings.levenshtein "" "";
|
||||
expected = 0;
|
||||
};
|
||||
|
||||
testLevenshteinOnlyAdd = {
|
||||
expr = strings.levenshtein "" "hello there";
|
||||
expected = 11;
|
||||
};
|
||||
|
||||
testLevenshteinOnlyRemove = {
|
||||
expr = strings.levenshtein "hello there" "";
|
||||
expected = 11;
|
||||
};
|
||||
|
||||
testLevenshteinOnlyTransform = {
|
||||
expr = strings.levenshtein "abcdef" "ghijkl";
|
||||
expected = 6;
|
||||
};
|
||||
|
||||
testLevenshteinMixed = {
|
||||
expr = strings.levenshtein "kitchen" "sitting";
|
||||
expected = 5;
|
||||
};
|
||||
|
||||
testLevenshteinAtMostZeroFalse = {
|
||||
expr = strings.levenshteinAtMost 0 "foo" "boo";
|
||||
expected = false;
|
||||
};
|
||||
|
||||
testLevenshteinAtMostZeroTrue = {
|
||||
expr = strings.levenshteinAtMost 0 "foo" "foo";
|
||||
expected = true;
|
||||
};
|
||||
|
||||
testLevenshteinAtMostOneFalse = {
|
||||
expr = strings.levenshteinAtMost 1 "car" "ct";
|
||||
expected = false;
|
||||
};
|
||||
|
||||
testLevenshteinAtMostOneTrue = {
|
||||
expr = strings.levenshteinAtMost 1 "car" "cr";
|
||||
expected = true;
|
||||
};
|
||||
|
||||
# We test levenshteinAtMost 2 particularly well because it uses a complicated
|
||||
# implementation
|
||||
testLevenshteinAtMostTwoIsEmpty = {
|
||||
expr = strings.levenshteinAtMost 2 "" "";
|
||||
expected = true;
|
||||
};
|
||||
|
||||
testLevenshteinAtMostTwoIsZero = {
|
||||
expr = strings.levenshteinAtMost 2 "abcdef" "abcdef";
|
||||
expected = true;
|
||||
};
|
||||
|
||||
testLevenshteinAtMostTwoIsOne = {
|
||||
expr = strings.levenshteinAtMost 2 "abcdef" "abddef";
|
||||
expected = true;
|
||||
};
|
||||
|
||||
testLevenshteinAtMostTwoDiff0False = {
|
||||
expr = strings.levenshteinAtMost 2 "abcdef" "aczyef";
|
||||
expected = false;
|
||||
};
|
||||
|
||||
testLevenshteinAtMostTwoDiff0Outer = {
|
||||
expr = strings.levenshteinAtMost 2 "abcdef" "zbcdez";
|
||||
expected = true;
|
||||
};
|
||||
|
||||
testLevenshteinAtMostTwoDiff0DelLeft = {
|
||||
expr = strings.levenshteinAtMost 2 "abcdef" "bcdefz";
|
||||
expected = true;
|
||||
};
|
||||
|
||||
testLevenshteinAtMostTwoDiff0DelRight = {
|
||||
expr = strings.levenshteinAtMost 2 "abcdef" "zabcde";
|
||||
expected = true;
|
||||
};
|
||||
|
||||
testLevenshteinAtMostTwoDiff1False = {
|
||||
expr = strings.levenshteinAtMost 2 "abcdef" "bddez";
|
||||
expected = false;
|
||||
};
|
||||
|
||||
testLevenshteinAtMostTwoDiff1DelLeft = {
|
||||
expr = strings.levenshteinAtMost 2 "abcdef" "bcdez";
|
||||
expected = true;
|
||||
};
|
||||
|
||||
testLevenshteinAtMostTwoDiff1DelRight = {
|
||||
expr = strings.levenshteinAtMost 2 "abcdef" "zbcde";
|
||||
expected = true;
|
||||
};
|
||||
|
||||
testLevenshteinAtMostTwoDiff2False = {
|
||||
expr = strings.levenshteinAtMost 2 "hello" "hxo";
|
||||
expected = false;
|
||||
};
|
||||
|
||||
testLevenshteinAtMostTwoDiff2True = {
|
||||
expr = strings.levenshteinAtMost 2 "hello" "heo";
|
||||
expected = true;
|
||||
};
|
||||
|
||||
testLevenshteinAtMostTwoDiff3 = {
|
||||
expr = strings.levenshteinAtMost 2 "hello" "ho";
|
||||
expected = false;
|
||||
};
|
||||
|
||||
testLevenshteinAtMostThreeFalse = {
|
||||
expr = strings.levenshteinAtMost 3 "hello" "Holla!";
|
||||
expected = false;
|
||||
};
|
||||
|
||||
testLevenshteinAtMostThreeTrue = {
|
||||
expr = strings.levenshteinAtMost 3 "hello" "Holla";
|
||||
expected = true;
|
||||
};
|
||||
}
|
||||
|
@ -8549,7 +8549,7 @@
|
||||
};
|
||||
msfjarvis = {
|
||||
github = "msfjarvis";
|
||||
githubId = 3348378;
|
||||
githubId = 13348378;
|
||||
name = "Harsh Shandilya";
|
||||
email = "nixos@msfjarvis.dev";
|
||||
keys = [{
|
||||
|
@ -32,6 +32,20 @@ type of this option should represent the format. The most common formats
|
||||
have a predefined type and string generator already declared under
|
||||
`pkgs.formats`:
|
||||
|
||||
`pkgs.formats.javaProperties` { *`comment`* ? `"Generated with Nix"` }
|
||||
|
||||
: A function taking an attribute set with values
|
||||
|
||||
`comment`
|
||||
|
||||
: A string to put at the start of the
|
||||
file in a comment. It can have multiple
|
||||
lines.
|
||||
|
||||
It returns the `type`: `attrsOf str` and a function
|
||||
`generate` to build a Java `.properties` file, taking
|
||||
care of the correct escaping, etc.
|
||||
|
||||
`pkgs.formats.json` { }
|
||||
|
||||
: A function taking an empty attribute set (for future extensibility)
|
||||
|
@ -53,6 +53,38 @@
|
||||
<literal>pkgs.formats</literal>:
|
||||
</para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>pkgs.formats.javaProperties</literal> {
|
||||
<emphasis><literal>comment</literal></emphasis> ?
|
||||
<literal>"Generated with Nix"</literal> }
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
A function taking an attribute set with values
|
||||
</para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>comment</literal>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
A string to put at the start of the file in a comment.
|
||||
It can have multiple lines.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
<para>
|
||||
It returns the <literal>type</literal>:
|
||||
<literal>attrsOf str</literal> and a function
|
||||
<literal>generate</literal> to build a Java
|
||||
<literal>.properties</literal> file, taking care of the
|
||||
correct escaping, etc.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>pkgs.formats.json</literal> { }
|
||||
|
@ -17,7 +17,7 @@ $ diskutil list
|
||||
[..]
|
||||
$ diskutil unmountDisk diskN
|
||||
Unmount of all volumes on diskN was successful
|
||||
$ sudo dd if=nix.iso of=/dev/rdiskN
|
||||
$ sudo dd if=nix.iso of=/dev/rdiskN bs=1M
|
||||
</programlisting>
|
||||
<para>
|
||||
Using the 'raw' <literal>rdiskN</literal> device instead of
|
||||
|
@ -1401,6 +1401,35 @@
|
||||
versions.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
A new option group
|
||||
<literal>systemd.network.wait-online</literal> was added, with
|
||||
options to configure
|
||||
<literal>systemd-networkd-wait-online.service</literal>:
|
||||
</para>
|
||||
<itemizedlist spacing="compact">
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>anyInterface</literal> allows specifying that the
|
||||
network should be considered online when <emphasis>at
|
||||
least one</emphasis> interface is online (useful on
|
||||
laptops)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>timeout</literal> defines how long to wait for
|
||||
the network to come online
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>extraArgs</literal> for everything else
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <literal>influxdb2</literal> package was split into
|
||||
@ -1655,9 +1684,20 @@
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>services.logrotate.enable</literal> now defaults to
|
||||
true if any rotate path has been defined, and some paths have
|
||||
been added by default.
|
||||
<link linkend="opt-services.logrotate.enable">services.logrotate.enable</link>
|
||||
now defaults to true if any rotate path has been defined, and
|
||||
some paths have been added by default.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The logrotate module also has been updated to freeform syntax:
|
||||
<link linkend="opt-services.logrotate.paths">services.logrotate.paths</link>
|
||||
and
|
||||
<link linkend="opt-services.logrotate.extraConfig">services.logrotate.extraConfig</link>
|
||||
will work, but issue deprecation warnings and
|
||||
<link linkend="opt-services.logrotate.settings">services.logrotate.settings</link>
|
||||
should now be used instead.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
|
@ -18,7 +18,7 @@ $ diskutil list
|
||||
[..]
|
||||
$ diskutil unmountDisk diskN
|
||||
Unmount of all volumes on diskN was successful
|
||||
$ sudo dd if=nix.iso of=/dev/rdiskN
|
||||
$ sudo dd if=nix.iso of=/dev/rdiskN bs=1M
|
||||
```
|
||||
|
||||
Using the \'raw\' `rdiskN` device instead of `diskN` completes in
|
||||
|
@ -498,6 +498,11 @@ In addition to numerous new and upgraded packages, this release has the followin
|
||||
still under heavy development and behavior is not always flawless.
|
||||
Furthermore, not all Electron apps use the latest Electron versions.
|
||||
|
||||
- A new option group `systemd.network.wait-online` was added, with options to configure `systemd-networkd-wait-online.service`:
|
||||
- `anyInterface` allows specifying that the network should be considered online when *at least one* interface is online (useful on laptops)
|
||||
- `timeout` defines how long to wait for the network to come online
|
||||
- `extraArgs` for everything else
|
||||
|
||||
- The `influxdb2` package was split into `influxdb2-server` and
|
||||
`influxdb2-cli`, matching the split that took place upstream. A
|
||||
combined `influxdb2` package is still provided in this release for
|
||||
@ -578,8 +583,11 @@ In addition to numerous new and upgraded packages, this release has the followin
|
||||
- `services.mattermost.plugins` has been added to allow the declarative installation of Mattermost plugins.
|
||||
Plugins are automatically repackaged using autoPatchelf.
|
||||
|
||||
- `services.logrotate.enable` now defaults to true if any rotate path has
|
||||
- [services.logrotate.enable](#opt-services.logrotate.enable) now defaults to true if any rotate path has
|
||||
been defined, and some paths have been added by default.
|
||||
- The logrotate module also has been updated to freeform syntax: [services.logrotate.paths](#opt-services.logrotate.paths)
|
||||
and [services.logrotate.extraConfig](#opt-services.logrotate.extraConfig) will work, but issue deprecation
|
||||
warnings and [services.logrotate.settings](#opt-services.logrotate.settings) should now be used instead.
|
||||
|
||||
- The `zrepl` package has been updated from 0.4.0 to 0.5:
|
||||
|
||||
|
@ -977,6 +977,7 @@
|
||||
./services/security/shibboleth-sp.nix
|
||||
./services/security/sks.nix
|
||||
./services/security/sshguard.nix
|
||||
./services/security/sslmate-agent.nix
|
||||
./services/security/step-ca.nix
|
||||
./services/security/tor.nix
|
||||
./services/security/torify.nix
|
||||
|
@ -1,4 +1,4 @@
|
||||
{ config, lib, ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.services.jenkinsSlave;
|
||||
@ -46,6 +46,15 @@ in {
|
||||
this is the home of the "jenkins" user.
|
||||
'';
|
||||
};
|
||||
|
||||
javaPackage = mkOption {
|
||||
default = pkgs.jdk;
|
||||
defaultText = literalExpression "pkgs.jdk";
|
||||
description = ''
|
||||
Java package to install.
|
||||
'';
|
||||
type = types.package;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -64,5 +73,10 @@ in {
|
||||
uid = config.ids.uids.jenkins;
|
||||
};
|
||||
};
|
||||
|
||||
programs.java = {
|
||||
enable = true;
|
||||
package = cfg.javaPackage;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -5,7 +5,10 @@ with lib;
|
||||
let
|
||||
cfg = config.services.logrotate;
|
||||
|
||||
pathOpts = { name, ... }: {
|
||||
# deprecated legacy compat settings
|
||||
# these options will be removed before 22.11 in the following PR:
|
||||
# https://github.com/NixOS/nixpkgs/pull/164169
|
||||
pathOpts = { name, ... }: {
|
||||
options = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
@ -86,23 +89,113 @@ let
|
||||
config.name = name;
|
||||
};
|
||||
|
||||
mkConf = pathOpts: ''
|
||||
# generated by NixOS using the `services.logrotate.paths.${pathOpts.name}` attribute set
|
||||
${concatMapStringsSep " " (path: ''"${path}"'') (toList pathOpts.path)} {
|
||||
${optionalString (pathOpts.user != null || pathOpts.group != null) "su ${pathOpts.user} ${pathOpts.group}"}
|
||||
${pathOpts.frequency}
|
||||
rotate ${toString pathOpts.keep}
|
||||
${pathOpts.extraConfig}
|
||||
}
|
||||
'';
|
||||
|
||||
paths = sortProperties (attrValues (filterAttrs (_: pathOpts: pathOpts.enable) cfg.paths));
|
||||
configFile = pkgs.writeText "logrotate.conf" (
|
||||
concatStringsSep "\n" (
|
||||
[ "missingok" "notifempty" cfg.extraConfig ] ++ (map mkConf paths)
|
||||
)
|
||||
generateLine = n: v:
|
||||
if builtins.elem n [ "files" "priority" "enable" "global" ] || v == null then null
|
||||
else if builtins.elem n [ "extraConfig" "frequency" ] then "${v}\n"
|
||||
else if builtins.elem n [ "firstaction" "lastaction" "prerotate" "postrotate" "preremove" ]
|
||||
then "${n}\n ${v}\n endscript\n"
|
||||
else if isInt v then "${n} ${toString v}\n"
|
||||
else if v == true then "${n}\n"
|
||||
else if v == false then "no${n}\n"
|
||||
else "${n} ${v}\n";
|
||||
generateSection = indent: settings: concatStringsSep (fixedWidthString indent " " "") (
|
||||
filter (x: x != null) (mapAttrsToList generateLine settings)
|
||||
);
|
||||
|
||||
# generateSection includes a final newline hence weird closing brace
|
||||
mkConf = settings:
|
||||
if settings.global or false then generateSection 0 settings
|
||||
else ''
|
||||
${concatMapStringsSep "\n" (files: ''"${files}"'') (toList settings.files)} {
|
||||
${generateSection 2 settings}}
|
||||
'';
|
||||
|
||||
# below two mapPaths are compat functions
|
||||
mapPathOptToSetting = n: v:
|
||||
if n == "keep" then nameValuePair "rotate" v
|
||||
else if n == "path" then nameValuePair "files" v
|
||||
else nameValuePair n v;
|
||||
|
||||
mapPathsToSettings = path: pathOpts:
|
||||
nameValuePair path (
|
||||
filterAttrs (n: v: ! builtins.elem n [ "user" "group" "name" ] && v != "") (
|
||||
(mapAttrs' mapPathOptToSetting pathOpts) //
|
||||
{
|
||||
su =
|
||||
if pathOpts.user != null
|
||||
then "${pathOpts.user} ${pathOpts.group}"
|
||||
else null;
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
settings = sortProperties (attrValues (filterAttrs (_: settings: settings.enable) (
|
||||
foldAttrs recursiveUpdate { } [
|
||||
{
|
||||
header = {
|
||||
enable = true;
|
||||
missingok = true;
|
||||
notifempty = true;
|
||||
frequency = "weekly";
|
||||
rotate = 4;
|
||||
};
|
||||
# compat section
|
||||
extraConfig = {
|
||||
enable = (cfg.extraConfig != "");
|
||||
global = true;
|
||||
extraConfig = cfg.extraConfig;
|
||||
priority = 101;
|
||||
};
|
||||
}
|
||||
(mapAttrs' mapPathsToSettings cfg.paths)
|
||||
cfg.settings
|
||||
{ header = { global = true; priority = 100; }; }
|
||||
]
|
||||
)));
|
||||
configFile = pkgs.writeTextFile {
|
||||
name = "logrotate.conf";
|
||||
text = concatStringsSep "\n" (
|
||||
map mkConf settings
|
||||
);
|
||||
checkPhase = optionalString cfg.checkConfig ''
|
||||
# logrotate --debug also checks that users specified in config
|
||||
# file exist, but we only have sandboxed users here so brown these
|
||||
# out. according to man page that means su, create and createolddir.
|
||||
# files required to exist also won't be present, so missingok is forced.
|
||||
user=$(${pkgs.coreutils}/bin/id -un)
|
||||
group=$(${pkgs.coreutils}/bin/id -gn)
|
||||
sed -e "s/\bsu\s.*/su $user $group/" \
|
||||
-e "s/\b\(create\s\+[0-9]*\s*\|createolddir\s\+[0-9]*\s\+\).*/\1$user $group/" \
|
||||
-e "1imissingok" -e "s/\bnomissingok\b//" \
|
||||
$out > /tmp/logrotate.conf
|
||||
# Since this makes for very verbose builds only show real error.
|
||||
# There is no way to control log level, but logrotate hardcodes
|
||||
# 'error:' at common log level, so we can use grep, taking care
|
||||
# to keep error codes
|
||||
set -o pipefail
|
||||
if ! ${pkgs.logrotate}/sbin/logrotate --debug /tmp/logrotate.conf 2>&1 \
|
||||
| ( ! grep "error:" ) > /tmp/logrotate-error; then
|
||||
echo "Logrotate configuration check failed."
|
||||
echo "The failing configuration (after adjustments to pass tests in sandbox) was:"
|
||||
printf "%s\n" "-------"
|
||||
cat /tmp/logrotate.conf
|
||||
printf "%s\n" "-------"
|
||||
echo "The error reported by logrotate was as follow:"
|
||||
printf "%s\n" "-------"
|
||||
cat /tmp/logrotate-error
|
||||
printf "%s\n" "-------"
|
||||
echo "You can disable this check with services.logrotate.checkConfig = false,"
|
||||
echo "but if you think it should work please report this failure along with"
|
||||
echo "the config file being tested!"
|
||||
false
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
mailOption =
|
||||
if foldr (n: a: a || n ? mail) false (attrValues cfg.settings)
|
||||
then "--mail=${pkgs.mailutils}/bin/mail"
|
||||
else "";
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
@ -112,17 +205,121 @@ in
|
||||
options = {
|
||||
services.logrotate = {
|
||||
enable = mkEnableOption "the logrotate systemd service" // {
|
||||
default = foldr (n: a: a || n.enable) false (attrValues cfg.paths);
|
||||
defaultText = literalExpression "cfg.paths != {}";
|
||||
default = foldr (n: a: a || n.enable) false (attrValues cfg.settings);
|
||||
defaultText = literalExpression "cfg.settings != {}";
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
default = { };
|
||||
description = ''
|
||||
logrotate freeform settings: each attribute here will define its own section,
|
||||
ordered by priority, which can either define files to rotate with their settings
|
||||
or settings common to all further files settings.
|
||||
Refer to <link xlink:href="https://linux.die.net/man/8/logrotate"/> for details.
|
||||
'';
|
||||
type = types.attrsOf (types.submodule ({ name, ... }: {
|
||||
freeformType = with types; attrsOf (nullOr (oneOf [ int bool str ]));
|
||||
|
||||
options = {
|
||||
enable = mkEnableOption "setting individual kill switch" // {
|
||||
default = true;
|
||||
};
|
||||
|
||||
global = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether this setting is a global option or not: set to have these
|
||||
settings apply to all files settings with a higher priority.
|
||||
'';
|
||||
};
|
||||
files = mkOption {
|
||||
type = with types; either str (listOf str);
|
||||
default = name;
|
||||
defaultText = ''
|
||||
The attrset name if not specified
|
||||
'';
|
||||
description = ''
|
||||
Single or list of files for which rules are defined.
|
||||
The files are quoted with double-quotes in logrotate configuration,
|
||||
so globs and spaces are supported.
|
||||
Note this setting is ignored if globals is true.
|
||||
'';
|
||||
};
|
||||
|
||||
frequency = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = ''
|
||||
How often to rotate the logs. Defaults to previously set global setting,
|
||||
which itself defauts to weekly.
|
||||
'';
|
||||
};
|
||||
|
||||
priority = mkOption {
|
||||
type = types.int;
|
||||
default = 1000;
|
||||
description = ''
|
||||
Order of this logrotate block in relation to the others. The semantics are
|
||||
the same as with `lib.mkOrder`. Smaller values are inserted first.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
}));
|
||||
};
|
||||
|
||||
configFile = mkOption {
|
||||
type = types.path;
|
||||
default = configFile;
|
||||
defaultText = ''
|
||||
A configuration file automatically generated by NixOS.
|
||||
'';
|
||||
description = ''
|
||||
Override the configuration file used by MySQL. By default,
|
||||
NixOS generates one automatically from <xref linkend="opt-services.logrotate.settings"/>.
|
||||
'';
|
||||
example = literalExpression ''
|
||||
pkgs.writeText "logrotate.conf" '''
|
||||
missingok
|
||||
"/var/log/*.log" {
|
||||
rotate 4
|
||||
weekly
|
||||
}
|
||||
''';
|
||||
'';
|
||||
};
|
||||
|
||||
checkConfig = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether the config should be checked at build time.
|
||||
|
||||
Some options are not checkable at build time because of the build sandbox:
|
||||
for example, the test does not know about existing files and system users are
|
||||
not known.
|
||||
These limitations mean we must adjust the file for tests (missingok is forced
|
||||
and users are replaced by dummy users), so tests are complemented by a
|
||||
logrotate-checkconf service that is enabled by default.
|
||||
This extra check can be disabled by disabling it at the systemd level with the
|
||||
<option>services.systemd.services.logrotate-checkconf.enable</option> option.
|
||||
|
||||
Conversely there are still things that might make this check fail incorrectly
|
||||
(e.g. a file path where we don't have access to intermediate directories):
|
||||
in this case you can disable the failing check with this option.
|
||||
'';
|
||||
};
|
||||
|
||||
# deprecated legacy compat settings
|
||||
paths = mkOption {
|
||||
type = with types; attrsOf (submodule pathOpts);
|
||||
default = {};
|
||||
default = { };
|
||||
description = ''
|
||||
Attribute set of paths to rotate. The order each block appears in the generated configuration file
|
||||
can be controlled by the <link linkend="opt-services.logrotate.paths._name_.priority">priority</link> option
|
||||
using the same semantics as `lib.mkOrder`. Smaller values have a greater priority.
|
||||
This setting has been deprecated in favor of <link linkend="opt-services.logrotate.settings">logrotate settings</link>.
|
||||
'';
|
||||
example = literalExpression ''
|
||||
{
|
||||
@ -151,19 +348,37 @@ in
|
||||
description = ''
|
||||
Extra contents to append to the logrotate configuration file. Refer to
|
||||
<link xlink:href="https://linux.die.net/man/8/logrotate"/> for details.
|
||||
This setting has been deprecated in favor of
|
||||
<link linkend="opt-services.logrotate.settings">logrotate settings</link>.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = mapAttrsToList (name: pathOpts:
|
||||
{ assertion = (pathOpts.user != null) == (pathOpts.group != null);
|
||||
message = ''
|
||||
If either of `services.logrotate.paths.${name}.user` or `services.logrotate.paths.${name}.group` are specified then *both* must be specified.
|
||||
'';
|
||||
}
|
||||
) cfg.paths;
|
||||
assertions =
|
||||
mapAttrsToList
|
||||
(name: pathOpts:
|
||||
{
|
||||
assertion = (pathOpts.user != null) == (pathOpts.group != null);
|
||||
message = ''
|
||||
If either of `services.logrotate.paths.${name}.user` or `services.logrotate.paths.${name}.group` are specified then *both* must be specified.
|
||||
'';
|
||||
})
|
||||
cfg.paths;
|
||||
|
||||
warnings =
|
||||
(mapAttrsToList
|
||||
(name: pathOpts: ''
|
||||
Using config.services.logrotate.paths.${name} is deprecated and will become unsupported in a future release.
|
||||
Please use services.logrotate.settings instead.
|
||||
'')
|
||||
cfg.paths
|
||||
) ++
|
||||
(optional (cfg.extraConfig != "") ''
|
||||
Using config.services.logrotate.extraConfig is deprecated and will become unsupported in a future release.
|
||||
Please use services.logrotate.settings with globals=true instead.
|
||||
'');
|
||||
|
||||
systemd.services.logrotate = {
|
||||
description = "Logrotate Service";
|
||||
@ -172,7 +387,16 @@ in
|
||||
serviceConfig = {
|
||||
Restart = "no";
|
||||
User = "root";
|
||||
ExecStart = "${pkgs.logrotate}/sbin/logrotate ${configFile}";
|
||||
ExecStart = "${pkgs.logrotate}/sbin/logrotate ${mailOption} ${cfg.configFile}";
|
||||
};
|
||||
};
|
||||
systemd.services.logrotate-checkconf = {
|
||||
description = "Logrotate configuration check";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
ExecStart = "${pkgs.logrotate}/sbin/logrotate --debug ${cfg.configFile}";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -848,10 +848,7 @@ in {
|
||||
|
||||
extraConfig = mkOption {
|
||||
type = types.lines;
|
||||
default = ''
|
||||
copytruncate
|
||||
compress
|
||||
'';
|
||||
default = "";
|
||||
description = ''
|
||||
Extra logrotate config options for this path. Refer to
|
||||
<link xlink:href="https://linux.die.net/man/8/logrotate"/> for details.
|
||||
@ -977,13 +974,14 @@ in {
|
||||
# Enable rotation of log files
|
||||
services.logrotate = {
|
||||
enable = cfg.logrotate.enable;
|
||||
paths = {
|
||||
settings = {
|
||||
gitlab = {
|
||||
path = "${cfg.statePath}/log/*.log";
|
||||
user = cfg.user;
|
||||
group = cfg.group;
|
||||
files = "${cfg.statePath}/log/*.log";
|
||||
su = "${cfg.user} ${cfg.group}";
|
||||
frequency = cfg.logrotate.frequency;
|
||||
keep = cfg.logrotate.keep;
|
||||
rotate = cfg.logrotate.keep;
|
||||
copytruncate = true;
|
||||
compress = true;
|
||||
extraConfig = cfg.logrotate.extraConfig;
|
||||
};
|
||||
};
|
||||
|
@ -51,18 +51,14 @@ in
|
||||
|
||||
environment.etc."lxd-image-server/config.toml".source = format.generate "config.toml" cfg.settings;
|
||||
|
||||
services.logrotate.paths.lxd-image-server = {
|
||||
path = "/var/log/lxd-image-server/lxd-image-server.log";
|
||||
services.logrotate.settings.lxd-image-server = {
|
||||
files = "/var/log/lxd-image-server/lxd-image-server.log";
|
||||
frequency = "daily";
|
||||
keep = 21;
|
||||
extraConfig = ''
|
||||
create 755 lxd-image-server ${cfg.group}
|
||||
missingok
|
||||
compress
|
||||
delaycompress
|
||||
copytruncate
|
||||
notifempty
|
||||
'';
|
||||
rotate = 21;
|
||||
create = "755 lxd-image-server ${cfg.group}";
|
||||
compress = true;
|
||||
delaycompress = true;
|
||||
copytruncate = true;
|
||||
};
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
|
@ -61,6 +61,15 @@ in
|
||||
Group to use when running Syncplay.
|
||||
'';
|
||||
};
|
||||
|
||||
passwordFile = mkOption {
|
||||
type = types.nullOr types.path;
|
||||
default = null;
|
||||
description = ''
|
||||
Path to the file that contains the server password. If
|
||||
<literal>null</literal>, the server doesn't require a password.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -71,10 +80,17 @@ in
|
||||
after = [ "network-online.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.syncplay}/bin/syncplay-server ${escapeShellArgs cmdArgs}";
|
||||
User = cfg.user;
|
||||
Group = cfg.group;
|
||||
LoadCredential = lib.mkIf (cfg.passwordFile != null) "password:${cfg.passwordFile}";
|
||||
};
|
||||
|
||||
script = ''
|
||||
${lib.optionalString (cfg.passwordFile != null) ''
|
||||
export SYNCPLAY_PASSWORD=$(cat "''${CREDENTIALS_DIRECTORY}/password")
|
||||
''}
|
||||
exec ${pkgs.syncplay}/bin/syncplay-server ${escapeShellArgs cmdArgs}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -571,8 +571,11 @@ in
|
||||
users.users.oauth2_proxy = {
|
||||
description = "OAuth2 Proxy";
|
||||
isSystemUser = true;
|
||||
group = "oauth2_proxy";
|
||||
};
|
||||
|
||||
users.groups.oauth2_proxy = {};
|
||||
|
||||
systemd.services.oauth2_proxy = {
|
||||
description = "OAuth2 Proxy";
|
||||
path = [ cfg.package ];
|
||||
|
@ -710,20 +710,15 @@ in
|
||||
|
||||
services.logrotate = optionalAttrs (cfg.logFormat != "none") {
|
||||
enable = mkDefault true;
|
||||
paths.httpd = {
|
||||
path = "${cfg.logDir}/*.log";
|
||||
user = cfg.user;
|
||||
group = cfg.group;
|
||||
settings.httpd = {
|
||||
files = "${cfg.logDir}/*.log";
|
||||
su = "${cfg.user} ${cfg.group}";
|
||||
frequency = "daily";
|
||||
keep = 28;
|
||||
extraConfig = ''
|
||||
sharedscripts
|
||||
compress
|
||||
delaycompress
|
||||
postrotate
|
||||
systemctl reload httpd.service > /dev/null 2>/dev/null || true
|
||||
endscript
|
||||
'';
|
||||
rotate = 28;
|
||||
sharedscripts = true;
|
||||
compress = true;
|
||||
delaycompress = true;
|
||||
postrotate = "systemctl reload httpd.service > /dev/null 2>/dev/null || true";
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -989,17 +989,14 @@ in
|
||||
nginx.gid = config.ids.gids.nginx;
|
||||
};
|
||||
|
||||
services.logrotate.paths.nginx = mapAttrs (_: mkDefault) {
|
||||
path = "/var/log/nginx/*.log";
|
||||
services.logrotate.settings.nginx = mapAttrs (_: mkDefault) {
|
||||
files = "/var/log/nginx/*.log";
|
||||
frequency = "weekly";
|
||||
keep = 26;
|
||||
extraConfig = ''
|
||||
compress
|
||||
delaycompress
|
||||
postrotate
|
||||
[ ! -f /var/run/nginx/nginx.pid ] || kill -USR1 `cat /var/run/nginx/nginx.pid`
|
||||
endscript
|
||||
'';
|
||||
su = "${cfg.user} ${cfg.group}";
|
||||
rotate = 26;
|
||||
compress = true;
|
||||
delaycompress = true;
|
||||
postrotate = "[ ! -f /var/run/nginx/nginx.pid ] || kill -USR1 `cat /var/run/nginx/nginx.pid`";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -302,6 +302,7 @@ in
|
||||
environment.systemPackages = with pkgs.pantheon; [
|
||||
contractor
|
||||
file-roller-contract
|
||||
gnome-bluetooth-contract
|
||||
];
|
||||
|
||||
environment.pathsToLink = [
|
||||
|
@ -1741,6 +1741,48 @@ in
|
||||
}));
|
||||
};
|
||||
|
||||
systemd.network.wait-online = {
|
||||
anyInterface = mkOption {
|
||||
description = ''
|
||||
Whether to consider the network online when any interface is online, as opposed to all of them.
|
||||
This is useful on portable machines with a wired and a wireless interface, for example.
|
||||
'';
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
ignoredInterfaces = mkOption {
|
||||
description = ''
|
||||
Network interfaces to be ignored when deciding if the system is online.
|
||||
'';
|
||||
type = with types; listOf str;
|
||||
default = [];
|
||||
example = [ "wg0" ];
|
||||
};
|
||||
|
||||
timeout = mkOption {
|
||||
description = ''
|
||||
Time to wait for the network to come online, in seconds. Set to 0 to disable.
|
||||
'';
|
||||
type = types.ints.unsigned;
|
||||
default = 120;
|
||||
example = 0;
|
||||
};
|
||||
|
||||
extraArgs = mkOption {
|
||||
description = ''
|
||||
Extra command-line arguments to pass to systemd-networkd-wait-online.
|
||||
These also affect per-interface <literal>systemd-network-wait-online@</literal> services.
|
||||
|
||||
See <link xlink:href="https://www.freedesktop.org/software/systemd/man/systemd-networkd-wait-online.service.html">
|
||||
<citerefentry><refentrytitle>systemd-networkd-wait-online.service</refentrytitle><manvolnum>8</manvolnum>
|
||||
</citerefentry></link> for all available options.
|
||||
'';
|
||||
type = with types; listOf str;
|
||||
default = [];
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = mkMerge [
|
||||
@ -1749,6 +1791,11 @@ in
|
||||
{
|
||||
systemd.network.units = mapAttrs' (n: v: nameValuePair "${n}.link" (linkToUnit n v)) cfg.links;
|
||||
environment.etc = unitFiles;
|
||||
|
||||
systemd.network.wait-online.extraArgs =
|
||||
[ "--timeout=${toString cfg.wait-online.timeout}" ]
|
||||
++ optional cfg.wait-online.anyInterface "--any"
|
||||
++ map (i: "--ignore=${i}") cfg.wait-online.ignoredInterfaces;
|
||||
}
|
||||
|
||||
(mkIf config.systemd.network.enable {
|
||||
@ -1777,6 +1824,10 @@ in
|
||||
|
||||
systemd.services.systemd-networkd-wait-online = {
|
||||
wantedBy = [ "network-online.target" ];
|
||||
serviceConfig.ExecStart = [
|
||||
""
|
||||
"${config.systemd.package}/lib/systemd/systemd-networkd-wait-online ${utils.escapeSystemdExecArgs cfg.wait-online.extraArgs}"
|
||||
];
|
||||
};
|
||||
|
||||
systemd.services."systemd-network-wait-online@" = {
|
||||
@ -1787,7 +1838,7 @@ in
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
ExecStart = "${config.systemd.package}/lib/systemd/systemd-networkd-wait-online -i %I";
|
||||
ExecStart = "${config.systemd.package}/lib/systemd/systemd-networkd-wait-online -i %I ${utils.escapeSystemdExecArgs cfg.wait-online.extraArgs}";
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -612,22 +612,18 @@ in
|
||||
|
||||
boot.kernelParams = optional (!cfg.enableUnifiedCgroupHierarchy) "systemd.unified_cgroup_hierarchy=0";
|
||||
|
||||
services.logrotate.paths = {
|
||||
services.logrotate.settings = {
|
||||
"/var/log/btmp" = mapAttrs (_: mkDefault) {
|
||||
frequency = "monthly";
|
||||
keep = 1;
|
||||
extraConfig = ''
|
||||
create 0660 root ${config.users.groups.utmp.name}
|
||||
minsize 1M
|
||||
'';
|
||||
rotate = 1;
|
||||
create = "0660 root ${config.users.groups.utmp.name}";
|
||||
minsize = "1M";
|
||||
};
|
||||
"/var/log/wtmp" = mapAttrs (_: mkDefault) {
|
||||
frequency = "monthly";
|
||||
keep = 1;
|
||||
extraConfig = ''
|
||||
create 0664 root ${config.users.groups.utmp.name}
|
||||
minsize 1M
|
||||
'';
|
||||
rotate = 1;
|
||||
create = "0664 root ${config.users.groups.utmp.name}";
|
||||
minsize = "1M";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -146,15 +146,11 @@ in
|
||||
|
||||
services.logrotate = {
|
||||
enable = true;
|
||||
extraConfig = ''
|
||||
/var/log/waagent.log {
|
||||
compress
|
||||
monthly
|
||||
rotate 6
|
||||
notifempty
|
||||
missingok
|
||||
}
|
||||
'';
|
||||
settings."/var/log/waagent.log" = {
|
||||
compress = true;
|
||||
frequency = "monthly";
|
||||
rotate = 6;
|
||||
};
|
||||
};
|
||||
|
||||
systemd.targets.provisioned = {
|
||||
|
@ -6,7 +6,10 @@ let
|
||||
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
podmanPackage = (pkgs.podman.override { inherit (cfg) extraPackages; });
|
||||
podmanPackage = (pkgs.podman.override {
|
||||
extraPackages = cfg.extraPackages
|
||||
++ lib.optional (builtins.elem "zfs" config.boot.supportedFilesystems) config.boot.zfs.package;
|
||||
});
|
||||
|
||||
# Provides a fake "docker" binary mapping to podman
|
||||
dockerCompat = pkgs.runCommand "${podmanPackage.pname}-docker-compat-${podmanPackage.version}" {
|
||||
|
@ -90,6 +90,8 @@ import ./make-test-python.nix ({ pkgs, ...} : {
|
||||
|
||||
slave.fail("systemctl is-enabled jenkins.service")
|
||||
|
||||
slave.succeed("java -fullversion")
|
||||
|
||||
with subtest("jobs are declarative"):
|
||||
# Check that jobs are created on disk.
|
||||
master.wait_for_unit("jenkins-job-builder")
|
||||
|
@ -1,26 +1,105 @@
|
||||
# Test logrotate service works and is enabled by default
|
||||
|
||||
import ./make-test-python.nix ({ pkgs, ...} : rec {
|
||||
let
|
||||
importTest = { ... }: {
|
||||
services.logrotate.settings.import = {
|
||||
olddir = false;
|
||||
};
|
||||
};
|
||||
|
||||
in
|
||||
|
||||
import ./make-test-python.nix ({ pkgs, ... }: rec {
|
||||
name = "logrotate";
|
||||
meta = with pkgs.lib.maintainers; {
|
||||
maintainers = [ martinetd ];
|
||||
};
|
||||
|
||||
# default machine
|
||||
nodes.machine = { ... }: {
|
||||
nodes = {
|
||||
defaultMachine = { ... }: { };
|
||||
failingMachine = { ... }: {
|
||||
services.logrotate.configFile = pkgs.writeText "logrotate.conf" ''
|
||||
# self-written config file
|
||||
su notarealuser notagroupeither
|
||||
'';
|
||||
};
|
||||
machine = { config, ... }: {
|
||||
imports = [ importTest ];
|
||||
|
||||
services.logrotate.settings = {
|
||||
# remove default frequency header and add another
|
||||
header = {
|
||||
frequency = null;
|
||||
delaycompress = true;
|
||||
};
|
||||
# extra global setting... affecting nothing
|
||||
last_line = {
|
||||
global = true;
|
||||
priority = 2000;
|
||||
shred = true;
|
||||
};
|
||||
# using mail somewhere should add --mail to logrotate invokation
|
||||
sendmail = {
|
||||
mail = "user@domain.tld";
|
||||
};
|
||||
# postrotate should be suffixed by 'endscript'
|
||||
postrotate = {
|
||||
postrotate = "touch /dev/null";
|
||||
};
|
||||
# check checkConfig works as expected: there is nothing to check here
|
||||
# except that the file build passes
|
||||
checkConf = {
|
||||
su = "root utmp";
|
||||
createolddir = "0750 root utmp";
|
||||
create = "root utmp";
|
||||
"create " = "0750 root utmp";
|
||||
};
|
||||
# multiple paths should be aggregated
|
||||
multipath = {
|
||||
files = [ "file1" "file2" ];
|
||||
};
|
||||
# overriding imported path should keep existing attributes
|
||||
# (e.g. olddir is still set)
|
||||
import = {
|
||||
notifempty = true;
|
||||
};
|
||||
};
|
||||
# extraConfig compatibility - should be added to top level, early.
|
||||
services.logrotate.extraConfig = ''
|
||||
nomail
|
||||
'';
|
||||
# paths compatibility
|
||||
services.logrotate.paths = {
|
||||
compat_path = {
|
||||
path = "compat_test_path";
|
||||
};
|
||||
# user/group should be grouped as 'su user group'
|
||||
compat_user = {
|
||||
user = config.users.users.root.name;
|
||||
group = "root";
|
||||
};
|
||||
# extraConfig in path should be added to block
|
||||
compat_extraConfig = {
|
||||
extraConfig = "dateext";
|
||||
};
|
||||
# keep -> rotate
|
||||
compat_keep = {
|
||||
keep = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
testScript =
|
||||
''
|
||||
with subtest("whether logrotate works"):
|
||||
machine.succeed(
|
||||
# we must rotate once first to create logrotate stamp
|
||||
"systemctl start logrotate.service")
|
||||
# we must rotate once first to create logrotate stamp
|
||||
defaultMachine.succeed("systemctl start logrotate.service")
|
||||
# we need to wait for console text once here to
|
||||
# clear console buffer up to this point for next wait
|
||||
machine.wait_for_console_text('logrotate.service: Deactivated successfully')
|
||||
defaultMachine.wait_for_console_text('logrotate.service: Deactivated successfully')
|
||||
|
||||
machine.succeed(
|
||||
defaultMachine.succeed(
|
||||
# wtmp is present in default config.
|
||||
"rm -f /var/log/wtmp*",
|
||||
# we need to give it at least 1MB
|
||||
@ -28,10 +107,46 @@ import ./make-test-python.nix ({ pkgs, ...} : rec {
|
||||
|
||||
# move into the future and check rotation.
|
||||
"date -s 'now + 1 month + 1 day'")
|
||||
machine.wait_for_console_text('logrotate.service: Deactivated successfully')
|
||||
machine.succeed(
|
||||
defaultMachine.wait_for_console_text('logrotate.service: Deactivated successfully')
|
||||
defaultMachine.succeed(
|
||||
# check rotate worked
|
||||
"[ -e /var/log/wtmp.1 ]",
|
||||
)
|
||||
with subtest("default config does not have mail"):
|
||||
defaultMachine.fail("systemctl cat logrotate.service | grep -- --mail")
|
||||
with subtest("using mails adds mail option"):
|
||||
machine.succeed("systemctl cat logrotate.service | grep -- --mail")
|
||||
with subtest("check generated config matches expectation"):
|
||||
machine.succeed(
|
||||
# copy conf to /tmp/logrotate.conf for easy grep
|
||||
"conf=$(systemctl cat logrotate | grep -oE '/nix/store[^ ]*logrotate.conf'); cp $conf /tmp/logrotate.conf",
|
||||
"! grep weekly /tmp/logrotate.conf",
|
||||
"grep -E '^delaycompress' /tmp/logrotate.conf",
|
||||
"tail -n 1 /tmp/logrotate.conf | grep shred",
|
||||
"sed -ne '/\"sendmail\" {/,/}/p' /tmp/logrotate.conf | grep 'mail user@domain.tld'",
|
||||
"sed -ne '/\"postrotate\" {/,/}/p' /tmp/logrotate.conf | grep endscript",
|
||||
"grep '\"file1\"\n\"file2\" {' /tmp/logrotate.conf",
|
||||
"sed -ne '/\"import\" {/,/}/p' /tmp/logrotate.conf | grep noolddir",
|
||||
"sed -ne '1,/^\"/p' /tmp/logrotate.conf | grep nomail",
|
||||
"grep '\"compat_test_path\" {' /tmp/logrotate.conf",
|
||||
"sed -ne '/\"compat_user\" {/,/}/p' /tmp/logrotate.conf | grep 'su root root'",
|
||||
"sed -ne '/\"compat_extraConfig\" {/,/}/p' /tmp/logrotate.conf | grep dateext",
|
||||
"[[ $(sed -ne '/\"compat_keep\" {/,/}/p' /tmp/logrotate.conf | grep -w rotate) = \" rotate 1\" ]]",
|
||||
"! sed -ne '/\"compat_keep\" {/,/}/p' /tmp/logrotate.conf | grep -w keep",
|
||||
)
|
||||
# also check configFile option
|
||||
failingMachine.succeed(
|
||||
"conf=$(systemctl cat logrotate | grep -oE '/nix/store[^ ]*logrotate.conf'); cp $conf /tmp/logrotate.conf",
|
||||
"grep 'self-written config' /tmp/logrotate.conf",
|
||||
)
|
||||
with subtest("Check logrotate-checkconf service"):
|
||||
machine.wait_for_unit("logrotate-checkconf.service")
|
||||
# wait_for_unit also asserts for success, so wait for
|
||||
# parent target instead and check manually.
|
||||
failingMachine.wait_for_unit("multi-user.target")
|
||||
info = failingMachine.get_unit_info("logrotate-checkconf.service")
|
||||
if info["ActiveState"] != "failed":
|
||||
raise Exception('logrotate-checkconf.service was not failed')
|
||||
|
||||
'';
|
||||
})
|
||||
|
@ -9,16 +9,16 @@ let
|
||||
|
||||
in buildGoModule rec {
|
||||
pname = "go-ethereum";
|
||||
version = "1.10.16";
|
||||
version = "1.10.17";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ethereum";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-l+hxAUw55d9MYLIUdF6qSEIelJQYRCvHyw1yuossmyA=";
|
||||
sha256 = "sha256-GBlrg4wOiqEQTZC3CtfAZbIvS16/pSjEedEDrPGNUtY=";
|
||||
};
|
||||
|
||||
vendorSha256 = "sha256-keeox2d2WEzY9ynEcovPaU95YzVQlbTu1i7PLpjkjZU=";
|
||||
vendorSha256 = "sha256-D4odWuGFipSvbKbNlA6PkTo3rWGTCptJcn/7V7ZA7qs=";
|
||||
|
||||
doCheck = false;
|
||||
|
||||
|
@ -8,6 +8,7 @@
|
||||
, autoPatchelfHook
|
||||
, gsettings-desktop-schemas
|
||||
, gtk3
|
||||
, wrapGAppsHook
|
||||
, makeWrapper
|
||||
}:
|
||||
|
||||
@ -24,6 +25,7 @@ stdenv.mkDerivation rec {
|
||||
unzip
|
||||
autoPatchelfHook
|
||||
makeWrapper
|
||||
wrapGAppsHook
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
@ -34,7 +36,8 @@ stdenv.mkDerivation rec {
|
||||
gtk3
|
||||
];
|
||||
|
||||
wrapProgramFlags = [
|
||||
dontWrapGApps = true;
|
||||
makeWrapperArgs = [
|
||||
"--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ gcc-unwrapped.lib gtk3 udev ]}"
|
||||
"--prefix PATH : ${lib.makeBinPath [ stdenv.cc ]}"
|
||||
];
|
||||
@ -51,7 +54,7 @@ stdenv.mkDerivation rec {
|
||||
# we can't unzip it in $out/lib, because nw.js will start with
|
||||
# an empty screen. Therefore it will be unzipped in a non-typical
|
||||
# folder and symlinked.
|
||||
unzip $src -d $out/opt/pinegrow
|
||||
unzip -q $src -d $out/opt/pinegrow
|
||||
substituteInPlace $out/opt/pinegrow/Pinegrow.desktop \
|
||||
--replace 'Exec=sh -c "$(dirname %k)/PinegrowLibrary"' 'Exec=sh -c "$out/bin/Pinegrow"'
|
||||
mv $out/opt/pinegrow/Pinegrow.desktop $out/share/applications/Pinegrow.desktop
|
||||
@ -60,9 +63,11 @@ stdenv.mkDerivation rec {
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
# GSETTINGS_SCHEMAS_PATH is not set in installPhase
|
||||
preFixup = ''
|
||||
export XDG_DATA_DIRS=${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}:${gtk3}/share/gsettings-schemas/${gtk3.name}:$XDG_DATA_DIRS
|
||||
wrapProgram "$out/opt/pinegrow/PinegrowLibrary" ''${wrapProgramFlags[@]}
|
||||
wrapProgram $out/bin/Pinegrow \
|
||||
''${makeWrapperArgs[@]} \
|
||||
''${gappsWrapperArgs[@]}
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
|
@ -22,11 +22,11 @@ let
|
||||
isCross = stdenv.hostPlatform != stdenv.buildPlatform;
|
||||
in stdenv.mkDerivation rec {
|
||||
pname = "poke";
|
||||
version = "2.1";
|
||||
version = "2.2";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://gnu/${pname}/${pname}-${version}.tar.gz";
|
||||
sha256 = "sha256-zVKObBu8VAw7YpwrTza3hLMKAmsAWji5koNCJZlEJnA=";
|
||||
sha256 = "sha256-xF6k5xpRohhTZzhcAc65dZbsW3EDOGm+xKYLHLciWQM=";
|
||||
};
|
||||
|
||||
outputs = [ "out" "dev" "info" "lib" "man" ];
|
||||
|
@ -13,10 +13,10 @@ let
|
||||
archive_fmt = if system == "x86_64-darwin" then "zip" else "tar.gz";
|
||||
|
||||
sha256 = {
|
||||
x86_64-linux = "1sh2f7hwhilwmlgy11kl0s2n3phpcir15wyl2fkyhsr2kdj4jz9r";
|
||||
x86_64-darwin = "1s04d91f08982wi8hb4dw0j57d6zqrdgns16ihrgsvahrzksgq4b";
|
||||
aarch64-linux = "1a97lk1qz2lz0lk5lpja32zy07iwdbskp6baf429iz7fz232rshm";
|
||||
armv7l-linux = "0vjqxqcr7fq3ncx1nl6ny7qcqm4vlsn33c074hhcg5292blg2a0p";
|
||||
x86_64-linux = "0dv28i8mxf45n7xj4gzgh4gsx76875nxs4yfqswxij8kzz72vqfn";
|
||||
x86_64-darwin = "0xs4f1ffqcbvzw1v64f9l8i7rflz7h1j5xgjxdz6l0hw0j4aalb2";
|
||||
aarch64-linux = "1fa7g531apigp8k7fxkp2ijmhz5axx7ixzdhlwgbsb80rb2mqhi0";
|
||||
armv7l-linux = "1ry9qm6rk46s0jn7hl30jbjdhi3fshzcs0x9krd9qin7by18hhz3";
|
||||
}.${system};
|
||||
|
||||
sourceRoot = {
|
||||
@ -31,7 +31,7 @@ in
|
||||
|
||||
# Please backport all compatible updates to the stable release.
|
||||
# This is important for the extension ecosystem.
|
||||
version = "1.65.2";
|
||||
version = "1.66.0";
|
||||
pname = "vscodium";
|
||||
|
||||
executableName = "codium";
|
||||
|
@ -13,7 +13,7 @@ buildGraalvmNativeImage rec {
|
||||
jar = "${src}/HentaiAtHome.jar";
|
||||
dontUnpack = true;
|
||||
|
||||
graalvm = graalvm17-ce;
|
||||
graalvmDrv = graalvm17-ce;
|
||||
extraNativeImageBuildArgs = [
|
||||
"--enable-url-protocols=http,https"
|
||||
"--install-exit-handlers"
|
||||
|
@ -14,13 +14,13 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "p2pool";
|
||||
version = "1.8";
|
||||
version = "1.9";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "SChernykh";
|
||||
repo = "p2pool";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-cQd3dtih7C+pEmkvlrsYTJtQWBVVMiFbtNQUM0Ck3tg=";
|
||||
sha256 = "sha256-nqJ0F99QjrpwXHRPxZ7kLCYA9VJWGH2ahcr/MBQrhyY=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
|
@ -91,11 +91,11 @@ in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "brave";
|
||||
version = "1.36.122";
|
||||
version = "1.37.109";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/brave/brave-browser/releases/download/v${version}/brave-browser_${version}_amd64.deb";
|
||||
sha256 = "aBHoEu1egRPMpeUBgRl2V5J3op1Ju+CvprG14dIWc8M=";
|
||||
sha256 = "fL3vuCqUnzq38JD0bzM/DxLVb5P31iChbMVY2eax9RE=";
|
||||
};
|
||||
|
||||
dontConfigure = true;
|
||||
|
@ -45,19 +45,19 @@
|
||||
}
|
||||
},
|
||||
"ungoogled-chromium": {
|
||||
"version": "99.0.4844.84",
|
||||
"sha256": "05bma8lsm5lad58mlfiv8bg0fw5k5mxh0v6g1ik7xp2bsd71iv10",
|
||||
"sha256bin64": "0sdnsnp7hnpip91hwbz3hiw2727g0a3ydf55ldqv9bgik3vn1wln",
|
||||
"version": "100.0.4896.60",
|
||||
"sha256": "1p7zggnhsz9gj3zil0nyas4ym5bd94vs0z6mdg7r1l0s0vrsaphf",
|
||||
"sha256bin64": "07wavs9r6ilwx5rzyqvydcjskg6sml5b8m6mw7qzykvhs8bnvfh5",
|
||||
"deps": {
|
||||
"gn": {
|
||||
"version": "2022-01-10",
|
||||
"version": "2022-01-21",
|
||||
"url": "https://gn.googlesource.com/gn",
|
||||
"rev": "80a40b07305373617eba2d5878d353532af77da3",
|
||||
"sha256": "1103lf38h7412949j6nrk48m2vv2rrxacn42sjg33lg88nyv7skv"
|
||||
"rev": "0725d7827575b239594fbc8fd5192873a1d62f44",
|
||||
"sha256": "1dzdvcn2r5c9giknvasf3y5y4901kav7igivjvrpww66ywsj8fzr"
|
||||
},
|
||||
"ungoogled-patches": {
|
||||
"rev": "99.0.4844.84-1",
|
||||
"sha256": "1j02zcam09mdw7wg30r1mx27b8bw0s9dvk4qjl6vrhp24rbmscs7"
|
||||
"rev": "100.0.4896.60-1",
|
||||
"sha256": "02q7ghxynkgkbilcb8bx8q26s80fvd4hbc58zq74pnzpmn7qi342"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,15 +15,17 @@
|
||||
, openssl
|
||||
, udev
|
||||
, xorg
|
||||
, mesa
|
||||
, libdrm
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "mailspring";
|
||||
version = "1.9.2";
|
||||
version = "1.10.2";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/Foundry376/Mailspring/releases/download/${version}/mailspring-${version}-amd64.deb";
|
||||
sha256 = "sha256-o7w2XHd5FnPYt9j8IIGy6OgKtdeNb/qZ+EiXGEn0NUQ=";
|
||||
sha256 = "sha256-6KHhkmHWhj/AgECYqNuJ0iSPEYyuBDac/3fW6J0fgTg=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
@ -44,6 +46,9 @@ stdenv.mkDerivation rec {
|
||||
xorg.libXdamage
|
||||
xorg.libXScrnSaver
|
||||
xorg.libXtst
|
||||
xorg.libxshmfence
|
||||
mesa
|
||||
libdrm
|
||||
];
|
||||
|
||||
runtimeDependencies = [
|
||||
|
8
pkgs/applications/networking/mullvad/default.nix
Normal file
8
pkgs/applications/networking/mullvad/default.nix
Normal file
@ -0,0 +1,8 @@
|
||||
{ lib
|
||||
, newScope
|
||||
}:
|
||||
lib.makeScope newScope (self: {
|
||||
libwg = self.callPackage ./libwg.nix { };
|
||||
mullvad = self.callPackage ./mullvad.nix { };
|
||||
openvpn-mullvad = self.callPackage ./openvpn.nix { };
|
||||
})
|
35
pkgs/applications/networking/mullvad/libwg.nix
Normal file
35
pkgs/applications/networking/mullvad/libwg.nix
Normal file
@ -0,0 +1,35 @@
|
||||
{ lib
|
||||
, buildGoModule
|
||||
, fetchFromGitHub
|
||||
, mullvad
|
||||
}:
|
||||
buildGoModule {
|
||||
pname = "libwg";
|
||||
|
||||
inherit (mullvad)
|
||||
version
|
||||
src
|
||||
;
|
||||
|
||||
sourceRoot = "source/wireguard/libwg";
|
||||
|
||||
vendorSha256 = "qvymWCdJ+GY90W/Fpdp+r1+mTq6O4LyN2Yw/PjKdFm0=";
|
||||
|
||||
# XXX: hack to make the ar archive go to the correct place
|
||||
# This is necessary because passing `-o ...` to `ldflags` does not work
|
||||
# (this doesn't get communicated everywhere in the chain, apparently, so
|
||||
# `go` complains that it can't find an `a.out` file).
|
||||
GOBIN = "${placeholder "out"}/lib";
|
||||
ldflags = [ "-s" "-w" "-buildmode=c-archive" ];
|
||||
|
||||
postInstall = ''
|
||||
mv $out/lib/libwg{,.a}
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A tiny wrapper around wireguard-go";
|
||||
homepage = "https://github.com/mullvad/mullvadvpn-app/tree/master/wireguard/libwg";
|
||||
license = licenses.gpl3Only;
|
||||
maintainers = with maintainers; [ cole-h ];
|
||||
};
|
||||
}
|
107
pkgs/applications/networking/mullvad/mullvad.nix
Normal file
107
pkgs/applications/networking/mullvad/mullvad.nix
Normal file
@ -0,0 +1,107 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, writeText
|
||||
, rustPlatform
|
||||
, fetchFromGitHub
|
||||
, pkg-config
|
||||
, protobuf
|
||||
, makeWrapper
|
||||
, dbus
|
||||
, libnftnl
|
||||
, libmnl
|
||||
, libwg
|
||||
, openvpn-mullvad
|
||||
, shadowsocks-rust
|
||||
}:
|
||||
let
|
||||
# result of running address_cache as of 02 Mar 2022
|
||||
bootstrap-address-cache = writeText "api-ip-address.txt" ''
|
||||
193.138.218.78:443
|
||||
193.138.218.71:444
|
||||
185.65.134.66:444
|
||||
185.65.135.117:444
|
||||
217.138.254.130:444
|
||||
91.90.44.10:444
|
||||
'';
|
||||
in
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "mullvad";
|
||||
version = "2022.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "mullvad";
|
||||
repo = "mullvadvpn-app";
|
||||
rev = version;
|
||||
hash = "sha256-bLwuM3Qy2iStbXIvDEWp31vuiihSQThOej297XKo5Xc=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-CBbm8cJHTjyvvzCFQfKmsE5d9N7azEm8nI6KeWLVaa8=";
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
protobuf
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
dbus.dev
|
||||
libnftnl
|
||||
libmnl
|
||||
];
|
||||
|
||||
# talpid-core wants libwg.a in build/lib/{triple}
|
||||
preBuild = ''
|
||||
dest=build/lib/${stdenv.targetPlatform.config}
|
||||
mkdir -p $dest
|
||||
ln -s ${libwg}/lib/libwg.a $dest
|
||||
'';
|
||||
|
||||
postFixup =
|
||||
# Place all binaries in the 'mullvad-' namespace, even though these
|
||||
# specific binaries aren't used in the lifetime of the program.
|
||||
# `address_cache` is used to generate the `api-ip-address.txt` file, which
|
||||
# contains list of Mullvad API servers -- though we provide a "backup" of
|
||||
# the output of this command, it could change at any time, so we want
|
||||
# users to be able to regenerate the list at any time. (The daemon will
|
||||
# refuse to start without this file.)
|
||||
''
|
||||
for bin in address_cache relay_list translations-converter; do
|
||||
mv "$out/bin/$bin" "$out/bin/mullvad-$bin"
|
||||
done
|
||||
'' +
|
||||
# Put distributed assets in-place -- specifically, the
|
||||
# bootstrap-address-cache is necessary; otherwise, the user will have to run
|
||||
# the `address_cache` binary and move the contents into place at
|
||||
# `/var/cache/mullvad-vpn/api-ip-address.txt` manually.
|
||||
''
|
||||
mkdir -p $out/share/mullvad
|
||||
ln -s ${bootstrap-address-cache} $out/share/mullvad/api-ip-address.txt
|
||||
'' +
|
||||
# Files necessary for OpenVPN tunnels to work.
|
||||
''
|
||||
cp dist-assets/ca.crt $out/share/mullvad
|
||||
ln -s ${openvpn-mullvad}/bin/openvpn $out/share/mullvad
|
||||
ln -s ${shadowsocks-rust}/bin/sslocal $out/share/mullvad
|
||||
ln -s $out/lib/libtalpid_openvpn_plugin.so $out/share/mullvad
|
||||
'' +
|
||||
# Set the directory where Mullvad will look for its resources by default to
|
||||
# `$out/share`, so that we can avoid putting the files in `$out/bin` --
|
||||
# Mullvad defaults to looking inside the directory its binary is located in
|
||||
# for its resources.
|
||||
''
|
||||
wrapProgram $out/bin/mullvad-daemon \
|
||||
--set-default MULLVAD_RESOURCE_DIR "$out/share/mullvad"
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit libwg;
|
||||
inherit openvpn-mullvad;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Mullvad VPN command-line client tools";
|
||||
homepage = "https://github.com/mullvad/mullvadvpn-app";
|
||||
license = licenses.gpl3Only;
|
||||
maintainers = with maintainers; [ cole-h ];
|
||||
};
|
||||
}
|
87
pkgs/applications/networking/mullvad/openvpn.nix
Normal file
87
pkgs/applications/networking/mullvad/openvpn.nix
Normal file
@ -0,0 +1,87 @@
|
||||
{ lib
|
||||
, openvpn
|
||||
, fetchpatch
|
||||
, fetchurl
|
||||
, iproute2
|
||||
, autoconf
|
||||
, automake
|
||||
}:
|
||||
|
||||
openvpn.overrideAttrs (oldAttrs:
|
||||
let
|
||||
fetchMullvadPatch = { commit, sha256 }: fetchpatch {
|
||||
url = "https://github.com/mullvad/openvpn/commit/${commit}.patch";
|
||||
inherit sha256;
|
||||
};
|
||||
in
|
||||
rec {
|
||||
pname = "openvpn-mullvad";
|
||||
version = "2.5.3";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://swupdate.openvpn.net/community/releases/openvpn-${version}.tar.gz";
|
||||
sha256 = "sha256-dfAETfRJQwVVynuZWit3qyTylG/cNmgwG47cI5hqX34=";
|
||||
};
|
||||
|
||||
buildInputs = oldAttrs.buildInputs or [ ] ++ [
|
||||
iproute2
|
||||
];
|
||||
|
||||
configureFlags = oldAttrs.configureFlags or [ ] ++ [
|
||||
"--enable-iproute2"
|
||||
"IPROUTE=${iproute2}/sbin/ip"
|
||||
];
|
||||
|
||||
nativeBuildInputs = oldAttrs.nativeBuildInputs or [ ] ++ [
|
||||
autoconf
|
||||
automake
|
||||
];
|
||||
|
||||
patches = oldAttrs.patches or [ ] ++ [
|
||||
# look at compare to find the relevant commits
|
||||
# https://github.com/OpenVPN/openvpn/compare/release/2.5...mullvad:mullvad-patches
|
||||
# used openvpn version is the latest tag ending with -mullvad
|
||||
# https://github.com/mullvad/openvpn/tags
|
||||
(fetchMullvadPatch {
|
||||
# "Reduce PUSH_REQUEST_INTERVAL to one second"
|
||||
commit = "41e44158fc71bb6cc8cc6edb6ada3307765a12e8";
|
||||
sha256 = "sha256-UoH0V6gTPdEuybFkWxdaB4zomt7rZeEUyXs9hVPbLb4=";
|
||||
})
|
||||
(fetchMullvadPatch {
|
||||
# "Allow auth plugins to set a failure reason"
|
||||
commit = "f51781c601e8c72ae107deaf25bf66f7c193e9cd";
|
||||
sha256 = "sha256-+kwG0YElL16T0e+avHlI8gNQdAxneRS6fylv7QXvC1s=";
|
||||
})
|
||||
(fetchMullvadPatch {
|
||||
# "Send an event to any plugins when authentication fails"
|
||||
commit = "c2f810f966f2ffd68564d940b5b8946ea6007d5a";
|
||||
sha256 = "sha256-PsKIxYwpLD66YaIpntXJM8OGcObyWBSAJsQ60ojvj30=";
|
||||
})
|
||||
(fetchMullvadPatch {
|
||||
# "Shutdown when STDIN is closed"
|
||||
commit = "879d6a3c0288b5443bbe1b94261655c329fc2e0e";
|
||||
sha256 = "sha256-pRFY4r+b91/xAKXx6u5GLzouQySXuO5gH0kMGm77a3c=";
|
||||
})
|
||||
(fetchMullvadPatch {
|
||||
# "Update TAP hardware ID"
|
||||
commit = "7f71b37a3b25bec0b33a0e29780c222aef869e9d";
|
||||
sha256 = "sha256-RF/GvD/ZvhLdt34wDdUT/yxa+IVWx0eY6WRdNWXxXeQ=";
|
||||
})
|
||||
(fetchMullvadPatch {
|
||||
# "Undo dependency on Python docutils"
|
||||
commit = "abd3c6214529d9f4143cc92dd874d8743abea17c";
|
||||
sha256 = "sha256-SC2RlpWHUDMAEKap1t60dC4hmalk3vok6xY+/xhC2U0=";
|
||||
})
|
||||
(fetchMullvadPatch {
|
||||
# "Prevent signal when stdin is closed from being cleared (#10)"
|
||||
commit = "b45b090c81e7b4f2dc938642af7a1e12f699f5c5";
|
||||
sha256 = "sha256-KPTFmbuJhMI+AvaRuu30CPPLQAXiE/VApxlUCqbZFls=";
|
||||
})
|
||||
];
|
||||
|
||||
meta = oldAttrs.meta or { } // {
|
||||
description = "OpenVPN with Mullvad-specific patches applied";
|
||||
homepage = "https://github.com/mullvad/openvpn";
|
||||
maintainers = with lib; [ maintainers.cole-h ];
|
||||
};
|
||||
})
|
@ -11,7 +11,7 @@ assert withQt -> qt5 != null;
|
||||
with lib;
|
||||
|
||||
let
|
||||
version = "3.6.2";
|
||||
version = "3.6.3";
|
||||
variant = if withQt then "qt" else "cli";
|
||||
|
||||
in stdenv.mkDerivation {
|
||||
@ -21,7 +21,7 @@ in stdenv.mkDerivation {
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://www.wireshark.org/download/src/all-versions/wireshark-${version}.tar.xz";
|
||||
sha256 = "sha256-XZAaVXKu+VPwStwlPtKgaZ1MYnedMkkCHh6FQaAkww4=";
|
||||
sha256 = "sha256-tgNkpMAGihCBGrP9B1ymwesOddRGACcbiKIO2Tou9jE=";
|
||||
};
|
||||
|
||||
cmakeFlags = [
|
||||
|
@ -105,7 +105,7 @@ stdenv.mkDerivation rec {
|
||||
genericName = "Reference Management";
|
||||
categories = [ "Office" "Database" ];
|
||||
startupNotify = true;
|
||||
mimeTypes = [ "text/plain" ];
|
||||
mimeTypes = [ "x-scheme-handler/zotero" "text/plain" ];
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
|
@ -1,14 +1,14 @@
|
||||
{
|
||||
"version": "14.9.1",
|
||||
"repo_hash": "0jkhvglisaj3h9ls8q8wrxnnp4xp3zggc8vmwg6jqqjsmbpi332h",
|
||||
"yarn_hash": "1bq1ka0nlb2nkjx70qpwpm8x6crbkfj0c8m39pwwc42j8wn10r9g",
|
||||
"version": "14.9.2",
|
||||
"repo_hash": "sha256-+tZN6isOb7LtUVwGshx9TP+P42sftJmQGVk1L9UJqcY=",
|
||||
"yarn_hash": "1mya6y0cb9x8491gpf7f1i7qi2rb0l7d9g5yzj44vvy3mb4rcqaj",
|
||||
"owner": "gitlab-org",
|
||||
"repo": "gitlab",
|
||||
"rev": "v14.9.1-ee",
|
||||
"rev": "v14.9.2-ee",
|
||||
"passthru": {
|
||||
"GITALY_SERVER_VERSION": "14.9.1",
|
||||
"GITLAB_PAGES_VERSION": "1.56.0",
|
||||
"GITALY_SERVER_VERSION": "14.9.2",
|
||||
"GITLAB_PAGES_VERSION": "1.56.1",
|
||||
"GITLAB_SHELL_VERSION": "13.24.0",
|
||||
"GITLAB_WORKHORSE_VERSION": "14.9.1"
|
||||
"GITLAB_WORKHORSE_VERSION": "14.9.2"
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ let
|
||||
gemdir = ./.;
|
||||
};
|
||||
|
||||
version = "14.9.1";
|
||||
version = "14.9.2";
|
||||
gitaly_package = "gitlab.com/gitlab-org/gitaly/v${lib.versions.major version}";
|
||||
in
|
||||
|
||||
@ -23,7 +23,7 @@ buildGoModule {
|
||||
owner = "gitlab-org";
|
||||
repo = "gitaly";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-mk6JZuu6b2r/OqRI4ZUf8AV/ObRKhTIQT9bQE8sH894=";
|
||||
sha256 = "sha256-eEo+WZ2N/5bLfvwJCNf9qt+h/V5dIVqCjVJeomzw/Ps=";
|
||||
};
|
||||
|
||||
vendorSha256 = "sha256-kEjgWA/Task23PScPYrqdDu3vdVR/FJl7OilUug/Bds=";
|
||||
|
@ -5,7 +5,7 @@ in
|
||||
buildGoModule rec {
|
||||
pname = "gitlab-workhorse";
|
||||
|
||||
version = "14.9.1";
|
||||
version = "14.9.2";
|
||||
|
||||
src = fetchFromGitLab {
|
||||
owner = data.owner;
|
||||
|
@ -67,7 +67,7 @@ gem 'akismet', '~> 3.0'
|
||||
gem 'invisible_captcha', '~> 1.1.0'
|
||||
|
||||
# Two-factor authentication
|
||||
gem 'devise-two-factor', '~> 4.0.0'
|
||||
gem 'devise-two-factor', '~> 4.0.2'
|
||||
gem 'rqrcode-rails3', '~> 0.1.7'
|
||||
gem 'attr_encrypted', '~> 3.1.0'
|
||||
gem 'u2f', '~> 0.2.1'
|
||||
|
@ -263,11 +263,11 @@ GEM
|
||||
railties (>= 4.1.0)
|
||||
responders
|
||||
warden (~> 1.2.3)
|
||||
devise-two-factor (4.0.0)
|
||||
activesupport (< 6.2)
|
||||
devise-two-factor (4.0.2)
|
||||
activesupport (< 7.1)
|
||||
attr_encrypted (>= 1.3, < 4, != 2)
|
||||
devise (~> 4.0)
|
||||
railties (< 6.2)
|
||||
railties (< 7.1)
|
||||
rotp (~> 6.0)
|
||||
diff-lcs (1.4.4)
|
||||
diff_match_patch (0.1.0)
|
||||
@ -1450,7 +1450,7 @@ DEPENDENCIES
|
||||
derailed_benchmarks
|
||||
device_detector
|
||||
devise (~> 4.7.2)
|
||||
devise-two-factor (~> 4.0.0)
|
||||
devise-two-factor (~> 4.0.2)
|
||||
diff_match_patch (~> 0.1.0)
|
||||
diffy (~> 3.3)
|
||||
discordrb-webhooks (~> 3.4)
|
||||
|
@ -1088,10 +1088,10 @@
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "148pfr6g8dwikdq3994gsid2a3n6p5h4z1a1dzh1898shr5f9znc";
|
||||
sha256 = "04f5rb8fg4cvzm32v413z3h53wc0fgxg927q8rqd546hdrlx4j35";
|
||||
type = "gem";
|
||||
};
|
||||
version = "4.0.0";
|
||||
version = "4.0.2";
|
||||
};
|
||||
diff-lcs = {
|
||||
groups = ["default" "development" "test"];
|
||||
|
@ -11,13 +11,13 @@
|
||||
}:
|
||||
buildGoModule rec {
|
||||
pname = "podman-tui";
|
||||
version = "0.2.0";
|
||||
version = "0.3.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "containers";
|
||||
repo = "podman-tui";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-y5bFr31CQ4JES6tjvThyy7qmoKFC59uwtDMG5r+r8K4=";
|
||||
sha256 = "sha256-1WbDmnKyFosp4Kz9QINr3lOR/wD0UW2QZf7nAAaoClM=";
|
||||
};
|
||||
|
||||
vendorSha256 = null;
|
||||
|
@ -17,13 +17,13 @@
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "podman";
|
||||
version = "4.0.2";
|
||||
version = "4.0.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "containers";
|
||||
repo = "podman";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-uLpvTnn2EWEI8+5gC3ofMjsZ9O7nLOaaUGGuvSE1gdE=";
|
||||
sha256 = "sha256-o/CIs+3LnbaUUpOQI1hijrxH7f1qBnrQw56TJ18jKQw=";
|
||||
};
|
||||
|
||||
vendorSha256 = null;
|
||||
|
@ -1,4 +1,4 @@
|
||||
{ lib, stdenv, graalvmCEPackages, glibcLocales }:
|
||||
{ lib, stdenv, graalvm, glibcLocales }:
|
||||
|
||||
{ name ? "${args.pname}-${args.version}"
|
||||
# Final executable name
|
||||
@ -19,8 +19,8 @@
|
||||
, extraNativeImageBuildArgs ? [ ]
|
||||
# XMX size of GraalVM during build
|
||||
, graalvmXmx ? "-J-Xmx6g"
|
||||
# The GraalVM to use
|
||||
, graalvm ? graalvmCEPackages.graalvm11-ce
|
||||
# The GraalVM derivation to use
|
||||
, graalvmDrv ? graalvm
|
||||
, meta ? { }
|
||||
, ...
|
||||
} @ args:
|
||||
@ -28,7 +28,7 @@
|
||||
stdenv.mkDerivation (args // {
|
||||
inherit dontUnpack;
|
||||
|
||||
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ graalvm glibcLocales ];
|
||||
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ graalvmDrv glibcLocales ];
|
||||
|
||||
nativeImageBuildArgs = nativeImageBuildArgs ++ extraNativeImageBuildArgs ++ [ graalvmXmx ];
|
||||
|
||||
@ -52,7 +52,7 @@ stdenv.mkDerivation (args // {
|
||||
|
||||
meta = {
|
||||
# default to graalvm's platforms
|
||||
platforms = graalvm.meta.platforms;
|
||||
platforms = graalvmDrv.meta.platforms;
|
||||
# default to executable name
|
||||
mainProgram = executable;
|
||||
} // meta;
|
||||
|
@ -16,13 +16,13 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "yaru";
|
||||
version = "22.04.2";
|
||||
version = "22.04.3.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ubuntu";
|
||||
repo = "yaru";
|
||||
rev = version;
|
||||
sha256 = "sha256-oW5OOJPhC3OB3GIQWTQxPgqE7p4bAO1TyVbyKUHnyD0=";
|
||||
sha256 = "sha256-nNI6Nm3ZpIJRTbIbe/P9cKofcthb6qWKjn81/ZpPo2g=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ meson sassc pkg-config glib ninja python3 ];
|
||||
|
@ -1,5 +1,5 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
{ stdenv
|
||||
, lib
|
||||
, fetchurl
|
||||
, fetchpatch
|
||||
, gnome
|
||||
@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
|
||||
sha256 = "1a9ynlwwkb3wpg293ym517vmrkk63y809mmcv9a21k5yr199x53c";
|
||||
sha256 = "bJSeUsi+zCBU2qzWBJAfZs5c9wml+pHEu3ysyTm1Pqk=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
@ -82,7 +82,8 @@ stdenv.mkDerivation rec {
|
||||
passthru = {
|
||||
updateScript = gnome.updateScript {
|
||||
packageName = pname;
|
||||
attrPath = "gnome.${pname}";
|
||||
attrPath = "gnome.gnome-bluetooth_1_0";
|
||||
freeze = true;
|
||||
};
|
||||
};
|
||||
|
@ -48,6 +48,8 @@ lib.makeScope pkgs.newScope (self: with self; {
|
||||
|
||||
gnome-bluetooth = callPackage ./core/gnome-bluetooth { };
|
||||
|
||||
gnome-bluetooth_1_0 = callPackage ./core/gnome-bluetooth/1.0 { };
|
||||
|
||||
gnome-color-manager = callPackage ./core/gnome-color-manager { };
|
||||
|
||||
gnome-contacts = callPackage ./core/gnome-contacts { };
|
||||
|
@ -1,9 +1,10 @@
|
||||
{ lib, stdenv
|
||||
{ stdenv
|
||||
, lib
|
||||
, autoreconfHook
|
||||
, fetchurl
|
||||
, gettext
|
||||
, glib
|
||||
, gnome-bluetooth
|
||||
, gnome-bluetooth_1_0
|
||||
, gnome-desktop
|
||||
, gnome-panel
|
||||
, gnome-session
|
||||
@ -94,7 +95,7 @@ let
|
||||
|
||||
buildInputs = [
|
||||
glib
|
||||
gnome-bluetooth
|
||||
gnome-bluetooth_1_0
|
||||
gnome-desktop
|
||||
gsettings-desktop-schemas
|
||||
gtk3
|
||||
|
@ -1,9 +1,12 @@
|
||||
{ lib, stdenv
|
||||
{ stdenv
|
||||
, lib
|
||||
, fetchurl
|
||||
, fetchpatch
|
||||
, autoreconfHook
|
||||
, dconf
|
||||
, evolution-data-server
|
||||
, gdm
|
||||
, geocode-glib
|
||||
, gettext
|
||||
, glib
|
||||
, gnome-desktop
|
||||
@ -37,6 +40,13 @@ stdenv.mkDerivation rec {
|
||||
# instead of gnome-panel’s libdir so that the NixOS module can make gnome-panel
|
||||
# load modules from other packages as well.
|
||||
./modulesdir-env-var.patch
|
||||
|
||||
# Add missing geocode-glib-1.0 dependency
|
||||
# https://gitlab.gnome.org/GNOME/gnome-panel/-/merge_requests/49
|
||||
(fetchpatch {
|
||||
url = "https://gitlab.gnome.org/GNOME/gnome-panel/-/commit/f58a43ec4649a25f1a762b36e1401b81cd2b214b.patch";
|
||||
sha256 = "sha256-DFqaNUjkLh4xd81qgQpl+568eUZeWyF8LxdZoTgMfCQ=";
|
||||
})
|
||||
];
|
||||
|
||||
# make .desktop Exec absolute
|
||||
@ -69,6 +79,7 @@ stdenv.mkDerivation rec {
|
||||
dconf
|
||||
evolution-data-server
|
||||
gdm
|
||||
geocode-glib
|
||||
glib
|
||||
gnome-desktop
|
||||
gnome-menus
|
||||
|
@ -68,6 +68,14 @@ stdenv.mkDerivation rec {
|
||||
pango
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
# elementary/dock/master is missing a Meson post
|
||||
# install script that does this. This has been
|
||||
# resolved after the dock rewrite (the `main` branch).
|
||||
# https://github.com/elementary/default-settings/issues/267
|
||||
glib-compile-schemas $out/share/glib-2.0/schemas
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Elegant, simple, clean dock";
|
||||
homepage = "https://github.com/elementary/dock";
|
||||
|
@ -108,7 +108,7 @@ lib.makeScope pkgs.newScope (self: with self; {
|
||||
gala = callPackage ./desktop/gala { };
|
||||
|
||||
gnome-bluetooth-contract = callPackage ./desktop/gnome-bluetooth-contract {
|
||||
inherit (gnome) gnome-bluetooth;
|
||||
inherit (gnome) gnome-bluetooth_1_0;
|
||||
};
|
||||
|
||||
wingpanel = callPackage ./desktop/wingpanel { };
|
||||
|
@ -3,7 +3,7 @@
|
||||
, fetchFromGitHub
|
||||
, unstableGitUpdater
|
||||
, substituteAll
|
||||
, gnome-bluetooth
|
||||
, gnome-bluetooth_1_0
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
@ -20,7 +20,9 @@ stdenv.mkDerivation rec {
|
||||
patches = [
|
||||
(substituteAll {
|
||||
src = ./exec-path.patch;
|
||||
gnome_bluetooth = gnome-bluetooth;
|
||||
# sendto device selection is removed in gnome-bluetooth 42
|
||||
# https://github.com/elementary/gnome-bluetooth-contract/issues/1
|
||||
gnome_bluetooth = gnome-bluetooth_1_0;
|
||||
})
|
||||
];
|
||||
|
||||
@ -49,8 +51,5 @@ stdenv.mkDerivation rec {
|
||||
license = licenses.gpl3Plus;
|
||||
maintainers = teams.pantheon.members;
|
||||
platforms = platforms.linux;
|
||||
# sendto device selection is removed in gnome-bluetooth 42
|
||||
# https://github.com/elementary/gnome-bluetooth-contract/issues/1
|
||||
broken = true;
|
||||
};
|
||||
}
|
||||
|
@ -1,9 +1,6 @@
|
||||
import ./generic.nix {
|
||||
major_version = "4";
|
||||
minor_version = "14";
|
||||
patch_version = "0-rc2";
|
||||
src = fetchTarball {
|
||||
url = "https://caml.inria.fr/pub/distrib/ocaml-4.14/ocaml-4.14.0~rc2.tar.xz";
|
||||
sha256 = "sha256:0ch8nyfk2mzwhmlxb434cyamp7n14zxhwsq1h8033g629kw50kb0";
|
||||
};
|
||||
patch_version = "0";
|
||||
sha256 = "sha256:0axcc7c23pf4qinz4vxgkba6pwziwbp9i2ydwzar7x9zlp6diarn";
|
||||
}
|
||||
|
@ -90,8 +90,8 @@ let
|
||||
|
||||
in rec {
|
||||
vala_0_48 = generic {
|
||||
version = "0.48.23";
|
||||
sha256 = "sha256-3jzIWNmV4HR0IZ4lo+Hw7ZmAcNLiBtOjE9Q3ml93oGo=";
|
||||
version = "0.48.24";
|
||||
sha256 = "NknvhFc7aGX8NHBkDuYDcgCZ65FbOfqtGbdJjeGn3yQ=";
|
||||
};
|
||||
|
||||
vala_0_54 = generic {
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "gnome-online-accounts";
|
||||
version = "3.43.1";
|
||||
version = "3.44.0";
|
||||
|
||||
# https://gitlab.gnome.org/GNOME/gnome-online-accounts/issues/87
|
||||
src = fetchFromGitLab {
|
||||
@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
|
||||
owner = "GNOME";
|
||||
repo = "gnome-online-accounts";
|
||||
rev = version;
|
||||
sha256 = "sha256-Dpq5bQwU0ZAxmEllpbLnS1Jz3F0rxtFMKZcIvAteObU=";
|
||||
sha256 = "sha256-8dp3cizyQVHegDxX9G6iGLW5g44audn431hCPMS/KlA=";
|
||||
};
|
||||
|
||||
outputs = [ "out" "man" "dev" "devdoc" ];
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "aioairzone";
|
||||
version = "0.2.1";
|
||||
version = "0.3.1";
|
||||
format = "setuptools";
|
||||
|
||||
disabled = pythonOlder "3.8";
|
||||
@ -16,7 +16,7 @@ buildPythonPackage rec {
|
||||
owner = "Noltari";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
hash = "sha256-R5OK/B7fq15lpt8nKECiHMmfK9xmiLPtoKC65C7H/7c=";
|
||||
hash = "sha256-iu0pX12GmP5u6G8uY+6FODj732dD6JPxkrpWXw41/6Q=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "ansible-later";
|
||||
version = "2.0.8";
|
||||
version = "2.0.9";
|
||||
format = "pyproject";
|
||||
|
||||
disabled = pythonOlder "3.8";
|
||||
@ -30,7 +30,7 @@ buildPythonPackage rec {
|
||||
owner = "thegeeklab";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
hash = "sha256-oPlm9uxyN3hyf4gFv37YWEn/HOkg0QQ1Ya3tjLd53rQ=";
|
||||
hash = "sha256-g7/RClQB+6HsDbe/VjjKka97LcwRTKO0OD0RlCG9lWY=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "apycula";
|
||||
version = "0.2";
|
||||
version = "0.3";
|
||||
format = "setuptools";
|
||||
|
||||
disabled = pythonOlder "3.8";
|
||||
@ -20,7 +20,7 @@ buildPythonPackage rec {
|
||||
src = fetchPypi {
|
||||
inherit version;
|
||||
pname = "Apycula";
|
||||
hash = "sha256-xvr/NDAjCjhpImzNlCOcI4x5dIAefJ1TnUgoBhgdhPA=";
|
||||
hash = "sha256-Ncecrn5fQW0iAgrE3P7GZTx8E1TiFqiDMhZQSPrDvdk=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
@ -9,7 +9,7 @@
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
version = "0.1.6";
|
||||
version = "0.1.8";
|
||||
pname = "cdcs";
|
||||
format = "setuptools";
|
||||
|
||||
@ -19,7 +19,7 @@ buildPythonPackage rec {
|
||||
owner = "usnistgov";
|
||||
repo = "pycdcs";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-w9CBNOK9oXTIUa+SsnepRN0wAz7WPZGfUNDSbtVn1L8=";
|
||||
sha256 = "sha256-s+COE7hus1J5I8PTdagl7KEK5QFoidjQ3ee46kOWmkE=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "dropbox";
|
||||
version = "11.28.0";
|
||||
version = "11.29.0";
|
||||
format = "setuptools";
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
@ -20,7 +20,7 @@ buildPythonPackage rec {
|
||||
owner = "dropbox";
|
||||
repo = "dropbox-sdk-python";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-xNenBmeCRIYxQqAkV8IDpPpIHyVAYJs1jAFr8w1tz2Y=";
|
||||
sha256 = "sha256-TKJb34hJYzZtQcqgopLpN8c1utWCNjmev9epY+hYU7M=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "fastcore";
|
||||
version = "1.4.0";
|
||||
version = "1.4.1";
|
||||
format = "setuptools";
|
||||
|
||||
disabled = pythonOlder "3.8";
|
||||
@ -17,7 +17,7 @@ buildPythonPackage rec {
|
||||
owner = "fastai";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "sha256-U7tZkqfBbl5IVZlC2/JBIx7Bm5iIiXTMSm0QHmzNiys=";
|
||||
sha256 = "sha256-qZsCsMwZxJsnznQ/C1SUPexkquv0tIyCkNYL5f2k0FU=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "glean-parser";
|
||||
version = "5.1.0";
|
||||
version = "5.1.1";
|
||||
format = "setuptools";
|
||||
|
||||
disabled = pythonOlder "3.6";
|
||||
@ -23,7 +23,7 @@ buildPythonPackage rec {
|
||||
src = fetchPypi {
|
||||
pname = "glean_parser";
|
||||
inherit version;
|
||||
hash = "sha256-8oMbaGsW5Lkw9OluNsXXe2IBNbjeoIb9vDjVOt+uHR0=";
|
||||
hash = "sha256-zUiF0buHBe0BaaeIRJcRoT/g+NhWv6XTuhCZ6WPrris=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "hahomematic";
|
||||
version = "1.0.3";
|
||||
version = "1.0.4";
|
||||
format = "setuptools";
|
||||
|
||||
disabled = pythonOlder "3.9";
|
||||
@ -23,7 +23,7 @@ buildPythonPackage rec {
|
||||
owner = "danielperna84";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "sha256-WteSLhO/Ei+467tXT7Y1S6bYNNFUILbP5Pm4ZhBYaeg=";
|
||||
sha256 = "sha256-YpsZKhuK3IzUZFNmBToBOuUacaDgbMC/N7pZDjuSzbE=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
|
31
pkgs/development/python-modules/hepunits/default.nix
Normal file
31
pkgs/development/python-modules/hepunits/default.nix
Normal file
@ -0,0 +1,31 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchPypi
|
||||
, setuptools-scm
|
||||
, pytestCheckHook
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "hepunits";
|
||||
version = "2.2.0";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "sha256-6A5hb+8oF/PGbHXcDkHtJjYkiMzgX5Stz977jgXry1g=";
|
||||
};
|
||||
nativeBuildInputs = [
|
||||
setuptools-scm
|
||||
];
|
||||
|
||||
checkInputs = [
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "Units and constants in the HEP system of units";
|
||||
homepage = "https://github.com/scikit-hep/hepunits";
|
||||
license = lib.licenses.bsd3;
|
||||
maintainers = with lib.maintainers; [ doronbehar ];
|
||||
};
|
||||
}
|
||||
|
@ -9,14 +9,14 @@
|
||||
|
||||
buildPythonApplication rec {
|
||||
pname = "jsbeautifier";
|
||||
version = "1.14.1";
|
||||
version = "1.14.2";
|
||||
format = "setuptools";
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
hash = "sha256-ZfT3dLDkywIutJmbRc1ndi92Qnxe80CCq6VLwdjvI+s=";
|
||||
hash = "sha256-PskybkfTilQ5W97/h2lWakcnWOcLnhG6fMVs/spqm/Y=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "meilisearch";
|
||||
version = "0.18.1";
|
||||
version = "0.18.2";
|
||||
format = "setuptools";
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
@ -16,7 +16,7 @@ buildPythonPackage rec {
|
||||
owner = "meilisearch";
|
||||
repo = "meilisearch-python";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-Rd2GmomNzW0+oI2QEGcPY4g8H+4FN7eLKY1ljcibsLw=";
|
||||
hash = "sha256-U9fdMcxPdtLiUStgTez99SPRh93WLZNVn8uIj4lNWh4=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "mypy-boto3-builder";
|
||||
version = "7.5.4";
|
||||
version = "7.5.5";
|
||||
format = "pyproject";
|
||||
|
||||
disabled = pythonOlder "3.10";
|
||||
@ -25,7 +25,7 @@ buildPythonPackage rec {
|
||||
owner = "vemel";
|
||||
repo = "mypy_boto3_builder";
|
||||
rev = version;
|
||||
hash = "sha256-NS8lFetL/8hcvCnIHw+GDtdEKFsN81MPybEA4PGaP/Q=";
|
||||
hash = "sha256-rv0c0QoXOd7aSOLhGDGfq4v0bnGBOJhGhZVNhS5hgOs=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
@ -6,13 +6,13 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "param";
|
||||
version = "1.12.0";
|
||||
version = "1.12.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "holoviz";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "02zmd4bwyn8b4q1l9jgddc70ii1i7bmynacanl1cvbr6la4v9b2c";
|
||||
sha256 = "sha256-MehTz0qCpWe/11PZ5jmFxHE54TA+QX2KfqvKB8L79V4=";
|
||||
};
|
||||
|
||||
checkInputs = [
|
||||
|
56
pkgs/development/python-modules/particle/default.nix
Normal file
56
pkgs/development/python-modules/particle/default.nix
Normal file
@ -0,0 +1,56 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
, fetchPypi
|
||||
, setuptools-scm
|
||||
, attrs
|
||||
, deprecated
|
||||
, hepunits
|
||||
, pytestCheckHook
|
||||
, tabulate
|
||||
, pandas
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "particle";
|
||||
version = "0.20.1";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "sha256-HoWWwoGMrkRqlYzrF2apGsxsZAHwHbHSO5TCSCelxUc=";
|
||||
};
|
||||
nativeBuildInputs = [
|
||||
setuptools-scm
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
attrs
|
||||
deprecated
|
||||
hepunits
|
||||
];
|
||||
|
||||
pythonImportsCheck = [
|
||||
"particle"
|
||||
];
|
||||
|
||||
preCheck = ''
|
||||
# Disable benchmark tests, so we won't need pytest-benchmark and pytest-cov
|
||||
# as dependencies
|
||||
substituteInPlace pyproject.toml \
|
||||
--replace '"--benchmark-disable", ' ""
|
||||
rm tests/particle/test_performance.py
|
||||
'';
|
||||
|
||||
checkInputs = [
|
||||
pytestCheckHook
|
||||
tabulate
|
||||
pandas
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "Package to deal with particles, the PDG particle data table, PDGIDs, etc.";
|
||||
homepage = "https://github.com/scikit-hep/particle";
|
||||
license = lib.licenses.bsd3;
|
||||
maintainers = with lib.maintainers; [ doronbehar ];
|
||||
};
|
||||
}
|
@ -13,7 +13,7 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "pontos";
|
||||
version = "22.2.4";
|
||||
version = "22.4.0";
|
||||
format = "pyproject";
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
@ -22,7 +22,7 @@ buildPythonPackage rec {
|
||||
owner = "greenbone";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
hash = "sha256-RmMlwnAJlCTDnTyim0MdAeW3NA8r2IiqrE0YeWgxUk4=";
|
||||
hash = "sha256-W+l5QIpum1uTsx/mxZGkRoJAZaC1viURVYg4Kvjv32Y=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "pycfmodel";
|
||||
version = "0.17.1";
|
||||
version = "0.18.0";
|
||||
format = "setuptools";
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
@ -18,7 +18,7 @@ buildPythonPackage rec {
|
||||
owner = "Skyscanner";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
hash = "sha256-Rw0sZ2k+tXo04mvlL83hUgdHIND5NIsVH/CzrfmbKlE=";
|
||||
hash = "sha256-g249Nq4u4pPQLbW9Kw5vLwVKCaZoots5LD6yk1NPv6s=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "pynetgear";
|
||||
version = "0.9.1";
|
||||
version = "0.9.2";
|
||||
format = "setuptools";
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
@ -16,7 +16,7 @@ buildPythonPackage rec {
|
||||
owner = "MatMaul";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "sha256-sLGr8I0LcLPrmQZ6dI+hwRAiNCrnLtr2WU04rPoG4x4=";
|
||||
sha256 = "sha256-/aPyx+jNOCW6bzeYAEBP1yfIJfQwJjo1i6WaRvAz0oU=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "pyoverkiz";
|
||||
version = "1.3.13";
|
||||
version = "1.3.14";
|
||||
format = "pyproject";
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
@ -24,7 +24,7 @@ buildPythonPackage rec {
|
||||
owner = "iMicknl";
|
||||
repo = "python-overkiz-api";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-CkEo8H5S2/nf7jWU51sVN+GCqaL5Kgx77m6669Pr4dU=";
|
||||
hash = "sha256-dyT2hrTQwYoKEZAVIed2N4259YlR2JmvOEpAuPLCur4=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
@ -3,11 +3,11 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "pypugjs";
|
||||
version = "5.9.10";
|
||||
version = "5.9.11";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "082dae87d44e184030b66da9ea9bd1a0209f86c089d8f2bd61064b97a7511a28";
|
||||
sha256 = "sha256-kStaT1S8cPJF+iDFk/jLGKi3JVOMmtf7PzeYDKCdD0E=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ six chardet ];
|
||||
|
@ -6,14 +6,14 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "sabyenc3";
|
||||
version = "5.1.5";
|
||||
version = "5.1.6";
|
||||
format = "setuptools";
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
hash = "sha256-JwCzy3QRCzxT8B0VM5SXIIWlYi08tT8eLj/QKtMYLRE=";
|
||||
hash = "sha256-DHHil9ZQsrKLgw5dje0Yo1J5FZAFrY1tn5y3mdBJHWg=";
|
||||
};
|
||||
|
||||
# Tests are not included in pypi distribution
|
||||
|
@ -3,10 +3,10 @@
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "include-what-you-use";
|
||||
# Also bump llvmPackages in all-packages.nix to the supported version!
|
||||
version = "0.17";
|
||||
version = "0.18";
|
||||
|
||||
src = fetchurl {
|
||||
sha256 = "sha256-7KfAT4tBa2OF7QDjNmmn+kaTzSbLcrUizeVYgo6wxmU=";
|
||||
sha256 = "sha256-kQL8hBkpR1ffhqic5uwwX42QqBjR8lmKE50V6xiUuPM=";
|
||||
url = "${meta.homepage}/downloads/${pname}-${version}.src.tar.gz";
|
||||
};
|
||||
|
||||
|
@ -5,13 +5,13 @@
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "tfsec";
|
||||
version = "1.15.2";
|
||||
version = "1.15.4";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "aquasecurity";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-nXrWKKHb64HGHttppBveLp45qKLnGvkElqxn8f/cWok=";
|
||||
sha256 = "sha256-IYmS3Q2WWkOYISx0jI8yggArk0fhl3WQWrsc+Zfg8gU=";
|
||||
};
|
||||
|
||||
ldflags = [
|
||||
|
@ -14,13 +14,13 @@
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "buildah";
|
||||
version = "1.24.2";
|
||||
version = "1.25.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "containers";
|
||||
repo = "buildah";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-gBO+H26YGmOtP3CUHZjynAaOb0h+MJbJnWqxOZdif6w=";
|
||||
sha256 = "sha256-NQ+Tv3KUrvX+MWM1ZFmsJ4JKoSIpSBjGNiruJkRd6rE=";
|
||||
};
|
||||
|
||||
outputs = [ "out" "man" ];
|
||||
|
@ -73,43 +73,43 @@ rec {
|
||||
headers = "0vvizddmhprprbdf6bklasz6amwc254bpc9j0zlx23d1pgyxpnhc";
|
||||
};
|
||||
|
||||
electron_14 = mkElectron "14.2.7" {
|
||||
armv7l-linux = "bb0c25671daa0dc235e212831d62f18b9a7f2692279bcd8e4a15f2d84ee7124d";
|
||||
aarch64-linux = "149c5df2cf98ee0a2ce5445b3fb00752f42c3f7ab9677b7a54ba01fba2e2f4ec";
|
||||
x86_64-linux = "ad80f424e8d8d79f0be078d8a1ddef8fd659fa3dd8aaf6704ab97f2a13489558";
|
||||
i686-linux = "82b29272cb52dbe969c0bd6cf9b69896c86abe1d9ef473a3844c0ab3dc92b353";
|
||||
x86_64-darwin = "2a5d8336dcd140158964801d482344756377d924a06e6605959034a41f7e026b";
|
||||
aarch64-darwin = "b45869ff61bdf392bca498529b6445d47a784079f6a33af6b19d517953f03fd8";
|
||||
headers = "0339fs3iyp869xi1xmn9z2b1n32wf408cc0z9bz6shns44ymkyhd";
|
||||
electron_14 = mkElectron "14.2.9" {
|
||||
armv7l-linux = "02ae6cd9ec9c2dcb2f550923576a0c851fff3e796a5048dd3806947c541fd564";
|
||||
aarch64-linux = "631ba0f716d0272931418de42468114360bd21ec72875605fc32d67620743d2c";
|
||||
x86_64-linux = "0a62a41e8ac4592aba347c82f9c40f3fb4c84c7d00b6bb9501d02375cd49cb7d";
|
||||
i686-linux = "55e395a209d4a90e2dcd20a78af4724355feaba86411a39e66b977ed39de4d05";
|
||||
x86_64-darwin = "1df5b4c4414ade75c6cbfe13d3024702b8ae7c77f3f07b8955b2459fde6a5842";
|
||||
aarch64-darwin = "17089e54830976c4216d26e7e2e15ad2224e3b288d94973fed7e67e9b1c213b3";
|
||||
headers = "181b2agnf4b5s81p2rdnd6wkw9c2ri4cv1x0wwf7rj60axvzvydm";
|
||||
};
|
||||
|
||||
electron_15 = mkElectron "15.4.1" {
|
||||
armv7l-linux = "e0fe5daed46a5d718b3209fa301aea743df694daf6605f9313f4ca6c70fe5167";
|
||||
aarch64-linux = "fa108edd4c146811bdee842fcd278b046ae0ff157de5e072c3ff3ac0bcb310c2";
|
||||
x86_64-linux = "867095924d434b3918df8576e7af94fecea4d29461fcfb69c40161f02158ff15";
|
||||
i686-linux = "8e79fa9f4125f254abb437445fed8f3f8ec10dd2462e1ced3e7df49c622e087d";
|
||||
x86_64-darwin = "899d16a0e0157809c297ceb3710c53441ec4396333d9ad5b65297446874e14dc";
|
||||
aarch64-darwin = "8295bf45dab1131dfdfd15654a0b1d85bfae221052ba64353368a2c0faaaa3ff";
|
||||
headers = "073697wjq60cnz42xmnjsr0xqcmcsl4m48mmzrz1rxrc8mvi86gr";
|
||||
electron_15 = mkElectron "15.5.1" {
|
||||
armv7l-linux = "222e9ad3210cf538c45f938b5b1a5d901b36fb6ec09461446e4ab4ea6ee9bc1b";
|
||||
aarch64-linux = "16a0053036a9f6ba947445c85bacda720975a23a910e78cab8dce1bf8ad2acf7";
|
||||
x86_64-linux = "99867ef0eef53f214ef4c8a4ec0223890d9c38b73fd6bf4fb49a9e400dff5726";
|
||||
i686-linux = "6d65c900c77b9e259932b20978d78a56bb04fad590f29a5935d8a31f5e0891db";
|
||||
x86_64-darwin = "54e6312d5e06e16eab78d86ddb01553864b66f608d017c7a1c4a0a318be32081";
|
||||
aarch64-darwin = "6472bea7f38f38c20a8c87e6daf70ca0d00b7c29b1641eeda6c8d45f9e60784b";
|
||||
headers = "0dgxyndsyhk5m9m8iiy2h3vg1gz1xg5nj75537apsh9mdiizsfhk";
|
||||
};
|
||||
|
||||
electron_16 = mkElectron "16.1.0" {
|
||||
armv7l-linux = "f3ab34c73b4100ffc5041ed9aa0608d1dc6b98fe3c2caa14be3d5c3ffbebda76";
|
||||
aarch64-linux = "e80a7e4a59b94c7cd02b16ca37a2b0f26ddb58ddac23135c6180b238589f1c62";
|
||||
x86_64-linux = "36c79af4d05e89ef9c9616a156f63adc5b453ee6bee5d8f4331e75ee77198e85";
|
||||
i686-linux = "7129a96fc33de70cfe5d6d0e17ecff1b4dcf52d825a6ad05b10ca67da7b43665";
|
||||
x86_64-darwin = "723859249e959948cdd339acf708022fb0195b433809af25b4a9f4d69b9da52f";
|
||||
aarch64-darwin = "e76558028979f70107e5b1897275a9789be20b13991bfbcebeab7fc220f15764";
|
||||
headers = "0yv9rssrfi0hdzrjf1n735dsz9sgy78jzxdcf9is2387yrr1qiyz";
|
||||
electron_16 = mkElectron "16.2.1" {
|
||||
armv7l-linux = "d55daeffed60cfd0c2de4ea8cab102ec5957dbd0cd863add881080e891b02334";
|
||||
aarch64-linux = "6446c665a1c6d7648dbeae94a669423b4c6768bafa96f0d3f8072b8c5d5a949e";
|
||||
x86_64-linux = "7b27a8531a8ef60fa27dd119422a81a710e09f7d8cb01777f1fe7b7ab67e3ac4";
|
||||
i686-linux = "eb7e0c8113af80f0e4edbae35d2cca718c1e98966da87041304fa6afb2d3e4c0";
|
||||
x86_64-darwin = "0386e3318d4b5cfabccc226ca88bd9946669901f381e3817d1d414b1356e472c";
|
||||
aarch64-darwin = "280660c0333702de9d95bcf9a21d3db8d148bef2a5946bb57d20b9e5f2aadb96";
|
||||
headers = "121wrzy81h9m12y83mb0xs9jbm5l4w31f831lmb4wmkkg54bvcwj";
|
||||
};
|
||||
|
||||
electron_17 = mkElectron "17.1.2" {
|
||||
armv7l-linux = "b561c04c9fa8c512f418ea5c32f5526732e1ccd150ee4830a0091d0fa1b7e31c";
|
||||
aarch64-linux = "cda7e66c6672def9edd881107c28e2eec09b7802a38227ac89bb233191ce4840";
|
||||
x86_64-linux = "7e7c35e8c1a0fc451e7af19fa73264881ae2c4672c52a2ae1cdd61604650ca94";
|
||||
i686-linux = "de87a7952c93c1d8e8c533a700bbfc76d3893e9ad438413507d11450b80a9c97";
|
||||
x86_64-darwin = "d4382d3f01b750676a1f3c9e2273ad69cac16dc64a4145469c663bcda8d2471b";
|
||||
aarch64-darwin = "135dec87211fcefdb53ab1fef13344c7b71a321f7c4f6846f260c1e0848e73bf";
|
||||
headers = "15k234d044lgmc3psyxz9syy9wvzgn54znklak9sv6gcajjzll10";
|
||||
electron_17 = mkElectron "17.3.1" {
|
||||
armv7l-linux = "ad7864f9a580b3fd8865480caa6cccbaefa5d7e5fdbe455700ab711b0adf2228";
|
||||
aarch64-linux = "e0f03aff5339e4dab85cbc970568ca31599ee0f032d1e766c23deea7d96654b0";
|
||||
x86_64-linux = "59d13b1d060523d1098e6e1e5bf7c6f2494b713321541f863dc459a42d2c40a8";
|
||||
i686-linux = "6d31d5117f4508bc7e0f9ecb6423d266b47fb5f074b0dfa8ddcfc2298c764151";
|
||||
x86_64-darwin = "c70a6e906ae7ce02552f1722022147f2416f27de0f98b88a0b7b1a09e341426f";
|
||||
aarch64-darwin = "76a9c8cbfa578c7e6678e6ccab2417374d1b3d3d81c6cac5ceea0aa058c12a8f";
|
||||
headers = "11k5sw7wk0fjjdlhcvbkwpffslngm9ns8l4c7rxa4qx8n1six9sf";
|
||||
};
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ let
|
||||
maintainers = with maintainers; [ travisbhartwell manveru prusnak ];
|
||||
platforms = [ "x86_64-darwin" "x86_64-linux" "i686-linux" "armv7l-linux" "aarch64-linux" ]
|
||||
++ optionals (versionAtLeast version "11.0.0") [ "aarch64-darwin" ];
|
||||
knownVulnerabilities = optional (versionOlder version "14.0.0") "Electron version ${version} is EOL";
|
||||
knownVulnerabilities = optional (versionOlder version "15.0.0") "Electron version ${version} is EOL";
|
||||
};
|
||||
|
||||
fetcher = vers: tag: hash: fetchurl {
|
||||
|
@ -10,16 +10,16 @@
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "just";
|
||||
version = "1.1.1";
|
||||
version = "1.1.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "casey";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "sha256-hgXMWQ7UlGyeb/j7V/Uw4gZjk/r1hA7lMjVL8i8st7o=";
|
||||
sha256 = "sha256-vUtJ9QVMmDGfkYTBoK8mVaJTEfNBQD5sTEp7kC0LNZw=";
|
||||
};
|
||||
|
||||
cargoSha256 = "sha256-QJruh4voCB/q7xh5I6XnVtKA4Jbn9U84Mt2pHte7Kog=";
|
||||
cargoSha256 = "sha256-rJjLXktWnT6kRx1/18AFr6KciaFF8PaTpz27wz+vGug=";
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
|
||||
|
@ -5,6 +5,8 @@
|
||||
, php
|
||||
, lib, stdenv
|
||||
, installShellFiles
|
||||
, which
|
||||
, python3
|
||||
}:
|
||||
|
||||
# Make a custom wrapper. If `wrapProgram` is used, arcanist thinks .arc-wrapped is being
|
||||
@ -14,7 +16,7 @@
|
||||
let makeArcWrapper = toolset: ''
|
||||
cat << WRAPPER > $out/bin/${toolset}
|
||||
#!$shell -e
|
||||
export PATH='${php}/bin/'\''${PATH:+':'}\$PATH
|
||||
export PATH='${php}/bin:${which}/bin'\''${PATH:+':'}\$PATH
|
||||
exec ${php}/bin/php $out/libexec/arcanist/bin/${toolset} "\$@"
|
||||
WRAPPER
|
||||
chmod +x $out/bin/${toolset}
|
||||
@ -32,7 +34,9 @@ stdenv.mkDerivation {
|
||||
sha256 = "0jiv4aj4m5750dqw9r8hizjkwiyxk4cg4grkr63sllsa2dpiibxw";
|
||||
};
|
||||
|
||||
buildInputs = [ php ];
|
||||
patches = [ ./dont-require-python3-in-path.patch ];
|
||||
|
||||
buildInputs = [ php python3 ];
|
||||
|
||||
nativeBuildInputs = [ bison flex installShellFiles ];
|
||||
|
||||
|
@ -0,0 +1,26 @@
|
||||
Don't require python3 in PATH
|
||||
|
||||
Once packaged, the arcanoid.py script has an absolute path shebang to
|
||||
python3, so there is no need to also require python3 in PATH.
|
||||
|
||||
This prevents leaking in a python3 in PATH in the environment which arc
|
||||
runs linters etc.
|
||||
|
||||
Author: bjorn.forsman@gmail.com
|
||||
diff -uNr arcanist.orig/src/workflow/ArcanistAnoidWorkflow.php arcanist.new/src/workflow/ArcanistAnoidWorkflow.php
|
||||
--- arcanist.orig/src/workflow/ArcanistAnoidWorkflow.php 2022-03-31 13:23:30.865095192 +0200
|
||||
+++ arcanist.new/src/workflow/ArcanistAnoidWorkflow.php 2022-04-01 12:19:15.644159639 +0200
|
||||
@@ -24,13 +24,6 @@
|
||||
}
|
||||
|
||||
public function runWorkflow() {
|
||||
- if (!Filesystem::binaryExists('python3')) {
|
||||
- throw new PhutilArgumentUsageException(
|
||||
- pht(
|
||||
- 'The "arc anoid" workflow requires "python3" to be available '.
|
||||
- 'in your $PATH.'));
|
||||
- }
|
||||
-
|
||||
$support_dir = phutil_get_library_root('arcanist');
|
||||
$support_dir = dirname($support_dir);
|
||||
$support_dir = $support_dir.'/support/';
|
@ -2,18 +2,18 @@
|
||||
|
||||
buildGraalvmNativeImage rec {
|
||||
pname = "clojure-lsp";
|
||||
version = "2022.03.26-18.47.08";
|
||||
version = "2022.03.31-20.00.20";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = pname;
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "sha256-tlI4h9/DTc3JwqCM58YC5x4FDpuPm7Qeik3PJe64nVA=";
|
||||
sha256 = "sha256-UQA/BXf6hTTxZ504e1faPdS8mKYS8WrY5L/zgaGCxpU=";
|
||||
};
|
||||
|
||||
jar = fetchurl {
|
||||
url = "https://github.com/clojure-lsp/clojure-lsp/releases/download/${version}/clojure-lsp-standalone.jar";
|
||||
sha256 = "4973f5cf45f0b8120206d057d88d6a7fca03e071c8ad1ecd7229db46a0604ed2";
|
||||
sha256 = "e66689326c39ae74f0e8d9f5a8229c7ebebe010849870a47faf88e81cbaa37e0";
|
||||
};
|
||||
|
||||
extraNativeImageBuildArgs = [
|
||||
|
@ -5,17 +5,10 @@
|
||||
}:
|
||||
let
|
||||
# Poetry2nix version
|
||||
version = "1.26.0";
|
||||
version = "1.27.1";
|
||||
|
||||
inherit (poetryLib) isCompatible readTOML moduleName;
|
||||
|
||||
/* The default list of poetry2nix override overlays */
|
||||
mkEvalPep508 = import ./pep508.nix {
|
||||
inherit lib poetryLib;
|
||||
stdenv = pkgs.stdenv;
|
||||
};
|
||||
getFunctorFn = fn: if builtins.typeOf fn == "set" then fn.__functor else fn;
|
||||
|
||||
# Map SPDX identifiers to license names
|
||||
spdxLicenses = lib.listToAttrs (lib.filter (pair: pair.name != null) (builtins.map (v: { name = if lib.hasAttr "spdxId" v then v.spdxId else null; value = v; }) (lib.attrValues lib.licenses)));
|
||||
# Get license by id falling back to input string
|
||||
@ -121,10 +114,16 @@ lib.makeScope pkgs.newScope (self: {
|
||||
, preferWheels ? false
|
||||
# Example: { my-app = ./src; }
|
||||
, editablePackageSources ? { }
|
||||
, __isBootstrap ? false # Hack: Always add Poetry as a build input unless bootstrapping
|
||||
, pyProject ? readTOML pyproject
|
||||
}@attrs:
|
||||
let
|
||||
/* The default list of poetry2nix override overlays */
|
||||
mkEvalPep508 = import ./pep508.nix {
|
||||
inherit lib poetryLib;
|
||||
inherit (python) stdenv;
|
||||
};
|
||||
getFunctorFn = fn: if builtins.typeOf fn == "set" then fn.__functor else fn;
|
||||
|
||||
poetryPkg = poetry.override { inherit python; };
|
||||
|
||||
scripts = pyProject.tool.poetry.scripts or { };
|
||||
@ -180,7 +179,6 @@ lib.makeScope pkgs.newScope (self: {
|
||||
value = self.mkPoetryDep (
|
||||
pkgMeta // {
|
||||
inherit pwd preferWheels;
|
||||
inherit __isBootstrap;
|
||||
source = pkgMeta.source or null;
|
||||
files = lockFiles.${name};
|
||||
pythonPackages = self;
|
||||
@ -207,12 +205,12 @@ lib.makeScope pkgs.newScope (self: {
|
||||
in
|
||||
{
|
||||
mkPoetryDep = self.callPackage ./mk-poetry-dep.nix {
|
||||
inherit pkgs lib python poetryLib evalPep508;
|
||||
inherit lib python poetryLib evalPep508;
|
||||
};
|
||||
|
||||
# Use poetry-core from the poetry build (pep517/518 build-system)
|
||||
poetry-core = if __isBootstrap then null else poetryPkg.passthru.python.pkgs.poetry-core;
|
||||
poetry = if __isBootstrap then null else poetryPkg;
|
||||
# # Use poetry-core from the poetry build (pep517/518 build-system)
|
||||
poetry-core = poetryPkg.passthru.python.pkgs.poetry-core;
|
||||
poetry = poetryPkg;
|
||||
|
||||
__toPluginAble = toPluginAble self;
|
||||
|
||||
@ -222,10 +220,21 @@ lib.makeScope pkgs.newScope (self: {
|
||||
setuptools-scm = super.setuptools_scm;
|
||||
}
|
||||
)
|
||||
|
||||
# Fix infinite recursion in a lot of packages because of checkInputs
|
||||
(self: super: lib.mapAttrs
|
||||
(name: value: (
|
||||
if lib.isDerivation value && lib.hasAttr "overridePythonAttrs" value
|
||||
then value.overridePythonAttrs (_: { doCheck = false; })
|
||||
else value
|
||||
))
|
||||
super)
|
||||
|
||||
# Null out any filtered packages, we don't want python.pkgs from nixpkgs
|
||||
(self: super: builtins.listToAttrs (builtins.map (x: { name = moduleName x.name; value = null; }) incompatible))
|
||||
# Create poetry2nix layer
|
||||
baseOverlay
|
||||
|
||||
] ++ # User provided overrides
|
||||
(if builtins.typeOf overrides == "list" then overrides else [ overrides ])
|
||||
);
|
||||
@ -318,12 +327,11 @@ lib.makeScope pkgs.newScope (self: {
|
||||
, python ? pkgs.python3
|
||||
, pwd ? projectDir
|
||||
, preferWheels ? false
|
||||
, __isBootstrap ? false # Hack: Always add Poetry as a build input unless bootstrapping
|
||||
, ...
|
||||
}@attrs:
|
||||
let
|
||||
poetryPython = self.mkPoetryPackages {
|
||||
inherit pyproject poetrylock overrides python pwd preferWheels __isBootstrap;
|
||||
inherit pyproject poetrylock overrides python pwd preferWheels;
|
||||
};
|
||||
py = poetryPython.python;
|
||||
|
||||
@ -429,7 +437,7 @@ lib.makeScope pkgs.newScope (self: {
|
||||
|
||||
Can be overriden by calling defaultPoetryOverrides.overrideOverlay which takes an overlay function
|
||||
*/
|
||||
defaultPoetryOverrides = self.mkDefaultPoetryOverrides (import ./overrides.nix { inherit pkgs lib; });
|
||||
defaultPoetryOverrides = self.mkDefaultPoetryOverrides (import ./overrides { inherit pkgs lib; });
|
||||
|
||||
/*
|
||||
Convenience functions for specifying overlays with or without the poerty2nix default overrides
|
||||
|
@ -67,6 +67,13 @@ in
|
||||
{
|
||||
name = "fixup-hook.sh";
|
||||
deps = [ ];
|
||||
substitutions = {
|
||||
inherit pythonSitePackages;
|
||||
filenames = builtins.concatStringsSep " " [
|
||||
"pyproject.toml"
|
||||
"README.md"
|
||||
];
|
||||
};
|
||||
} ./fixup-hook.sh
|
||||
)
|
||||
{ };
|
||||
|
@ -1,8 +1,20 @@
|
||||
poetry2nix-fixup-hook() {
|
||||
|
||||
# Including tests in the output is a common mistake
|
||||
if [ -z "${dontFixupTests-}" ]; then
|
||||
rm -rf $out/lib/python3.7/site-packages/tests
|
||||
rm -rf $out/@pythonSitePackages@/tests
|
||||
fi
|
||||
|
||||
# Including files in site-packages is a common packaging mistake
|
||||
#
|
||||
# While we cannot remove all normal files dumped in site-packages
|
||||
# we can clean up some common mistakes
|
||||
if [ -z "${dontFixupSitePackages-}" ]; then
|
||||
for f in @filenames@; do
|
||||
rm -f $out/@pythonSitePackages@/$f
|
||||
done
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
postFixupHooks+=(poetry2nix-fixup-hook)
|
||||
|
@ -5,14 +5,6 @@ pipBuildPhase() {
|
||||
echo "Executing pipBuildPhase"
|
||||
runHook preBuild
|
||||
|
||||
# Prefer using setup.py to avoid build-system dependencies if we have a setup.py
|
||||
if [ -z "${dontPreferSetupPy-}" ]; then
|
||||
if test -e setup.py && test -e pyproject.toml; then
|
||||
echo "Removing pyproject.toml..."
|
||||
rm -f pyproject.toml
|
||||
fi
|
||||
fi
|
||||
|
||||
mkdir -p dist
|
||||
echo "Creating a wheel..."
|
||||
@pythonInterpreter@ -m pip wheel --verbose --no-index --no-deps --no-clean --no-build-isolation --wheel-dir dist .
|
||||
|
@ -79,6 +79,7 @@ let
|
||||
if lib.strings.hasInfix "manylinux1" f then { pkg = [ ml.manylinux1 ]; str = "1"; }
|
||||
else if lib.strings.hasInfix "manylinux2010" f then { pkg = [ ml.manylinux2010 ]; str = "2010"; }
|
||||
else if lib.strings.hasInfix "manylinux2014" f then { pkg = [ ml.manylinux2014 ]; str = "2014"; }
|
||||
else if lib.strings.hasInfix "manylinux_" f then { pkg = [ ml.manylinux2014 ]; str = "pep600"; }
|
||||
else { pkg = [ ]; str = null; };
|
||||
|
||||
# Predict URL from the PyPI index.
|
||||
@ -110,8 +111,8 @@ let
|
||||
(pkgs.stdenvNoCC.mkDerivation {
|
||||
name = file;
|
||||
nativeBuildInputs = [
|
||||
pkgs.curl
|
||||
pkgs.jq
|
||||
pkgs.buildPackages.curl
|
||||
pkgs.buildPackages.jq
|
||||
];
|
||||
isWheel = lib.strings.hasSuffix "whl" file;
|
||||
system = "builtin";
|
||||
@ -219,7 +220,8 @@ let
|
||||
};
|
||||
|
||||
# Machine tag for our target platform (if available)
|
||||
targetMachine = manyLinuxTargetMachines.${stdenv.targetPlatform.parsed.cpu.name} or null;
|
||||
getTargetMachine = stdenv: manyLinuxTargetMachines.${stdenv.targetPlatform.parsed.cpu.name} or null;
|
||||
|
||||
in
|
||||
{
|
||||
inherit
|
||||
@ -233,6 +235,6 @@ in
|
||||
cleanPythonSources
|
||||
moduleName
|
||||
getPythonVersion
|
||||
targetMachine
|
||||
getTargetMachine
|
||||
;
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
{ autoPatchelfHook
|
||||
, pkgs
|
||||
, lib
|
||||
, python
|
||||
, buildPythonPackage
|
||||
@ -17,7 +16,6 @@
|
||||
, sourceSpec
|
||||
, supportedExtensions ? lib.importJSON ./extensions.json
|
||||
, preferWheels ? false
|
||||
, __isBootstrap ? false # Hack: Always add Poetry as a build input unless bootstrapping
|
||||
, ...
|
||||
}:
|
||||
|
||||
@ -27,12 +25,11 @@ pythonPackages.callPackage
|
||||
, ...
|
||||
}@args:
|
||||
let
|
||||
inherit (pkgs) stdenv;
|
||||
inherit (python) stdenv;
|
||||
inherit (poetryLib) isCompatible getManyLinuxDeps fetchFromLegacy fetchFromPypi moduleName;
|
||||
|
||||
inherit (import ./pep425.nix {
|
||||
inherit lib poetryLib python;
|
||||
inherit (pkgs) stdenv;
|
||||
inherit lib poetryLib python stdenv;
|
||||
}) selectWheel
|
||||
;
|
||||
fileCandidates =
|
||||
@ -97,6 +94,7 @@ pythonPackages.callPackage
|
||||
"setuptools-scm"
|
||||
"toml" # Toml is an extra for setuptools-scm
|
||||
"tomli" # tomli is an extra for later versions of setuptools-scm
|
||||
"flit-core"
|
||||
"packaging"
|
||||
"six"
|
||||
"pyparsing"
|
||||
@ -129,7 +127,6 @@ pythonPackages.callPackage
|
||||
++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) pythonPackages.setuptools
|
||||
++ lib.optional (!isSource) (getManyLinuxDeps fileInfo.name).pkg
|
||||
++ lib.optional isDirectory buildSystemPkgs
|
||||
++ lib.optional (!__isBootstrap) pythonPackages.poetry
|
||||
);
|
||||
|
||||
propagatedBuildInputs =
|
||||
@ -169,11 +166,18 @@ pythonPackages.callPackage
|
||||
src =
|
||||
if isGit then
|
||||
(
|
||||
builtins.fetchGit {
|
||||
builtins.fetchGit ({
|
||||
inherit (source) url;
|
||||
rev = source.resolved_reference or source.reference;
|
||||
ref = sourceSpec.branch or sourceSpec.rev or (if sourceSpec?tag then "refs/tags/${sourceSpec.tag}" else "HEAD");
|
||||
}
|
||||
ref = sourceSpec.branch or (if sourceSpec ? tag then "refs/tags/${sourceSpec.tag}" else "HEAD");
|
||||
} // (
|
||||
let
|
||||
nixVersion = builtins.substring 0 3 builtins.nixVersion;
|
||||
in
|
||||
lib.optionalAttrs ((sourceSpec ? rev) && (lib.versionAtLeast nixVersion "2.4")) {
|
||||
allRefs = true;
|
||||
}
|
||||
))
|
||||
)
|
||||
else if isUrl then
|
||||
builtins.fetchTarball
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
2294
pkgs/development/tools/poetry2nix/poetry2nix/overrides/default.nix
Normal file
2294
pkgs/development/tools/poetry2nix/poetry2nix/overrides/default.nix
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
{ lib, stdenv, poetryLib, python, isLinux ? stdenv.isLinux }:
|
||||
let
|
||||
inherit (lib.strings) hasSuffix hasInfix splitString removeSuffix;
|
||||
inherit (poetryLib) targetMachine;
|
||||
inherit (lib.strings) escapeRegex hasPrefix hasSuffix hasInfix splitString removePrefix removeSuffix;
|
||||
targetMachine = poetryLib.getTargetMachine stdenv;
|
||||
|
||||
# The 'cpxy" as determined by `python.version`
|
||||
#
|
||||
@ -52,10 +52,10 @@ let
|
||||
# x = "cpXX" | "py2" | "py3" | "py2.py3"
|
||||
isPyVersionCompatible = pyver: x:
|
||||
let
|
||||
normalize = y: ''cp${lib.strings.removePrefix "cp" (lib.strings.removePrefix "py" y)}'';
|
||||
isCompat = p: x: lib.strings.hasPrefix (normalize x) p;
|
||||
normalize = y: ''cp${removePrefix "cp" (removePrefix "py" y)}'';
|
||||
isCompat = p: x: hasPrefix (normalize x) p;
|
||||
in
|
||||
lib.lists.any (isCompat pyver) (lib.strings.splitString "." x);
|
||||
lib.lists.any (isCompat pyver) (splitString "." x);
|
||||
|
||||
#
|
||||
# Selects the best matching wheel file from a list of files
|
||||
@ -63,7 +63,7 @@ let
|
||||
selectWheel = files:
|
||||
let
|
||||
filesWithoutSources = (builtins.filter (x: hasSuffix ".whl" x.file) files);
|
||||
isPyAbiCompatible = pyabi: x: x == "none" || lib.hasPrefix pyabi x || lib.hasPrefix x pyabi || (
|
||||
isPyAbiCompatible = pyabi: x: x == "none" || hasPrefix pyabi x || hasPrefix x pyabi || (
|
||||
# The CPython stable ABI is abi3 as in the shared library suffix.
|
||||
python.passthru.implementation == "cpython" &&
|
||||
builtins.elemAt (lib.splitString "." python.version) 0 == "3" &&
|
||||
@ -75,32 +75,30 @@ let
|
||||
then
|
||||
if targetMachine != null
|
||||
then
|
||||
(
|
||||
x: x.platform == "any" || lib.lists.any (e: hasInfix e x.platform) [
|
||||
"manylinux1_${targetMachine}"
|
||||
"manylinux2010_${targetMachine}"
|
||||
"manylinux2014_${targetMachine}"
|
||||
]
|
||||
# See PEP 600 for details.
|
||||
(p:
|
||||
builtins.match "any|manylinux(1|2010|2014)_${escapeRegex targetMachine}|manylinux_[0-9]+_[0-9]+_${escapeRegex targetMachine}" p != null
|
||||
)
|
||||
else
|
||||
(x: x.platform == "any")
|
||||
(p: p == "any")
|
||||
else
|
||||
if stdenv.isDarwin
|
||||
then
|
||||
if stdenv.targetPlatform.isAarch64
|
||||
then (x: x.platform == "any" || (hasInfix "macosx" x.platform && lib.lists.any (e: hasSuffix e x.platform) [ "arm64" "aarch64" ]))
|
||||
else (x: x.platform == "any" || (hasInfix "macosx" x.platform && hasSuffix "x86_64" x.platform))
|
||||
else (x: x.platform == "any");
|
||||
then (p: p == "any" || (hasInfix "macosx" p && lib.lists.any (e: hasSuffix e p) [ "arm64" "aarch64" ]))
|
||||
else (p: p == "any" || (hasInfix "macosx" p && hasSuffix "x86_64" p))
|
||||
else (p: p == "any");
|
||||
withPlatforms = x: lib.lists.any withPlatform (splitString "." x.platform);
|
||||
filterWheel = x:
|
||||
let
|
||||
f = toWheelAttrs x.file;
|
||||
in
|
||||
(withPython pythonTag abiTag f) && (withPlatform f);
|
||||
(withPython pythonTag abiTag f) && (withPlatforms f);
|
||||
filtered = builtins.filter filterWheel filesWithoutSources;
|
||||
choose = files:
|
||||
let
|
||||
osxMatches = [ "12_0" "11_0" "10_12" "10_11" "10_10" "10_9" "10_8" "10_7" "any" ];
|
||||
linuxMatches = [ "manylinux1_" "manylinux2010_" "manylinux2014_" "any" ];
|
||||
linuxMatches = [ "manylinux1_" "manylinux2010_" "manylinux2014_" "manylinux_" "any" ];
|
||||
chooseLinux = x: lib.take 1 (findBestMatches linuxMatches x);
|
||||
chooseOSX = x: lib.take 1 (findBestMatches osxMatches x);
|
||||
in
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user