mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-21 11:34:13 +00:00
Merge staging-next-24.05 into staging-24.05
This commit is contained in:
commit
97abc3ddcd
7
.github/CODEOWNERS
vendored
7
.github/CODEOWNERS
vendored
@ -70,8 +70,11 @@
|
||||
/nixos/lib/make-disk-image.nix @raitobezarius
|
||||
|
||||
# Nix, the package manager
|
||||
pkgs/tools/package-management/nix/ @raitobezarius @ma27
|
||||
nixos/modules/installer/tools/nix-fallback-paths.nix @raitobezarius @ma27
|
||||
# @raitobezarius is not "code owner", but is listed here to be notified of changes
|
||||
# pertaining to the Nix package manager.
|
||||
# i.e. no authority over those files.
|
||||
pkgs/tools/package-management/nix/ @NixOS/nix-team @raitobezarius
|
||||
nixos/modules/installer/tools/nix-fallback-paths.nix @NixOS/nix-team @raitobezarius
|
||||
|
||||
# Nixpkgs documentation
|
||||
/maintainers/scripts/db-to-md.sh @jtojnar @ryantm
|
||||
|
@ -46,6 +46,237 @@ have a predefined type and string generator already declared under
|
||||
`generate` to build a Java `.properties` file, taking
|
||||
care of the correct escaping, etc.
|
||||
|
||||
`pkgs.formats.hocon` { *`generator`* ? `<derivation>`, *`validator`* ? `<derivation>`, *`doCheck`* ? true }
|
||||
|
||||
: A function taking an attribute set with values
|
||||
|
||||
`generator`
|
||||
|
||||
: A derivation used for converting the JSON output
|
||||
from the nix settings into HOCON. This might be
|
||||
useful if your HOCON variant is slightly different
|
||||
from the java-based one, or for testing purposes.
|
||||
|
||||
`validator`
|
||||
|
||||
: A derivation used for verifying that the HOCON
|
||||
output is correct and parsable. This might be
|
||||
useful if your HOCON variant is slightly different
|
||||
from the java-based one, or for testing purposes.
|
||||
|
||||
`doCheck`
|
||||
|
||||
: Whether to enable/disable the validator check.
|
||||
|
||||
It returns an attrset with a `type`, `generate` function,
|
||||
and a `lib` attset, as specified [below](#pkgs-formats-result).
|
||||
Some of the lib functions will be best understood if you have
|
||||
read the reference specification. You can find this
|
||||
specification here:
|
||||
|
||||
<https://github.com/lightbend/config/blob/main/HOCON.md>
|
||||
|
||||
Inside of `lib`, you will find these functions
|
||||
|
||||
`mkInclude`
|
||||
|
||||
: This is used together with a specially named
|
||||
attribute `includes`, to include other HOCON
|
||||
sources into the document.
|
||||
|
||||
The function has a shorthand variant where it
|
||||
is up to the HOCON parser to figure out what type
|
||||
of include is being used. The include will default
|
||||
to being non-required. If you want to be more
|
||||
explicit about the details of the include, you can
|
||||
provide an attrset with following arguments
|
||||
|
||||
`required`
|
||||
|
||||
: Whether the parser should fail upon failure
|
||||
to include the document
|
||||
|
||||
`type`
|
||||
|
||||
: Type of the source of the included document.
|
||||
Valid values are `file`, `url` and `classpath`.
|
||||
See upstream documentation for the semantics
|
||||
behind each value
|
||||
|
||||
`value`
|
||||
|
||||
: The URI/path/classpath pointing to the source of
|
||||
the document to be included.
|
||||
|
||||
`Example usage:`
|
||||
|
||||
```nix
|
||||
let
|
||||
format = pkgs.formats.hocon { };
|
||||
hocon_file = pkgs.writeText "to_include.hocon" ''
|
||||
a = 1;
|
||||
'';
|
||||
in {
|
||||
some.nested.hocon.attrset = {
|
||||
_includes = [
|
||||
(format.lib.mkInclude hocon_file)
|
||||
(format.lib.mkInclude "https://example.com/to_include.hocon")
|
||||
(format.lib.mkInclude {
|
||||
required = true;
|
||||
type = "file";
|
||||
value = include_file;
|
||||
})
|
||||
];
|
||||
...
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
`mkAppend`
|
||||
|
||||
: This is used to invoke the `+=` operator.
|
||||
This can be useful if you need to add something
|
||||
to a list that is included from outside of nix.
|
||||
See upstream documentation for the semantics
|
||||
behind the `+=` operation.
|
||||
|
||||
`Example usage:`
|
||||
|
||||
```nix
|
||||
let
|
||||
format = pkgs.formats.hocon { };
|
||||
hocon_file = pkgs.writeText "to_include.hocon" ''
|
||||
a = [ 1 ];
|
||||
b = [ 2 ];
|
||||
'';
|
||||
in {
|
||||
_includes = [
|
||||
(format.lib.mkInclude hocon_file)
|
||||
];
|
||||
|
||||
c = 3;
|
||||
a = format.lib.mkAppend 3;
|
||||
b = format.lib.mkAppend (format.lib.mkSubstitution "c");
|
||||
}
|
||||
```
|
||||
|
||||
`mkSubstitution`
|
||||
|
||||
: This is used to make HOCON substitutions.
|
||||
Similarly to `mkInclude`, this function has
|
||||
a shorthand variant where you just give it
|
||||
the string with the substitution value.
|
||||
The substitution is not optional by default.
|
||||
Alternatively, you can provide an attrset
|
||||
with more options
|
||||
|
||||
`optional`
|
||||
|
||||
: Whether the parser should fail upon
|
||||
failure to fetch the substitution value.
|
||||
|
||||
`value`
|
||||
|
||||
: The name of the variable to use for
|
||||
substitution.
|
||||
|
||||
See upstream documentation for semantics
|
||||
behind the substitution functionality.
|
||||
|
||||
`Example usage:`
|
||||
|
||||
```nix
|
||||
let
|
||||
format = pkgs.formats.hocon { };
|
||||
in {
|
||||
a = 1;
|
||||
b = format.lib.mkSubstitution "a";
|
||||
c = format.lib.mkSubstition "SOME_ENVVAR";
|
||||
d = format.lib.mkSubstition {
|
||||
value = "SOME_OPTIONAL_ENVVAR";
|
||||
optional = true;
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
`Implementation notes:`
|
||||
|
||||
- classpath includes are not implemented in pyhocon,
|
||||
which is used for validating the HOCON output. This
|
||||
means that if you are using classpath includes,
|
||||
you will want to either use an alternative validator
|
||||
or set `doCheck = false` in the format options.
|
||||
|
||||
`pkgs.formats.libconfig` { *`generator`* ? `<derivation>`, *`validator`* ? `<derivation>` }
|
||||
|
||||
: A function taking an attribute set with values
|
||||
|
||||
`generator`
|
||||
|
||||
: A derivation used for converting the JSON output
|
||||
from the nix settings into libconfig. This might be
|
||||
useful if your libconfig variant is slightly different
|
||||
from the original one, or for testing purposes.
|
||||
|
||||
`validator`
|
||||
|
||||
: A derivation used for verifying that the libconfig
|
||||
output is correct and parsable. This might be
|
||||
useful if your libconfig variant is slightly different
|
||||
from the original one, or for testing purposes.
|
||||
|
||||
It returns an attrset with a `type`, `generate` function,
|
||||
and a `lib` attset, as specified [below](#pkgs-formats-result).
|
||||
Some of the lib functions will be best understood if you have
|
||||
read the reference specification. You can find this
|
||||
specification here:
|
||||
|
||||
<https://hyperrealm.github.io/libconfig/libconfig_manual.html#Configuration-Files>
|
||||
|
||||
Inside of `lib`, you will find these functions
|
||||
|
||||
`mkHex`, `mkOctal`, `mkFloat`
|
||||
|
||||
: Use these to specify numbers in other formats.
|
||||
|
||||
`Example usage:`
|
||||
|
||||
```nix
|
||||
let
|
||||
format = pkgs.formats.libconfig { };
|
||||
in {
|
||||
myHexValue = format.lib.mkHex "0x1FC3";
|
||||
myOctalValue = format.lib.mkOctal "0027";
|
||||
myFloatValue = format.lib.mkFloat "1.2E-3";
|
||||
}
|
||||
```
|
||||
|
||||
`mkArray`, `mkList`
|
||||
|
||||
: Use these to differentiate between whether
|
||||
a nix list should be considered as a libconfig
|
||||
array or a libconfig list. See the upstream
|
||||
documentation for the semantics behind these types.
|
||||
|
||||
`Example usage:`
|
||||
|
||||
```nix
|
||||
let
|
||||
format = pkgs.formats.libconfig { };
|
||||
in {
|
||||
myList = format.lib.mkList [ "foo" 1 true ];
|
||||
myArray = format.lib.mkArray [ 1 2 3 ];
|
||||
}
|
||||
```
|
||||
|
||||
`Implementation notes:`
|
||||
|
||||
- Since libconfig does not allow setting names to start with an underscore,
|
||||
this is used as a prefix for both special types and include directives.
|
||||
|
||||
- The difference between 32bit and 64bit values became optional in libconfig
|
||||
1.5, so we assume 64bit values for all numbers.
|
||||
|
||||
`pkgs.formats.json` { }
|
||||
|
||||
: A function taking an empty attribute set (for future extensibility)
|
||||
|
@ -3,7 +3,7 @@
|
||||
let
|
||||
inherit (lib) concatStrings foldl foldl' genAttrs literalExpression maintainers
|
||||
mapAttrs mapAttrsToList mkDefault mkEnableOption mkIf mkMerge mkOption
|
||||
optional types mkOptionDefault flip attrNames;
|
||||
optional types mkOptionDefault flip attrNames xor;
|
||||
|
||||
cfg = config.services.prometheus.exporters;
|
||||
|
||||
@ -230,6 +230,7 @@ let
|
||||
in
|
||||
mkIf conf.enable {
|
||||
warnings = conf.warnings or [];
|
||||
assertions = conf.assertions or [];
|
||||
users.users."${name}-exporter" = (mkIf (conf.user == "${name}-exporter" && !enableDynamicUser) {
|
||||
description = "Prometheus ${name} exporter service user";
|
||||
isSystemUser = true;
|
||||
@ -363,13 +364,6 @@ in
|
||||
Please specify either 'services.prometheus.exporters.nextcloud.passwordFile' or
|
||||
'services.prometheus.exporters.nextcloud.tokenFile'
|
||||
'';
|
||||
} {
|
||||
assertion = cfg.pgbouncer.enable -> (
|
||||
(cfg.pgbouncer.connectionStringFile != null || cfg.pgbouncer.connectionString != "")
|
||||
);
|
||||
message = ''
|
||||
PgBouncer exporter needs either connectionStringFile or connectionString configured"
|
||||
'';
|
||||
} {
|
||||
assertion = cfg.pgbouncer.enable -> (
|
||||
config.services.pgbouncer.ignoreStartupParameters != null && builtins.match ".*extra_float_digits.*" config.services.pgbouncer.ignoreStartupParameters != null
|
||||
@ -413,7 +407,15 @@ in
|
||||
Please ensure you have either `services.prometheus.exporters.idrac.configuration'
|
||||
or `services.prometheus.exporters.idrac.configurationPath' set!
|
||||
'';
|
||||
} ] ++ (flip map (attrNames exporterOpts) (exporter: {
|
||||
} {
|
||||
assertion = cfg.pgbouncer.enable -> (
|
||||
xor (cfg.pgbouncer.connectionEnvFile == null) (cfg.pgbouncer.connectionString == null)
|
||||
);
|
||||
message = ''
|
||||
Options `services.prometheus.exporters.pgbouncer.connectionEnvFile` and
|
||||
`services.prometheus.exporters.pgbouncer.connectionString` are mutually exclusive!
|
||||
'';
|
||||
}] ++ (flip map (attrNames exporterOpts) (exporter: {
|
||||
assertion = cfg.${exporter}.firewallFilter != null -> cfg.${exporter}.openFirewall;
|
||||
message = ''
|
||||
The `firewallFilter'-option of exporter ${exporter} doesn't have any effect unless
|
||||
@ -427,11 +429,6 @@ in
|
||||
Consider using `services.prometheus.exporters.idrac.configuration` instead.
|
||||
''
|
||||
)
|
||||
(mkIf
|
||||
(cfg.pgbouncer.enable && cfg.pgbouncer.connectionString != "") ''
|
||||
config.services.prometheus.exporters.pgbouncer.connectionString is insecure. Use connectionStringFile instead.
|
||||
''
|
||||
)
|
||||
(mkIf
|
||||
(cfg.pgbouncer.enable && config.services.pgbouncer.authType != "any") ''
|
||||
Admin user (with password or passwordless) MUST exist in the services.pgbouncer.authFile if authType other than any is used.
|
||||
|
@ -6,6 +6,7 @@ let
|
||||
mkOption
|
||||
types
|
||||
optionals
|
||||
getExe
|
||||
escapeShellArg
|
||||
concatStringsSep
|
||||
;
|
||||
@ -23,8 +24,8 @@ in
|
||||
};
|
||||
|
||||
connectionString = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
example = "postgres://admin:@localhost:6432/pgbouncer?sslmode=require";
|
||||
description = ''
|
||||
Connection string for accessing pgBouncer.
|
||||
@ -35,24 +36,28 @@ in
|
||||
in the services.pgbouncer.authFile if authType other than any is used.
|
||||
|
||||
WARNING: this secret is stored in the world-readable Nix store!
|
||||
Use {option}`connectionStringFile` instead.
|
||||
Use [](#opt-services.prometheus.exporters.pgbouncer.connectionEnvFile) if the
|
||||
URL contains a secret.
|
||||
'';
|
||||
};
|
||||
|
||||
connectionStringFile = mkOption {
|
||||
type = types.nullOr types.path;
|
||||
connectionEnvFile = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
example = "/run/keys/pgBouncer-connection-string";
|
||||
description = ''
|
||||
File that contains pgBouncer connection string in format:
|
||||
postgres://admin:@localhost:6432/pgbouncer?sslmode=require
|
||||
File that must contain the environment variable
|
||||
`PGBOUNCER_EXPORTER_CONNECTION_STRING` which is set to the connection
|
||||
string used by pgbouncer. I.e. the format is supposed to look like this:
|
||||
|
||||
NOTE: You MUST keep pgbouncer as database name (special internal db)!!!
|
||||
```
|
||||
PGBOUNCER_EXPORTER_CONNECTION_STRING="postgres://admin@localhost:6432/pgbouncer?sslmode=require"
|
||||
```
|
||||
|
||||
NOTE: Admin user (with password or passwordless) MUST exist
|
||||
in the services.pgbouncer.authFile if authType other than any is used.
|
||||
NOTE: You MUST keep pgbouncer as database name (special internal db)!
|
||||
NOTE: `services.pgbouncer.settings.pgbouncer.ignore_startup_parameters`
|
||||
MUST contain "extra_float_digits".
|
||||
|
||||
{option}`connectionStringFile` takes precedence over {option}`connectionString`
|
||||
Mutually exclusive with [](#opt-services.prometheus.exporters.pgbouncer.connectionString).
|
||||
'';
|
||||
};
|
||||
|
||||
@ -120,10 +125,9 @@ in
|
||||
startScript = pkgs.writeShellScriptBin "pgbouncer-start" "${concatStringsSep " " ([
|
||||
"${pkgs.prometheus-pgbouncer-exporter}/bin/pgbouncer_exporter"
|
||||
"--web.listen-address ${cfg.listenAddress}:${toString cfg.port}"
|
||||
"--pgBouncer.connectionString ${if cfg.connectionStringFile != null then
|
||||
"$(head -n1 ${cfg.connectionStringFile})" else "${escapeShellArg cfg.connectionString}"}"
|
||||
]
|
||||
++ optionals (cfg.telemetryPath != null) [
|
||||
] ++ optionals (cfg.connectionString != null) [
|
||||
"--pgBouncer.connectionString ${escapeShellArg cfg.connectionString}"
|
||||
] ++ optionals (cfg.telemetryPath != null) [
|
||||
"--web.telemetry-path ${escapeShellArg cfg.telemetryPath}"
|
||||
]
|
||||
++ optionals (cfg.pidFile != null) [
|
||||
@ -145,6 +149,22 @@ in
|
||||
in
|
||||
{
|
||||
ExecStart = "${startScript}/bin/pgbouncer-start";
|
||||
EnvironmentFile = lib.mkIf (cfg.connectionEnvFile != null) [
|
||||
cfg.connectionEnvFile
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
(lib.mkRemovedOptionModule [ "connectionStringFile" ] ''
|
||||
As replacement, the option `services.prometheus.exporters.pgbouncer.connectionEnvFile`
|
||||
has been added. In contrast to `connectionStringFile` it must be an environment file
|
||||
with the connection string being set to `PGBOUNCER_EXPORTER_CONNECTION_STRING`.
|
||||
|
||||
The change was necessary since the former option wrote the contents of the file
|
||||
into the cmdline of the exporter making the connection string effectively
|
||||
world-readable.
|
||||
'')
|
||||
({ options.warnings = options.warnings; options.assertions = options.assertions; })
|
||||
];
|
||||
}
|
||||
|
@ -12,8 +12,9 @@ let
|
||||
# If the attribute is not named 'test'
|
||||
# You will break all the universe on the release-*.nix side of things.
|
||||
# `discoverTests` relies on `test` existence to perform a `callTest`.
|
||||
test = testMiscFeatures args;
|
||||
passthru.override = args': testsForPackage (args // args');
|
||||
test = testMiscFeatures args // {
|
||||
passthru.override = args': testsForPackage (args // args');
|
||||
};
|
||||
};
|
||||
|
||||
testMiscFeatures = { nixPackage, ... }: pkgs.testers.nixosTest (
|
||||
|
@ -435,7 +435,6 @@ let
|
||||
json = {
|
||||
exporterConfig = {
|
||||
enable = true;
|
||||
url = "http://localhost";
|
||||
configFile = pkgs.writeText "json-exporter-conf.json" (builtins.toJSON {
|
||||
modules = {
|
||||
default = {
|
||||
@ -948,7 +947,9 @@ let
|
||||
pgbouncer = {
|
||||
exporterConfig = {
|
||||
enable = true;
|
||||
connectionStringFile = pkgs.writeText "connection.conf" "postgres://admin:@localhost:6432/pgbouncer?sslmode=disable";
|
||||
connectionEnvFile = "${pkgs.writeText "connstr-env" ''
|
||||
PGBOUNCER_EXPORTER_CONNECTION_STRING=postgres://admin@localhost:6432/pgbouncer?sslmode=disable
|
||||
''}";
|
||||
};
|
||||
|
||||
metricProvider = {
|
||||
|
@ -213,8 +213,8 @@ in {
|
||||
enableSystemdStage1 = true;
|
||||
};
|
||||
|
||||
installerBoot = (import ./installer.nix { }).separateBootZfs;
|
||||
installer = (import ./installer.nix { }).zfsroot;
|
||||
installerBoot = (import ./installer.nix { inherit system; }).separateBootZfs;
|
||||
installer = (import ./installer.nix { inherit system; }).zfsroot;
|
||||
|
||||
expand-partitions = makeTest {
|
||||
name = "multi-disk-zfs";
|
||||
|
@ -45,8 +45,8 @@ let
|
||||
}
|
||||
else
|
||||
{
|
||||
version = "2024.2";
|
||||
hash = "sha256-gCp+M18uiVdw9XsVnk7DaOuw/yzm2sz3BsboAlw2hSs=";
|
||||
version = "2024.3";
|
||||
hash = "sha256-u9oFbuWTkL59WNhME6nsDU42NWF63y63RwNJIsuh8Ck=";
|
||||
};
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
|
@ -693,7 +693,7 @@ stdenvNoCC.mkDerivation {
|
||||
''
|
||||
|
||||
+ optionalString targetPlatform.isAndroid ''
|
||||
echo "-D__ANDROID_API__=${targetPlatform.sdkVer}" >> $out/nix-support/cc-cflags
|
||||
echo "-D__ANDROID_API__=${targetPlatform.androidSdkVersion}" >> $out/nix-support/cc-cflags
|
||||
''
|
||||
|
||||
# There are a few tools (to name one libstdcxx5) which do not work
|
||||
|
@ -11,13 +11,13 @@
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "openasar";
|
||||
version = "0-unstable-2024-01-13";
|
||||
version = "0-unstable-2024-09-06";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "GooseMod";
|
||||
repo = "OpenAsar";
|
||||
rev = "4f264d860a5a6a32e1862ce26178b9cf6402335d";
|
||||
hash = "sha256-NPUUDqntsMxnT/RN5M9DtLDwJXDyjOED4GlXa1oU8l8=";
|
||||
rev = "f92ee8c3dc6b6ff9829f69a1339e0f82a877929c";
|
||||
hash = "sha256-V2oZ0mQbX+DHDZfTj8sV4XS6r9NOmJYHvYOGK6X/+HU=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
|
@ -2,16 +2,16 @@
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "flyctl";
|
||||
version = "0.2.124";
|
||||
version = "0.2.125";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "superfly";
|
||||
repo = "flyctl";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-l+rq3L4JQcc8mXbBukAOTtoX0Z7fudYxAIPnPFvupjQ=";
|
||||
hash = "sha256-7jMti/NShvo6T3JLzRM9FKqRXkgS8jeUitZq5SU4sHE=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-rFFaRtEXc+rCCxUckrnFq79zIXg2XETa+hPZo1usBrc=";
|
||||
vendorHash = "sha256-uYGOXXeNfe2rYtJh2ggNv2TbVJul4RbiBQ1KSbEjqW8=";
|
||||
|
||||
subPackages = [ "." ];
|
||||
|
||||
|
@ -1,9 +1,20 @@
|
||||
{ stdenv, lib, python2, python3, kernel, makeWrapper, writeText
|
||||
, gawk, iproute2 }:
|
||||
{
|
||||
stdenv,
|
||||
lib,
|
||||
python2,
|
||||
python3,
|
||||
kernel,
|
||||
makeWrapper,
|
||||
writeText,
|
||||
gawk,
|
||||
iproute2,
|
||||
}:
|
||||
|
||||
let
|
||||
libexec = "libexec/hypervkvpd";
|
||||
|
||||
fcopy_name = (if lib.versionOlder kernel.version "6.10" then "fcopy" else "fcopy_uio");
|
||||
|
||||
daemons = stdenv.mkDerivation rec {
|
||||
pname = "hyperv-daemons-bin";
|
||||
inherit (kernel) src version;
|
||||
@ -26,7 +37,7 @@ let
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
for f in fcopy kvp vss ; do
|
||||
for f in ${fcopy_name} kvp vss ; do
|
||||
install -Dm755 hv_''${f}_daemon -t $out/bin
|
||||
done
|
||||
|
||||
@ -39,11 +50,17 @@ let
|
||||
|
||||
postFixup = ''
|
||||
wrapProgram $out/bin/hv_kvp_daemon \
|
||||
--prefix PATH : $out/bin:${lib.makeBinPath [ gawk iproute2 ]}
|
||||
--prefix PATH : $out/bin:${
|
||||
lib.makeBinPath [
|
||||
gawk
|
||||
iproute2
|
||||
]
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
service = bin: title: check:
|
||||
service =
|
||||
bin: title: check:
|
||||
writeText "hv-${bin}.service" ''
|
||||
[Unit]
|
||||
Description=Hyper-V ${title} daemon
|
||||
@ -61,21 +78,30 @@ let
|
||||
WantedBy=hyperv-daemons.target
|
||||
'';
|
||||
|
||||
in stdenv.mkDerivation {
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
pname = "hyperv-daemons";
|
||||
inherit (kernel) version;
|
||||
|
||||
# we just stick the bins into out as well as it requires "out"
|
||||
outputs = [ "bin" "lib" "out" ];
|
||||
outputs = [
|
||||
"bin"
|
||||
"lib"
|
||||
"out"
|
||||
];
|
||||
|
||||
buildInputs = [ daemons ];
|
||||
|
||||
buildCommand = ''
|
||||
system=$lib/lib/systemd/system
|
||||
|
||||
install -Dm444 ${service "fcopy" "file copy (FCOPY)" "hv_fcopy" } $system/hv-fcopy.service
|
||||
install -Dm444 ${service "kvp" "key-value pair (KVP)" "hv_kvp" } $system/hv-kvp.service
|
||||
install -Dm444 ${service "vss" "volume shadow copy (VSS)" "hv_vss" } $system/hv-vss.service
|
||||
install -Dm444 ${
|
||||
service "${
|
||||
fcopy_name
|
||||
}" "file copy (FCOPY)" "/sys/bus/vmbus/devices/eb765408-105f-49b6-b4aa-c123b64d17d4/uio"
|
||||
} $system/hv-fcopy.service
|
||||
install -Dm444 ${service "kvp" "key-value pair (KVP)" "hv_kvp"} $system/hv-kvp.service
|
||||
install -Dm444 ${service "vss" "volume shadow copy (VSS)" "hv_vss"} $system/hv-vss.service
|
||||
|
||||
cat > $system/hyperv-daemons.target <<EOF
|
||||
[Unit]
|
||||
|
@ -2,13 +2,13 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "microcode-intel";
|
||||
version = "20240813";
|
||||
version = "20240910";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "intel";
|
||||
repo = "Intel-Linux-Processor-Microcode-Data-Files";
|
||||
rev = "microcode-${version}";
|
||||
hash = "sha256-O2UWa04MnU9ndzvWy8fruOTm85PexEd+i1McQNz6uFE=";
|
||||
hash = "sha256-cn0qK81dwbamh5PBlPuC9KtDWyT2NwSxDD0XlCRAv6s=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ iucode-tool libarchive ];
|
||||
|
@ -1,7 +1,6 @@
|
||||
{ callPackage
|
||||
, kernel ? null
|
||||
, stdenv
|
||||
, linuxKernel
|
||||
, lib
|
||||
, nixosTests
|
||||
, ...
|
||||
@ -15,9 +14,7 @@ callPackage ./generic.nix args {
|
||||
# this attribute is the correct one for this package.
|
||||
kernelModuleAttribute = "zfs_2_1";
|
||||
# check the release notes for compatible kernels
|
||||
kernelCompatible = kernel.kernelOlder "6.8";
|
||||
|
||||
latestCompatibleLinuxPackages = linuxKernel.packages.linux_6_6;
|
||||
kernelCompatible = kernel: kernel.kernelOlder "6.8";
|
||||
|
||||
# This is a fixed version to the 2.1.x series, move only
|
||||
# if the 2.1.x series moves.
|
||||
|
@ -2,7 +2,6 @@
|
||||
, kernel ? null
|
||||
, stdenv
|
||||
, lib
|
||||
, linuxKernel
|
||||
, nixosTests
|
||||
, ...
|
||||
} @ args:
|
||||
@ -15,12 +14,10 @@ callPackage ./generic.nix args {
|
||||
# this attribute is the correct one for this package.
|
||||
kernelModuleAttribute = "zfs_2_2";
|
||||
# check the release notes for compatible kernels
|
||||
kernelCompatible = kernel.kernelOlder "6.10";
|
||||
|
||||
latestCompatibleLinuxPackages = linuxKernel.packages.linux_6_6;
|
||||
kernelCompatible = kernel: kernel.kernelOlder "6.11";
|
||||
|
||||
# this package should point to the latest release.
|
||||
version = "2.2.5";
|
||||
version = "2.2.6";
|
||||
|
||||
tests = [
|
||||
nixosTests.zfs.installer
|
||||
@ -29,5 +26,5 @@ callPackage ./generic.nix args {
|
||||
|
||||
maintainers = with lib.maintainers; [ adamcstephens amarshall ];
|
||||
|
||||
hash = "sha256-BkwcNPk+jX8CXp5xEVrg4THof7o/5j8RY2SY6+IPNTg=";
|
||||
hash = "sha256-wkgoYg6uQOHVq8a9sJXzO/QXJ6q28l7JXWkC+BFvOb0=";
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ let
|
||||
genericBuild =
|
||||
{ pkgs, lib, stdenv, fetchFromGitHub, fetchpatch
|
||||
, autoreconfHook269, util-linux, nukeReferences, coreutils
|
||||
, linuxKernel
|
||||
, perl
|
||||
, configFile ? "all"
|
||||
|
||||
@ -27,8 +28,6 @@ let
|
||||
, kernelModuleAttribute
|
||||
, extraPatches ? []
|
||||
, rev ? "zfs-${version}"
|
||||
, isUnstable ? false
|
||||
, latestCompatibleLinuxPackages
|
||||
, kernelCompatible ? null
|
||||
, maintainers ? (with lib.maintainers; [ amarshall ])
|
||||
, tests
|
||||
@ -183,9 +182,11 @@ let
|
||||
# Remove tests because they add a runtime dependency on gcc
|
||||
rm -rf $out/share/zfs/zfs-tests
|
||||
|
||||
# Add Bash completions.
|
||||
install -v -m444 -D -t $out/share/bash-completion/completions contrib/bash_completion.d/zfs
|
||||
(cd $out/share/bash-completion/completions; ln -s zfs zpool)
|
||||
${optionalString (lib.versionOlder version "2.2") ''
|
||||
# Add Bash completions.
|
||||
install -v -m444 -D -t $out/share/bash-completion/completions contrib/bash_completion.d/zfs
|
||||
(cd $out/share/bash-completion/completions; ln -s zfs zpool)
|
||||
''}
|
||||
'';
|
||||
|
||||
postFixup = let
|
||||
@ -199,7 +200,13 @@ let
|
||||
outputs = [ "out" ] ++ optionals buildUser [ "dev" ];
|
||||
|
||||
passthru = {
|
||||
inherit enableMail latestCompatibleLinuxPackages kernelModuleAttribute;
|
||||
inherit enableMail kernelModuleAttribute;
|
||||
latestCompatibleLinuxPackages = lib.pipe linuxKernel.packages [
|
||||
builtins.attrValues
|
||||
(builtins.filter (kPkgs: (builtins.tryEval kPkgs).success && kPkgs ? kernel && kPkgs.kernel.pname == "linux" && kernelCompatible kPkgs.kernel))
|
||||
(builtins.sort (a: b: (lib.versionOlder a.kernel.version b.kernel.version)))
|
||||
lib.last
|
||||
];
|
||||
# The corresponding userspace tools to this instantiation
|
||||
# of the ZFS package set.
|
||||
userspaceTools = genericBuild (outerArgs // {
|
||||
@ -236,7 +243,7 @@ let
|
||||
mainProgram = "zfs";
|
||||
# If your Linux kernel version is not yet supported by zfs, try zfs_unstable.
|
||||
# On NixOS set the option `boot.zfs.package = pkgs.zfs_unstable`.
|
||||
broken = buildKernel && (kernelCompatible != null) && !kernelCompatible;
|
||||
broken = buildKernel && (kernelCompatible != null) && !(kernelCompatible kernel);
|
||||
};
|
||||
};
|
||||
in
|
||||
|
@ -1,7 +1,6 @@
|
||||
{ callPackage
|
||||
, kernel ? null
|
||||
, stdenv
|
||||
, linuxKernel
|
||||
, nixosTests
|
||||
, ...
|
||||
} @ args:
|
||||
@ -14,21 +13,18 @@ callPackage ./generic.nix args {
|
||||
# this attribute is the correct one for this package.
|
||||
kernelModuleAttribute = "zfs_unstable";
|
||||
# check the release notes for compatible kernels
|
||||
kernelCompatible = kernel.kernelOlder "6.11";
|
||||
|
||||
latestCompatibleLinuxPackages = linuxKernel.packages.linux_6_10;
|
||||
kernelCompatible = kernel: kernel.kernelOlder "6.11";
|
||||
|
||||
# this package should point to a version / git revision compatible with the latest kernel release
|
||||
# IMPORTANT: Always use a tagged release candidate or commits from the
|
||||
# zfs-<version>-staging branch, because this is tested by the OpenZFS
|
||||
# maintainers.
|
||||
version = "2.2.5";
|
||||
version = "2.2.6";
|
||||
# rev = "";
|
||||
|
||||
isUnstable = true;
|
||||
tests = [
|
||||
nixosTests.zfs.unstable
|
||||
];
|
||||
|
||||
hash = "sha256-BkwcNPk+jX8CXp5xEVrg4THof7o/5j8RY2SY6+IPNTg=";
|
||||
hash = "sha256-wkgoYg6uQOHVq8a9sJXzO/QXJ6q28l7JXWkC+BFvOb0=";
|
||||
}
|
||||
|
@ -27,13 +27,9 @@ let
|
||||
'';
|
||||
in
|
||||
{
|
||||
# https://github.com/lightbend/config/blob/main/HOCON.md
|
||||
format = {
|
||||
generator ? hocon-generator
|
||||
, validator ? hocon-validator
|
||||
# `include classpath("")` is not implemented in pyhocon.
|
||||
# In the case that you need this functionality,
|
||||
# you will have to disable pyhocon validation.
|
||||
, doCheck ? true
|
||||
}: let
|
||||
hoconLib = {
|
||||
|
@ -3,14 +3,6 @@
|
||||
}:
|
||||
let
|
||||
inherit (pkgs) buildPackages callPackage;
|
||||
# Implementation notes:
|
||||
# Libconfig spec: https://hyperrealm.github.io/libconfig/libconfig_manual.html
|
||||
#
|
||||
# Since libconfig does not allow setting names to start with an underscore,
|
||||
# this is used as a prefix for both special types and include directives.
|
||||
#
|
||||
# The difference between 32bit and 64bit values became optional in libconfig
|
||||
# 1.5, so we assume 64bit values for all numbers.
|
||||
|
||||
libconfig-generator = buildPackages.rustPlatform.buildRustPackage {
|
||||
name = "libconfig-generator";
|
||||
|
@ -2,16 +2,16 @@
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "pgbouncer-exporter";
|
||||
version = "0.8.0";
|
||||
version = "0.9.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "prometheus-community";
|
||||
repo = "pgbouncer_exporter";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-QnA9H4qedCPZKqJQ1I2OJO42mCWcWqYxLmeF3+JXzTw=";
|
||||
hash = "sha256-fKoyRHYLwVefsZ014eazVCD5B9eV8/CUkuHE4mbUqVo=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-NYiVW+CNrxFrEUl1nsTeNNgy7SmTYgqs1d50rCvyBcw=";
|
||||
vendorHash = "sha256-IxmxfF9WsF0Hbym4G0UecyW8hAvucoaCFUE1kXUljJs=";
|
||||
|
||||
meta = with lib; {
|
||||
description = "Prometheus exporter for PgBouncer";
|
||||
|
@ -11,13 +11,13 @@
|
||||
}:
|
||||
|
||||
let
|
||||
version = "1.9.9";
|
||||
version = "1.10.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "hedgedoc";
|
||||
repo = "hedgedoc";
|
||||
rev = version;
|
||||
hash = "sha256-6eKTgEZ+YLoSmPQWBS95fJ+ioIxeTVlT+moqslByPPw=";
|
||||
hash = "sha256-cRIpcoD9WzLYxKYpkvhRxUmeyJR5z2QyqApzWvQND+s=";
|
||||
};
|
||||
|
||||
# we cannot use fetchYarnDeps because that doesn't support yarn 2/berry lockfiles
|
||||
@ -42,7 +42,7 @@ let
|
||||
'';
|
||||
|
||||
outputHashMode = "recursive";
|
||||
outputHash = "sha256-Ga+tl4oZlum43tdfez1oWGMHZAfyePGl47S+9NRRvW8=";
|
||||
outputHash = "sha256-RV9xzNVE4//tPVWVaET78ML3ah+hkZ8x6mTAxe5/pdE=";
|
||||
};
|
||||
|
||||
in stdenv.mkDerivation {
|
||||
@ -51,12 +51,12 @@ in stdenv.mkDerivation {
|
||||
|
||||
nativeBuildInputs = [
|
||||
makeBinaryWrapper
|
||||
(python3.withPackages (ps: with ps; [ setuptools ])) # required to build sqlite3 bindings
|
||||
yarn
|
||||
python3 # needed for sqlite node-gyp
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
nodejs
|
||||
nodejs # for shebangs
|
||||
];
|
||||
|
||||
dontConfigure = true;
|
||||
@ -67,15 +67,8 @@ in stdenv.mkDerivation {
|
||||
export HOME=$(mktemp -d)
|
||||
yarn config set enableTelemetry 0
|
||||
yarn config set cacheFolder ${offlineCache}
|
||||
export npm_config_nodedir=${nodejs} # prevent node-gyp from downloading headers
|
||||
|
||||
# This will fail but create the sqlite3 files we can patch
|
||||
yarn --immutable-cache || :
|
||||
|
||||
# Ensure we don't download any node things
|
||||
sed -i 's:--fallback-to-build:--build-from-source --nodedir=${nodejs}/include/node:g' node_modules/sqlite3/package.json
|
||||
export CPPFLAGS="-I${nodejs}/include/node"
|
||||
|
||||
# Perform the actual install
|
||||
yarn --immutable-cache
|
||||
yarn run build
|
||||
|
||||
|
@ -6,16 +6,16 @@
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "nebula";
|
||||
version = "1.9.3";
|
||||
version = "1.9.4";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "slackhq";
|
||||
repo = pname;
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-+RferzOPlx7UuqpckQBY/RDO9gptknhuan+Es0Vf/yM=";
|
||||
hash = "sha256-Y8BTbvdSJ+xlxHuy0TzQEGiymJzAqlHe3PiXAlUddPs=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-4BnFvA0dxsEK7ictDUZ6nol6PtM54kk9dwKPTQbRUR0=";
|
||||
vendorHash = "sha256-oXhq+s5gDKPVClZpOzYi7BaYwcDqbCLBEO5BNGy9LJA=";
|
||||
|
||||
subPackages = [ "cmd/nebula" "cmd/nebula-cert" ];
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
inherit hash;
|
||||
},
|
||||
docCargoHash ? null,
|
||||
docCargoLock ? null,
|
||||
patches ? [ ],
|
||||
maintainers ? lib.teams.lix.members,
|
||||
}@args:
|
||||
@ -18,7 +19,6 @@ assert (hash == null) -> (src != null);
|
||||
{
|
||||
stdenv,
|
||||
meson,
|
||||
bash,
|
||||
bison,
|
||||
boehmgc,
|
||||
boost,
|
||||
@ -26,29 +26,20 @@ assert (hash == null) -> (src != null);
|
||||
busybox-sandbox-shell,
|
||||
bzip2,
|
||||
callPackage,
|
||||
coreutils,
|
||||
curl,
|
||||
cmake,
|
||||
docbook_xsl_ns,
|
||||
docbook5,
|
||||
doxygen,
|
||||
editline,
|
||||
flex,
|
||||
git,
|
||||
gnutar,
|
||||
gtest,
|
||||
gzip,
|
||||
jq,
|
||||
lib,
|
||||
libarchive,
|
||||
libcpuid,
|
||||
libgit2,
|
||||
libsodium,
|
||||
libxml2,
|
||||
libxslt,
|
||||
lowdown,
|
||||
lsof,
|
||||
man,
|
||||
mercurial,
|
||||
mdbook,
|
||||
mdbook-linkcheck,
|
||||
@ -56,8 +47,8 @@ assert (hash == null) -> (src != null);
|
||||
ninja,
|
||||
openssl,
|
||||
toml11,
|
||||
pegtl,
|
||||
python3,
|
||||
perl,
|
||||
pkg-config,
|
||||
rapidcheck,
|
||||
Security,
|
||||
@ -65,6 +56,12 @@ assert (hash == null) -> (src != null);
|
||||
util-linuxMinimal,
|
||||
xz,
|
||||
nixosTests,
|
||||
lix-doc ? callPackage ./doc {
|
||||
inherit src;
|
||||
version = "${version}${suffix}";
|
||||
cargoHash = docCargoHash;
|
||||
cargoLock = docCargoLock;
|
||||
},
|
||||
|
||||
enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform,
|
||||
enableStatic ? stdenv.hostPlatform.isStatic,
|
||||
@ -78,212 +75,240 @@ assert (hash == null) -> (src != null);
|
||||
stateDir,
|
||||
storeDir,
|
||||
}:
|
||||
assert lib.assertMsg (docCargoHash != null || docCargoLock != null)
|
||||
"Either `lix-doc`'s cargoHash using `docCargoHash` or `lix-doc`'s `cargoLock.lockFile` using `docCargoLock` must be set!";
|
||||
let
|
||||
lix-doc = callPackage ./doc {
|
||||
inherit src;
|
||||
version = "${version}${suffix}";
|
||||
cargoHash = docCargoHash;
|
||||
};
|
||||
self = stdenv.mkDerivation {
|
||||
pname = "lix";
|
||||
|
||||
version = "${version}${suffix}";
|
||||
VERSION_SUFFIX = suffix;
|
||||
|
||||
inherit src patches;
|
||||
|
||||
outputs =
|
||||
[
|
||||
"out"
|
||||
"dev"
|
||||
]
|
||||
++ lib.optionals enableDocumentation [
|
||||
"man"
|
||||
"doc"
|
||||
];
|
||||
|
||||
strictDeps = true;
|
||||
|
||||
nativeBuildInputs =
|
||||
[
|
||||
pkg-config
|
||||
bison
|
||||
flex
|
||||
jq
|
||||
meson
|
||||
ninja
|
||||
cmake
|
||||
python3
|
||||
doxygen
|
||||
|
||||
# Tests
|
||||
git
|
||||
mercurial
|
||||
jq
|
||||
lsof
|
||||
]
|
||||
++ lib.optionals (enableDocumentation) [
|
||||
(lib.getBin lowdown)
|
||||
mdbook
|
||||
mdbook-linkcheck
|
||||
]
|
||||
++ lib.optionals stdenv.isLinux [ util-linuxMinimal ];
|
||||
|
||||
buildInputs =
|
||||
[
|
||||
boost
|
||||
brotli
|
||||
bzip2
|
||||
curl
|
||||
editline
|
||||
libsodium
|
||||
openssl
|
||||
sqlite
|
||||
xz
|
||||
gtest
|
||||
libarchive
|
||||
lowdown
|
||||
rapidcheck
|
||||
toml11
|
||||
lix-doc
|
||||
]
|
||||
++ lib.optionals stdenv.isDarwin [ Security ]
|
||||
++ lib.optionals (stdenv.isx86_64) [ libcpuid ]
|
||||
++ lib.optionals withLibseccomp [ libseccomp ]
|
||||
++ lib.optionals withAWS [ aws-sdk-cpp ];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
boehmgc
|
||||
nlohmann_json
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
patchShebangs --build tests
|
||||
'';
|
||||
|
||||
preConfigure =
|
||||
# Copy libboost_context so we don't get all of Boost in our closure.
|
||||
# https://github.com/NixOS/nixpkgs/issues/45462
|
||||
lib.optionalString (!enableStatic) ''
|
||||
mkdir -p $out/lib
|
||||
cp -pd ${boost}/lib/{libboost_context*,libboost_thread*,libboost_system*} $out/lib
|
||||
rm -f $out/lib/*.a
|
||||
${lib.optionalString stdenv.isLinux ''
|
||||
chmod u+w $out/lib/*.so.*
|
||||
patchelf --set-rpath $out/lib:${stdenv.cc.cc.lib}/lib $out/lib/libboost_thread.so.*
|
||||
''}
|
||||
${lib.optionalString stdenv.hostPlatform.isDarwin ''
|
||||
for LIB in $out/lib/*.dylib; do
|
||||
chmod u+w $LIB
|
||||
install_name_tool -id $LIB $LIB
|
||||
install_name_tool -delete_rpath ${boost}/lib/ $LIB || true
|
||||
done
|
||||
install_name_tool -change ${boost}/lib/libboost_system.dylib $out/lib/libboost_system.dylib $out/lib/libboost_thread.dylib
|
||||
''}
|
||||
'';
|
||||
|
||||
mesonBuildType = "release";
|
||||
mesonFlags =
|
||||
[
|
||||
# LTO optimization
|
||||
(lib.mesonBool "b_lto" (!stdenv.isDarwin))
|
||||
(lib.mesonEnable "gc" true)
|
||||
(lib.mesonBool "enable-tests" true)
|
||||
(lib.mesonBool "enable-docs" enableDocumentation)
|
||||
(lib.mesonBool "enable-embedded-sandbox-shell" (stdenv.isLinux && stdenv.hostPlatform.isStatic))
|
||||
(lib.mesonEnable "seccomp-sandboxing" withLibseccomp)
|
||||
|
||||
(lib.mesonOption "store-dir" storeDir)
|
||||
(lib.mesonOption "state-dir" stateDir)
|
||||
(lib.mesonOption "sysconfdir" confDir)
|
||||
]
|
||||
++ lib.optionals stdenv.isLinux [
|
||||
(lib.mesonOption "sandbox-shell" "${busybox-sandbox-shell}/bin/busybox")
|
||||
];
|
||||
|
||||
# Needed for Meson to find Boost.
|
||||
# https://github.com/NixOS/nixpkgs/issues/86131.
|
||||
env = {
|
||||
BOOST_INCLUDEDIR = "${lib.getDev boost}/include";
|
||||
BOOST_LIBRARYDIR = "${lib.getLib boost}/lib";
|
||||
};
|
||||
|
||||
postInstall =
|
||||
''
|
||||
mkdir -p $doc/nix-support
|
||||
echo "doc manual $doc/share/doc/nix/manual" >> $doc/nix-support/hydra-build-products
|
||||
''
|
||||
+ lib.optionalString stdenv.hostPlatform.isStatic ''
|
||||
mkdir -p $out/nix-support
|
||||
echo "file binary-dist $out/bin/nix" >> $out/nix-support/hydra-build-products
|
||||
''
|
||||
+ lib.optionalString stdenv.isDarwin ''
|
||||
for lib in liblixutil.dylib liblixexpr.dylib; do
|
||||
install_name_tool \
|
||||
-change "${lib.getLib boost}/lib/libboost_context.dylib" \
|
||||
"$out/lib/libboost_context.dylib" \
|
||||
"$out/lib/$lib"
|
||||
done
|
||||
'';
|
||||
|
||||
doCheck = true;
|
||||
mesonCheckFlags = [ "--suite=check" ];
|
||||
checkInputs = [
|
||||
gtest
|
||||
rapidcheck
|
||||
];
|
||||
|
||||
doInstallCheck = true;
|
||||
mesonInstallCheckFlags = [ "--suite=installcheck" ];
|
||||
|
||||
preInstallCheck = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
||||
# socket path becomes too long otherwise
|
||||
export TMPDIR=$NIX_BUILD_TOP
|
||||
# Prevent crashes in libcurl due to invoking Objective-C `+initialize` methods after `fork`.
|
||||
# See http://sealiesoftware.com/blog/archive/2017/6/5/Objective-C_and_fork_in_macOS_1013.html.
|
||||
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
|
||||
'';
|
||||
|
||||
installCheckPhase = ''
|
||||
runHook preInstallCheck
|
||||
flagsArray=($mesonInstallCheckFlags "''${mesonInstallCheckFlagsArray[@]}")
|
||||
meson test --no-rebuild "''${flagsArray[@]}"
|
||||
runHook postInstallCheck
|
||||
'';
|
||||
# strictoverflow is disabled because we trap on signed overflow instead
|
||||
hardeningDisable = [ "strictoverflow" ] ++ lib.optional stdenv.hostPlatform.isStatic "pie";
|
||||
# hardeningEnable = lib.optionals (!stdenv.isDarwin) [ "pie" ];
|
||||
# hardeningDisable = lib.optional stdenv.hostPlatform.isMusl "fortify";
|
||||
separateDebugInfo = stdenv.isLinux && !enableStatic;
|
||||
enableParallelBuilding = true;
|
||||
|
||||
passthru = {
|
||||
inherit aws-sdk-cpp boehmgc;
|
||||
tests = {
|
||||
misc = nixosTests.misc.lix.passthru.override { nixPackage = self; };
|
||||
};
|
||||
};
|
||||
|
||||
# point 'nix edit' and ofborg at the file that defines the attribute,
|
||||
# not this common file.
|
||||
pos = builtins.unsafeGetAttrPos "version" args;
|
||||
meta = with lib; {
|
||||
description = "Powerful package manager that makes package management reliable and reproducible";
|
||||
longDescription = ''
|
||||
Lix (a fork of Nix) is a powerful package manager for Linux and other Unix systems that
|
||||
makes package management reliable and reproducible. It provides atomic
|
||||
upgrades and rollbacks, side-by-side installation of multiple versions of
|
||||
a package, multi-user package management and easy setup of build
|
||||
environments.
|
||||
'';
|
||||
homepage = "https://lix.systems";
|
||||
license = licenses.lgpl21Plus;
|
||||
inherit maintainers;
|
||||
platforms = platforms.unix;
|
||||
outputsToInstall = [ "out" ] ++ optional enableDocumentation "man";
|
||||
mainProgram = "nix";
|
||||
broken = enableStatic;
|
||||
};
|
||||
};
|
||||
isLegacyParser = lib.versionOlder version "2.91";
|
||||
in
|
||||
self
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "lix";
|
||||
|
||||
version = "${version}${suffix}";
|
||||
VERSION_SUFFIX = suffix;
|
||||
|
||||
inherit src patches;
|
||||
|
||||
outputs =
|
||||
[
|
||||
"out"
|
||||
"dev"
|
||||
]
|
||||
++ lib.optionals enableDocumentation [
|
||||
"man"
|
||||
"doc"
|
||||
"devdoc"
|
||||
];
|
||||
|
||||
strictDeps = true;
|
||||
|
||||
nativeBuildInputs =
|
||||
[
|
||||
pkg-config
|
||||
flex
|
||||
jq
|
||||
meson
|
||||
ninja
|
||||
cmake
|
||||
python3
|
||||
|
||||
# Tests
|
||||
git
|
||||
mercurial
|
||||
jq
|
||||
lsof
|
||||
]
|
||||
++ lib.optionals isLegacyParser [ bison ]
|
||||
++ lib.optionals enableDocumentation [
|
||||
(lib.getBin lowdown)
|
||||
mdbook
|
||||
mdbook-linkcheck
|
||||
doxygen
|
||||
]
|
||||
++ lib.optionals stdenv.isLinux [ util-linuxMinimal ];
|
||||
|
||||
buildInputs =
|
||||
[
|
||||
boost
|
||||
brotli
|
||||
bzip2
|
||||
curl
|
||||
editline
|
||||
libsodium
|
||||
openssl
|
||||
sqlite
|
||||
xz
|
||||
gtest
|
||||
libarchive
|
||||
lowdown
|
||||
rapidcheck
|
||||
toml11
|
||||
lix-doc
|
||||
]
|
||||
++ lib.optionals (!isLegacyParser) [ pegtl ]
|
||||
++ lib.optionals stdenv.isDarwin [ Security ]
|
||||
++ lib.optionals (stdenv.isx86_64) [ libcpuid ]
|
||||
++ lib.optionals withLibseccomp [ libseccomp ]
|
||||
++ lib.optionals withAWS [ aws-sdk-cpp ];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
boehmgc
|
||||
nlohmann_json
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
patchShebangs --build tests doc/manual
|
||||
'';
|
||||
|
||||
preConfigure =
|
||||
# Copy libboost_context so we don't get all of Boost in our closure.
|
||||
# https://github.com/NixOS/nixpkgs/issues/45462
|
||||
lib.optionalString (!enableStatic) ''
|
||||
mkdir -p $out/lib
|
||||
cp -pd ${boost}/lib/{libboost_context*,libboost_thread*,libboost_system*} $out/lib
|
||||
rm -f $out/lib/*.a
|
||||
${lib.optionalString stdenv.isLinux ''
|
||||
chmod u+w $out/lib/*.so.*
|
||||
patchelf --set-rpath $out/lib:${stdenv.cc.cc.lib}/lib $out/lib/libboost_thread.so.*
|
||||
''}
|
||||
${lib.optionalString stdenv.hostPlatform.isDarwin ''
|
||||
for LIB in $out/lib/*.dylib; do
|
||||
chmod u+w $LIB
|
||||
install_name_tool -id $LIB $LIB
|
||||
install_name_tool -delete_rpath ${boost}/lib/ $LIB || true
|
||||
done
|
||||
install_name_tool -change ${boost}/lib/libboost_system.dylib $out/lib/libboost_system.dylib $out/lib/libboost_thread.dylib
|
||||
''}
|
||||
'';
|
||||
|
||||
# Needed for Meson to find Boost.
|
||||
# https://github.com/NixOS/nixpkgs/issues/86131.
|
||||
env = {
|
||||
BOOST_INCLUDEDIR = "${lib.getDev boost}/include";
|
||||
BOOST_LIBRARYDIR = "${lib.getLib boost}/lib";
|
||||
};
|
||||
|
||||
# -O3 seems to anger a gcc bug and provide no performance benefit.
|
||||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114360
|
||||
# We use -O2 upstream https://gerrit.lix.systems/c/lix/+/554
|
||||
mesonBuildType = "debugoptimized";
|
||||
|
||||
mesonFlags =
|
||||
[
|
||||
# Enable LTO, since it improves eval performance a fair amount
|
||||
# LTO is disabled on static due to strange linking errors
|
||||
(lib.mesonBool "b_lto" (!stdenv.hostPlatform.isStatic))
|
||||
(lib.mesonEnable "gc" true)
|
||||
(lib.mesonBool "enable-tests" true)
|
||||
(lib.mesonBool "enable-docs" enableDocumentation)
|
||||
(lib.mesonEnable "internal-api-docs" enableDocumentation)
|
||||
(lib.mesonBool "enable-embedded-sandbox-shell" (stdenv.isLinux && stdenv.hostPlatform.isStatic))
|
||||
(lib.mesonEnable "seccomp-sandboxing" withLibseccomp)
|
||||
|
||||
(lib.mesonOption "store-dir" storeDir)
|
||||
(lib.mesonOption "state-dir" stateDir)
|
||||
(lib.mesonOption "sysconfdir" confDir)
|
||||
]
|
||||
++ lib.optionals stdenv.isLinux [
|
||||
(lib.mesonOption "sandbox-shell" "${busybox-sandbox-shell}/bin/busybox")
|
||||
];
|
||||
|
||||
ninjaFlags = [ "-v" ];
|
||||
|
||||
postInstall =
|
||||
lib.optionalString enableDocumentation ''
|
||||
mkdir -p $doc/nix-support
|
||||
echo "doc manual $doc/share/doc/nix/manual" >> $doc/nix-support/hydra-build-products
|
||||
|
||||
mkdir -p $devdoc/nix-support
|
||||
echo "devdoc internal-api $devdoc/share/doc/nix/internal-api" >> $devdoc/nix-support/hydra-build-products
|
||||
''
|
||||
+ lib.optionalString stdenv.hostPlatform.isStatic ''
|
||||
mkdir -p $out/nix-support
|
||||
echo "file binary-dist $out/bin/nix" >> $out/nix-support/hydra-build-products
|
||||
''
|
||||
+ lib.optionalString stdenv.isDarwin ''
|
||||
for lib in liblixutil.dylib liblixexpr.dylib; do
|
||||
install_name_tool \
|
||||
-change "${lib.getLib boost}/lib/libboost_context.dylib" \
|
||||
"$out/lib/libboost_context.dylib" \
|
||||
"$out/lib/$lib"
|
||||
done
|
||||
'';
|
||||
|
||||
# This needs to run after _multioutDocs moves the docs to $doc
|
||||
postFixup = lib.optionalString enableDocumentation ''
|
||||
mkdir -p $devdoc/share/doc/nix
|
||||
mv $doc/share/doc/nix/internal-api $devdoc/share/doc/nix
|
||||
'';
|
||||
|
||||
doCheck = true;
|
||||
mesonCheckFlags = [
|
||||
"--suite=check"
|
||||
"--print-errorlogs"
|
||||
];
|
||||
checkInputs = [
|
||||
gtest
|
||||
rapidcheck
|
||||
];
|
||||
|
||||
doInstallCheck = true;
|
||||
mesonInstallCheckFlags = [
|
||||
"--suite=installcheck"
|
||||
"--print-errorlogs"
|
||||
];
|
||||
|
||||
preInstallCheck = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
||||
# socket path becomes too long otherwise
|
||||
export TMPDIR=$NIX_BUILD_TOP
|
||||
# Prevent crashes in libcurl due to invoking Objective-C `+initialize` methods after `fork`.
|
||||
# See http://sealiesoftware.com/blog/archive/2017/6/5/Objective-C_and_fork_in_macOS_1013.html.
|
||||
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
|
||||
'';
|
||||
|
||||
installCheckPhase = ''
|
||||
runHook preInstallCheck
|
||||
flagsArray=($mesonInstallCheckFlags "''${mesonInstallCheckFlagsArray[@]}")
|
||||
meson test --no-rebuild "''${flagsArray[@]}"
|
||||
runHook postInstallCheck
|
||||
'';
|
||||
hardeningDisable = [
|
||||
# strictoverflow is disabled because we trap on signed overflow instead
|
||||
"strictoverflow"
|
||||
]
|
||||
# fortify breaks the build with lto and musl for some reason
|
||||
++ lib.optional stdenv.hostPlatform.isMusl "fortify";
|
||||
|
||||
# hardeningEnable = lib.optionals (!stdenv.isDarwin) [ "pie" ];
|
||||
separateDebugInfo = stdenv.isLinux && !enableStatic;
|
||||
enableParallelBuilding = true;
|
||||
|
||||
# Used by (1) test which has dynamic port assignment.
|
||||
__darwinAllowLocalNetworking = true;
|
||||
|
||||
passthru = {
|
||||
inherit aws-sdk-cpp boehmgc;
|
||||
tests = {
|
||||
misc = nixosTests.misc.lix.passthru.override { nixPackage = finalAttrs.finalPackage; };
|
||||
};
|
||||
};
|
||||
|
||||
# point 'nix edit' and ofborg at the file that defines the attribute,
|
||||
# not this common file.
|
||||
pos = builtins.unsafeGetAttrPos "version" args;
|
||||
meta = {
|
||||
description = "Powerful package manager that makes package management reliable and reproducible";
|
||||
longDescription = ''
|
||||
Lix (a fork of Nix) is a powerful package manager for Linux and other Unix systems that
|
||||
makes package management reliable and reproducible. It provides atomic
|
||||
upgrades and rollbacks, side-by-side installation of multiple versions of
|
||||
a package, multi-user package management and easy setup of build
|
||||
environments.
|
||||
'';
|
||||
homepage = "https://lix.systems";
|
||||
license = lib.licenses.lgpl21Plus;
|
||||
inherit maintainers;
|
||||
platforms = lib.platforms.unix;
|
||||
outputsToInstall = [ "out" ] ++ lib.optional enableDocumentation "man";
|
||||
mainProgram = "nix";
|
||||
};
|
||||
})
|
||||
|
@ -4,6 +4,7 @@
|
||||
boehmgc,
|
||||
callPackage,
|
||||
fetchFromGitHub,
|
||||
fetchpatch,
|
||||
Security,
|
||||
|
||||
storeDir ? "/nix/store",
|
||||
@ -33,6 +34,9 @@ let
|
||||
requiredSystemFeatures = [ ];
|
||||
};
|
||||
|
||||
# Since Lix 2.91 does not use boost coroutines, it does not need boehmgc patches either.
|
||||
needsBoehmgcPatches = version: lib.versionOlder version "2.91";
|
||||
|
||||
common =
|
||||
args:
|
||||
callPackage (import ./common.nix ({ inherit lib fetchFromGitHub; } // args)) {
|
||||
@ -42,11 +46,13 @@ let
|
||||
stateDir
|
||||
confDir
|
||||
;
|
||||
boehmgc = boehmgc-nix;
|
||||
boehmgc = if needsBoehmgcPatches args.version then boehmgc-nix else boehmgc-nix_2_3;
|
||||
aws-sdk-cpp = aws-sdk-cpp-nix;
|
||||
};
|
||||
in
|
||||
lib.makeExtensible (self: ({
|
||||
lib.makeExtensible (self: {
|
||||
buildLix = common;
|
||||
|
||||
lix_2_90 = (
|
||||
common {
|
||||
version = "2.90.0";
|
||||
@ -55,6 +61,31 @@ lib.makeExtensible (self: ({
|
||||
}
|
||||
);
|
||||
|
||||
latest = self.lix_2_90;
|
||||
stable = self.lix_2_90;
|
||||
}))
|
||||
lix_2_91 = (
|
||||
common {
|
||||
version = "2.91.0";
|
||||
hash = "sha256-Rosl9iA9MybF5Bud4BTAQ9adbY81aGmPfV8dDBGl34s=";
|
||||
docCargoHash = "sha256-KOn1fXF7k7c/0e5ZCNZwt3YZmjL1oi5A2mhwxQWKaUo=";
|
||||
|
||||
patches = [
|
||||
# Fix meson to not use target_machine, fixing cross. This commit is in release-2.91: remove when updating to 2.91.1 (if any).
|
||||
# https://gerrit.lix.systems/c/lix/+/1781
|
||||
# https://git.lix.systems/lix-project/lix/commit/ca2b514e20de12b75088b06b8e0e316482516401
|
||||
(fetchpatch {
|
||||
url = "https://git.lix.systems/lix-project/lix/commit/ca2b514e20de12b75088b06b8e0e316482516401.patch";
|
||||
hash = "sha256-TZauU4RIsn07xv9vZ33amrDvCLMbrtcHs1ozOTLgu98=";
|
||||
})
|
||||
# Fix musl builds. This commit is in release-2.91: remove when updating to 2.91.1 (if any).
|
||||
# https://gerrit.lix.systems/c/lix/+/1823
|
||||
# https://git.lix.systems/lix-project/lix/commit/ed51a172c69996fc6f3b7dfaa86015bff50c8ba8
|
||||
(fetchpatch {
|
||||
url = "https://git.lix.systems/lix-project/lix/commit/ed51a172c69996fc6f3b7dfaa86015bff50c8ba8.patch";
|
||||
hash = "sha256-X59N+tOQ2GN17p9sXvo9OiuEexzB23ieuOvtq2sre5c=";
|
||||
})
|
||||
];
|
||||
}
|
||||
);
|
||||
|
||||
latest = self.lix_2_91;
|
||||
stable = self.lix_2_91;
|
||||
})
|
||||
|
@ -2,11 +2,12 @@
|
||||
src,
|
||||
rustPlatform,
|
||||
version,
|
||||
cargoHash,
|
||||
cargoHash ? null,
|
||||
cargoLock ? null
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage {
|
||||
pname = "lix-doc";
|
||||
sourceRoot = "${src.name}/lix-doc";
|
||||
inherit version src cargoHash;
|
||||
sourceRoot = "${src.name or src}/lix-doc";
|
||||
inherit version src cargoHash cargoLock;
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
, hash ? null
|
||||
, src ? fetchFromGitHub { owner = "NixOS"; repo = "nix"; rev = version; inherit hash; }
|
||||
, patches ? [ ]
|
||||
, maintainers ? with lib.maintainers; [ eelco lovesegfault artturin ma27 ]
|
||||
, maintainers ? with lib.maintainers; [ eelco lovesegfault artturin ]
|
||||
, self_attribute_name
|
||||
}@args:
|
||||
assert (hash == null) -> (src != null);
|
||||
@ -243,6 +243,12 @@ self = stdenv.mkDerivation {
|
||||
# See https://github.com/NixOS/nix/issues/5687
|
||||
+ lib.optionalString (atLeast25 && stdenv.isDarwin) ''
|
||||
echo "exit 99" > tests/gc-non-blocking.sh
|
||||
'' # TODO: investigate why this broken
|
||||
+ lib.optionalString (atLeast25 && stdenv.hostPlatform.system == "aarch64-linux") ''
|
||||
echo "exit 0" > tests/functional/flakes/show.sh
|
||||
'' + ''
|
||||
# nixStatic otherwise does not find its man pages in tests.
|
||||
export MANPATH=$man/share/man:$MANPATH
|
||||
'';
|
||||
|
||||
separateDebugInfo = stdenv.isLinux && (atLeast24 -> !enableStatic);
|
||||
|
@ -141,7 +141,7 @@ in lib.makeExtensible (self: ({
|
||||
patch-monitorfdhup
|
||||
];
|
||||
self_attribute_name = "nix_2_3";
|
||||
maintainers = with lib.maintainers; [ flokli raitobezarius ];
|
||||
maintainers = with lib.maintainers; [ flokli ];
|
||||
}).override { boehmgc = boehmgc-nix_2_3; }).overrideAttrs {
|
||||
# https://github.com/NixOS/nix/issues/10222
|
||||
# spurious test/add.sh failures
|
||||
@ -185,8 +185,8 @@ in lib.makeExtensible (self: ({
|
||||
};
|
||||
|
||||
nix_2_24 = (common {
|
||||
version = "2.24.3";
|
||||
hash = "sha256-aBuGXm0UwDekCYLl7xDyw+BAJOg7728i57TbSXzPacc=";
|
||||
version = "2.24.6";
|
||||
hash = "sha256-kgq3B+olx62bzGD5C6ighdAoDweLq+AebxVHcDnKH4w=";
|
||||
self_attribute_name = "nix_2_24";
|
||||
}).override (lib.optionalAttrs (stdenv.isDarwin && stdenv.isx86_64) {
|
||||
# Fix the following error with the default x86_64-darwin SDK:
|
||||
@ -201,12 +201,12 @@ in lib.makeExtensible (self: ({
|
||||
|
||||
git = (common rec {
|
||||
version = "2.25.0";
|
||||
suffix = "pre20240807_${lib.substring 0 8 src.rev}";
|
||||
suffix = "pre20240910_${lib.substring 0 8 src.rev}";
|
||||
src = fetchFromGitHub {
|
||||
owner = "NixOS";
|
||||
repo = "nix";
|
||||
rev = "cfe66dbec325d5dcb601b642bd9c149ae1353147";
|
||||
hash = "sha256-1hqjl4br3MRK1pkzDrhBSxKUhdfQ/P4b5KbLfGua64g=";
|
||||
rev = "b9d3cdfbd2b873cf34600b262247d77109dfd905";
|
||||
hash = "sha256-7zH8TU5g3Bsg6ES0O8RcTm6JGYOMuDCGlSI3AQKbKy8=";
|
||||
};
|
||||
self_attribute_name = "git";
|
||||
}).override (lib.optionalAttrs (stdenv.isDarwin && stdenv.isx86_64) {
|
||||
|
@ -20103,7 +20103,7 @@ with pkgs;
|
||||
|
||||
# TODO(@Ericson2314): Build bionic libc from source
|
||||
bionic = if stdenv.hostPlatform.useAndroidPrebuilt
|
||||
then pkgs."androidndkPkgs_${stdenv.hostPlatform.androidNdkVer}".libraries
|
||||
then pkgs."androidndkPkgs_${stdenv.hostPlatform.androidNdkVersion}".libraries
|
||||
else callPackage ../os-specific/linux/bionic-prebuilt { };
|
||||
|
||||
boolstuff = callPackage ../development/libraries/boolstuff { };
|
||||
|
Loading…
Reference in New Issue
Block a user