Merge master into staging-nixos

This commit is contained in:
nixpkgs-ci[bot]
2026-04-22 18:25:14 +00:00
committed by GitHub
605 changed files with 26665 additions and 16913 deletions
+1 -1
View File
@@ -479,7 +479,7 @@ pkgs/by-name/lx/lxc* @adamcstephens
/pkgs/development/compilers/flutter @RossComputerGuy
# GNU Tar & Zip
/pkgs/tools/archivers/gnutar @RossComputerGuy
/pkgs/by-name/gn/gnutar @RossComputerGuy
/pkgs/by-name/zi/zip @RossComputerGuy
# SELinux
+1
View File
@@ -3,6 +3,7 @@
This chapter describes several special build helpers.
```{=include=} sections
special/buildenv.section.md
special/fakenss.section.md
special/fhs-environments.section.md
special/makesetuphook.section.md
@@ -0,0 +1,101 @@
# buildEnv {#sec-buildEnv}
`buildEnv` constructs a derivation containing directories and symbolic links, which resembles the profile layout where a list of derivations or store paths are installed.
Unlike [`symlinkJoin`](#trivial-builder-symlinkJoin), `buildEnv` takes special care of the outputs to link and checks for content collisions across the paths by default.
A common use case for `buildEnv` is constructing environment wrappers, such as an interpreter with modules or a program with extensions.
For example, [`python.withPackage`](#attributes-on-interpreters-packages) is based on `buildEnv`.
## Arguments {#sec-buildEnv-arguments}
`buildEnv` takes [fixed-point arguments (`buildEnv (finalAttrs: { })`)](#chap-build-helpers-finalAttrs) as well as a plain attribute set.
Unless otherwise noted, arguments can be overridden directly using [`<pkg>.overrideAttrs`](#sec-pkg-overrideAttrs).
`buildEnv` enforces [structured attributes (`{ __structuredAttrs = true; }`)](https://nix.dev/manual/nix/2.18/language/advanced-attributes.html#adv-attr-structuredAttrs).
- `name` or `pname` and `version` (required):
The name of the environment.
- `paths` (required):
The derivations or store paths to symlink ("install").
The elements can be any path-like object that string-interpolates to a store path.
The priority of each path is taken from `<path>.meta.priority` and falls back to `lib.meta.defaultPriority` if not set.
The argument `paths` is passed as attribute `passthru.paths` to prevent unexpected context pollution.
`passthru.paths` can be overridden with `<pkg>.overrideAttrs`.
- `extraOutputsToInstall` (default to `[ ]`):
Package outputs to include in addition to what `meta.outputsToInstall` specifies.
- `includeClosures` (default to `false`):
Whether to include closures of all input paths.
The list of the closure paths are constructed with `writeClosure`.
They are installed with lower priority and with build-time exceptions silenced.
- `extraPrefix` (default to `""`):
Root the result in directory `"$out${extraPrefix}"`, e.g. `"/share"`.
- `ignoreCollisions` (default: `false`):
Don't fail the build upon content collisions.
- `checkCollisionContents` (default: `true`):
If there is a collision, check whether the contents and permissions match; and only if not, throw a collision error.
- `ignoreSingleFileOutputs` (default: `false`):
Don't fail the build upon single-file outputs.
- `manifest` (default: `""`):
The manifest file (if any). A symlink `$out/manifest` will be created to it.
- `pathsToLink` (default: `[ "/" ]`):
The paths (relative to each element of `paths`) that we want to symlink (e.g., `["/bin"]`).
Any file outside the directories in this list won't be symlinked into the produced environment.
- `postBuild` (default: `""`):
Shell commands to run after building the symlink tree.
- `passthru` and `meta` (default: `{ }`):
`stdenv.mkDerivation`-supported attributes not passing down to `builtins.derivation`.
- `derivationArgs` (default: `{ }`):
Additional `stdenv.mkDerivation` arguments, such as `nativeBuildInputs`/`buildInputs` for `postBuild` dependencies and setup hooks.
`derivationArgs` is not passed down to `stdenv.mkDerivation`.
Override its attributes directly via `<pkg>.overrideAttrs` and reference directly via `finalAttrs`.
## Build-time exceptions {#sec-buildEnv-exceptions}
There are situations where the specified `paths` might not produce sensible profile layout.
By default, the builder fails early upon detecting these exceptions.
`buildEnv` provides arguments to fine-tune or ignore certain exceptions.
### Path collisions {#ssec-buildEnv-collisions}
Path collisions occur when files provided by two more output paths with the same priority overlap with each other, making the result profile layout potentially affected by the order of elements of `paths`.
This is undesirable in several use cases, such as when `paths` are determined by merging Nix modules.
If the argument `checkCollisionContents` is `true`, the builder checks whether the overlapping paths share the same content and mode, and fails only if not.
The argument `ignoreCollisions` silence the collision checks and allow the files to be overwritten based on the order of chosen output paths.
In addition to silencing this exception with `ignoreCollisions`, one can also adjust the priority of colliding packages and store paths.
Store paths can specify priority in the form
```nix
{
outPath = <path>;
meta.priority = <priority>;
}
```
And [`lib.meta.setPrio`](#function-library-lib.meta.setPrio)-related Nixpkgs Library functions also apply to a string-like attribute set (`{ outPath = <path>; }`).
### Single-file outputs {#ssec-buildEnv-singleFileOutputs}
When an output path provides a single file instead of a directory, it inherently cannot merge into the result layout.
All discoverable packages should configure their `meta.outputsToInstall` correctly, so that single-file outputs won't be installed into a profile.
Set `ignoreSingleFileOutputs` to `true` to drop all single-file output paths silently.
This option is useful when the specified paths contain the output paths of package tests.
+1 -1
View File
@@ -13,7 +13,7 @@ Primarily made for a multi-language environment.
#### `npmDeps` {#npm-config-hook-deps}
Derivation that contains the NPM package dependencies.
Derivation that contains the npm package dependencies.
Usually built with `fetchNpmDeps`.
This attribute is required or the hook will abort the build.
+34 -2
View File
@@ -13,7 +13,8 @@ Tcl packages are typically built with `tclPackages.mkTclDerivation`.
Tcl dependencies go in `buildInputs`/`nativeBuildInputs`/... like other packages.
For more complex package definitions, such as packages with mixed languages, use `tcl.tclPackageHook`.
Where possible, make sure to enable stubs for maximum compatibility, usually with the `--enable-stubs` configure flag.
Where possible, make sure to enable stubs for maximum compatibility.
If you are using `mkTclDerivation`, `--enable-stubs` will be automatically added to `configureFlags`.
Here is a simple package example to be called with `tclPackages.callPackage`.
@@ -33,7 +34,6 @@ mkTclDerivation rec {
configureFlags = [
"--with-ssl-dir=${openssl.dev}"
"--enable-stubs"
];
meta = {
@@ -52,3 +52,35 @@ Its use is documented in `pkgs/development/tcl-modules/by-name/README.md`.
All Tcl applications reside elsewhere.
In case a package is used as both a library and an application (for example `expect`), it should be defined in `tcl-packages.nix`, with an alias elsewhere.
### Using tclRequiresCheck {#using-tclrequirescheck}
Although unit tests are highly preferred to validate correctness of a package, not
all packages have test suites that can be run easily, and some have none at all.
To help ensure the package still works, [`tclRequiresCheck`](#using-tclrequirescheck) can attempt to `package require`
the listed modules.
```nix
{
tclRequiresCheck = [
"json"
"doctools"
];
}
```
roughly translates to:
```nix
{
preDist = ''
TCLLIBPATH="$out/lib $TCLLIBPATH"
tclsh <<<'exit [catch {package require json; package require doctools}]'
'';
}
```
However, this is done in its own phase, and not dependent on whether [`doCheck = true;`](#var-stdenv-doCheck).
This can also be useful in verifying that the package doesn't assume commonly
present packages (e.g. `tcllib`).
+18
View File
@@ -379,6 +379,9 @@
"sec-build-helper-extendMkDerivation": [
"index.html#sec-build-helper-extendMkDerivation"
],
"sec-buildEnv-exceptions": [
"index.html#sec-buildEnv-exceptions"
],
"sec-building-packages-with-llvm": [
"index.html#sec-building-packages-with-llvm"
],
@@ -770,6 +773,12 @@
"sec-treefmt-options-reference": [
"index.html#sec-treefmt-options-reference"
],
"ssec-buildEnv-collisions": [
"index.html#ssec-buildEnv-collisions"
],
"ssec-buildEnv-singleFileOutputs": [
"index.html#ssec-buildEnv-singleFileOutputs"
],
"ssec-cosmic-common-issues": [
"index.html#ssec-cosmic-common-issues"
],
@@ -878,6 +887,9 @@
"typst-package-scope-and-usage": [
"index.html#typst-package-scope-and-usage"
],
"using-tclrequirescheck": [
"index.html#using-tclrequirescheck"
],
"var-go-buildTestBinaries": [
"index.html#var-go-buildTestBinaries"
],
@@ -2182,6 +2194,12 @@
"chap-special": [
"index.html#chap-special"
],
"sec-buildEnv": [
"index.html#sec-buildEnv"
],
"sec-buildEnv-arguments": [
"index.html#sec-buildEnv-arguments"
],
"sec-fakeNss": [
"index.html#sec-fakeNss"
],
+8 -1
View File
@@ -324,6 +324,13 @@ and [release notes for v18](https://goteleport.com/docs/changelog/#1800-070325).
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
- `buildEnv` now takes fixed-point arguments (`finalAttrs: { }`).
The custom overrider `<env-pkg>.override` is deprecated but kept in this release. It will be removed in future releases after tree-wide transition.
The argument `paths` is passed as `passthru.paths` to avoid bringing in unexpected context.
- `buildEnv` now takes `derivationArgs` for additional arguments to pass to `stdenv.mkDerivation`.
A compatibility layer is added for directly-specified arguments `nativeBuildInputs` and `buildInputs`.
- Added `rewriteURL` attribute to the nixpkgs `config`, to allow for rewriting the URLs downloaded by `fetchurl`.
- Added `hashedMirrors` attribute to the nixpkgs `config`, to allow for customization of the hashed mirrors used by `fetchurl`.
@@ -348,7 +355,7 @@ and [release notes for v18](https://goteleport.com/docs/changelog/#1800-070325).
- `fetchgit` now accepts a `rootDir` argument to limit the resulting source to one subdirectory of the whole Git repository. Corresponding `--root-dir` option added to `nix-prefetch-git`.
- `fetchNpmDeps` now accepts a `npmRegistryOverridesString` argument to pass NPM registry overrides to the fetcher.
- `fetchNpmDeps` now accepts a `npmRegistryOverridesString` argument to pass npm registry overrides to the fetcher.
- `ffmpeg_8`, `ffmpeg_8-headless`, and `ffmpeg_8-full` have been added. The default version of FFmpeg is now `ffmpeg_8`. You can install previous versions from package attributes such as `ffmpeg_7`.
+2
View File
@@ -80,6 +80,8 @@
- Note that the above `nodePackages` removal also coincides with the removal of `node2nix` and its tooling, which have been deprecated for a long time.
- `buildEnv`-constructed packages now take only [structured attributes (`{ __structuredAttrs = true; }`)](https://nix.dev/manual/nix/2.18/language/advanced-attributes.html#adv-attr-structuredAttrs).
- `xfce.mkXfceDerivation` has been deprecated (i.e. conditioned behind `nixpkgs.config.allowAliases`)
and will be removed in NixOS 26.11, please use `stdenv.mkDerivation` directly. You can migrate by
adding `pkg-config`, `xfce4-dev-tools`, and `wrapGAppsHook3` to your `nativeBuildInputs` and
+1 -1
View File
@@ -1,6 +1,6 @@
# Nix script to calculate the Haskell dependencies of every haskellPackage. Used by ./hydra-report.hs.
let
pkgs = import ../../.. { };
pkgs = import ../../.. { config.allowAliases = false; };
inherit (pkgs) lib;
getDeps =
_: pkg:
@@ -20,6 +20,6 @@ cat > $tmpfile << EOF
dont-distribute-packages:
EOF
nix-instantiate --eval --option restrict-eval true -I . --strict --json maintainers/scripts/haskell/transitive-broken-packages.nix | jq -r . | LC_ALL=C.UTF-8 sort --ignore-case >> $tmpfile
nix-instantiate --show-trace --eval --option restrict-eval true -I . --strict --json maintainers/scripts/haskell/transitive-broken-packages.nix | jq -r . | LC_ALL=C.UTF-8 sort --ignore-case >> $tmpfile
mv $tmpfile $config_file
@@ -1,11 +1,16 @@
let
nixpkgs = import ../../..;
inherit (nixpkgs { }) pkgs lib;
isVersioned = attr: builtins.match "[A-Za-z0-9-]+(_[0-9]+)+" attr != null;
getEvaluating =
x:
builtins.attrNames (
lib.mapAttrsToList (_: v: v.pname) (
lib.filterAttrs (
_: v: (builtins.tryEval (v.outPath or null)).success && lib.isDerivation v && !v.meta.broken
n: v:
!(isVersioned n)
&& (builtins.tryEval (v.outPath or null)).success
&& lib.isDerivation v
&& !v.meta.broken
) x
);
brokenDeps = lib.subtractLists (getEvaluating pkgs.haskellPackages) (
@@ -111,4 +111,9 @@ sed -r \
# ShellCheck: latest version of command-line dev tool.
# Agda: The Agda community is fast-moving; we strive to always include the newest versions of Agda and the Agda packages in nixpkgs.
# Work around Stackage LTS including a bogus version of cassava which has been deprecated on Hackage.
# See <https://github.com/haskell-hvr/cassava/issues/248>.
# TODO(@sternenseemann): drop this once the situation has been resolved in Stackage LTS
sed -e 's/cassava ==0.5.5.0/cassava >= 0.5.4.0 && (> 0.5.5.0 || < 0.5.5.0) && < 0.6.0.0/' -i "$stackage_config"
echo "$old_version -> $version"
@@ -99,7 +99,7 @@ these assumptions the best it can.
Here is how to build the above Todo plugin. Note that we rely on
package-lock.json being assembled correctly, so must use a version where it is!
If there is no lockfile or the lockfile is incorrect, Nix cannot fetch NPM build
If there is no lockfile or the lockfile is incorrect, Nix cannot fetch npm build
and runtime dependencies for a sandbox build.
```nix
@@ -109,6 +109,8 @@
- [Ente Auth](https://ente.io/auth/), an open source 2FA authenticator, with end-to-end encrypted backups. Available as [programs.ente-auth](#opt-programs.ente-auth.enable).
- [linkding](https://linkding.link/), a self-hosted bookmark manager designed to be minimal, fast, and easy to set up. Available as [services.linkding](#opt-services.linkding.enable).
- [Tinyauth](https://tinyauth.app/), a simple authentication middleware for web apps, with OAuth and LDAP support. Available as [services.tinyauth](#opt-services.tinyauth.enable).
- [Strichliste](https://www.strichliste.org), a digital self-service tallysheet used in hackerspaces, clubs and offices. Available as [services.strichliste](#opt-services.strichliste.enable).
@@ -327,8 +329,6 @@ See <https://github.com/NixOS/nixpkgs/issues/481673>.
- [hardware.xpadneo](#opt-hardware.xpadneo.enable) now supports configuring kernel module parameters via a freeform [settings](#opt-hardware.xpadneo.settings) option, with convenience options for [rumble attenuation](#opt-hardware.xpadneo.rumbleAttenuation) and [controller quirks](#opt-hardware.xpadneo.quirks).
- The `services.prometheus.exporters` module interface now accepts an optional `socketOpts` attribute, allowing individual exporter modules to describe an accompanying `systemd.sockets.prometheus-${name}-exporter` unit alongside their service, enabling socket activation support.
- Wine has been updated to the 11.0 branch. Please check the [upstream announcement](https://gitlab.winehq.org/wine/wine/-/releases/wine-11.0) for more details.
- `security.acme` now defaults to a dynamic renewal duration, if
+7
View File
@@ -356,6 +356,13 @@ in
It is suggested to use the open source kernel modules on Turing or later GPUs (RTX series, GTX 16xx), and the closed source modules otherwise.
'';
}
{
assertion = !cfg.open || (nvidia_x11.open != null);
message = ''
The selected NVIDIA package does not provide open kernel modules.
Set hardware.nvidia.open = false or choose a package branch with open module support.
'';
}
];
boot = {
blacklistedKernelModules = [
+4 -2
View File
@@ -136,19 +136,21 @@ let
libPath = filter (pkgs.path + "/lib");
pkgsLibPath = filter (pkgs.path + "/pkgs/pkgs-lib");
nixosPath = filteredModules + "/nixos";
NIX_ABORT_ON_WARN = warningsAreErrors;
env.NIX_ABORT_ON_WARN = warningsAreErrors;
modules =
"[ "
+ concatMapStringsSep " " (p: ''"${removePrefix "${modulesPath}/" (toString p)}"'') docModules.lazy
+ " ]";
passAsFile = [ "modules" ];
disallowedReferences = [
filteredModules
libPath
pkgsLibPath
];
__structuredAttrs = true;
}
''
modulesPath="$TMPDIR/modules"
printf "%s" "$modules" > "$modulesPath"
export NIX_STORE_DIR=$TMPDIR/store
export NIX_STATE_DIR=$TMPDIR/state
${pkgs.buildPackages.nix}/bin/nix-instantiate \
+1
View File
@@ -1698,6 +1698,7 @@
./services/web-apps/librespeed.nix
./services/web-apps/libretranslate.nix
./services/web-apps/limesurvey.nix
./services/web-apps/linkding.nix
./services/web-apps/linkwarden.nix
./services/web-apps/lubelogger.nix
./services/web-apps/mainsail.nix
@@ -94,7 +94,7 @@ in
${lib.optionalString cfg.appendOnly "--append-only"} \
${lib.optionalString cfg.privateRepos "--private-repos"} \
${lib.optionalString cfg.prometheus "--prometheus"} \
${lib.escapeShellArgs cfg.extraFlags} \
${lib.escapeShellArgs cfg.extraFlags}
'';
Type = "simple";
User = "restic";
+1 -1
View File
@@ -16,7 +16,7 @@ let
''
mkdir -p $out/bin
makeWrapper ${cfg.package}/bin/dgraph $out/bin/dgraph \
--prefix PATH : "${lib.makeBinPath [ pkgs.nodejs ]}" \
--prefix PATH : "${lib.makeBinPath [ pkgs.nodejs ]}"
'';
securityOptions = {
NoNewPrivileges = true;
@@ -138,23 +138,12 @@ example:
DynamicUser = false;
ExecStart = ''
${pkgs.prometheus-postfix-exporter}/bin/postfix_exporter \
--web.systemd-socket \
--web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
--web.telemetry-path ${cfg.telemetryPath} \
${lib.concatStringsSep " \\\n " cfg.extraFlags}
'';
};
};
# `socketOpts` is an optional attribute set describing a
# `systemd.sockets.prometheus-${name}-exporter` unit that
# accompanies the exporter's service. When set, it is merged
# with a default definition that includes
# `wantedBy = [ "sockets.target" ]`, enabling socket activation
# for exporters that support it.
# Note that this attribute is optional.
socketOpts = {
socketConfig.ListenStream = "${cfg.listenAddress}:${toString cfg.port}";
};
}
```
- This should already be enough for the postfix exporter. Additionally one
@@ -36,15 +36,10 @@ let
# - extraOpts (types.attrs): extra configuration options to
# configure the exporter with, which
# are appended to the default options
# - socketOpts (types.attrs): optional config that is merged with
# the default definition of the
# exporter's systemd socket unit. When
# set, a `prometheus-${name}-exporter.socket`
# unit is created, enabling socket activation.
#
# Note that `extraOpts` and `socketOpts` are optional, but a script
# for the exporter's systemd service must be provided by specifying
# either `serviceOpts.script` or `serviceOpts.serviceConfig.ExecStart`
# Note that `extraOpts` is optional, but a script for the exporter's
# systemd service must be provided by specifying either
# `serviceOpts.script` or `serviceOpts.serviceConfig.ExecStart`
exporterOpts =
(genAttrs
@@ -316,7 +311,6 @@ let
name,
conf,
serviceOpts,
socketOpts,
}:
let
enableDynamicUser = serviceOpts.serviceConfig.DynamicUser or true;
@@ -374,12 +368,6 @@ let
"-m comment --comment ${name}-exporter -j nixos-fw-accept"
]);
networking.firewall.extraInputRules = mkIf (conf.openFirewall && nftables) conf.firewallRules;
systemd.sockets."prometheus-${name}-exporter" = mkIf (socketOpts != null) (mkMerge [
{
wantedBy = [ "sockets.target" ];
}
socketOpts
]);
systemd.services."prometheus-${name}-exporter" = mkMerge [
{
wantedBy = [ "multi-user.target" ];
@@ -615,7 +603,6 @@ in
mkExporterConf {
inherit name;
inherit (conf) serviceOpts;
socketOpts = conf.socketOpts or null;
conf = cfg.${name};
}
) exporterOpts)
@@ -86,7 +86,7 @@ in
let
collectSettingsArgs = optionalString (cfg.collectdBinary.enable) ''
--collectd.listen-address ${cfg.collectdBinary.listenAddress}:${toString cfg.collectdBinary.port} \
--collectd.security-level ${cfg.collectdBinary.securityLevel} \
--collectd.security-level ${cfg.collectdBinary.securityLevel}
'';
in
{
@@ -39,7 +39,6 @@ in
'';
};
};
serviceOpts = {
serviceConfig = {
DynamicUser = false;
@@ -48,7 +47,7 @@ in
${pkgs.prometheus-node-exporter}/bin/node_exporter \
${concatMapStringsSep " " (x: "--collector." + x) cfg.enabledCollectors} \
${concatMapStringsSep " " (x: "--no-collector." + x) cfg.disabledCollectors} \
--web.systemd-socket ${concatStringsSep " " cfg.extraFlags}
--web.listen-address ${cfg.listenAddress}:${toString cfg.port} ${concatStringsSep " " cfg.extraFlags}
'';
RestrictAddressFamilies =
optionals (collectorIsEnabled "logind" || collectorIsEnabled "systemd") [
@@ -68,8 +67,4 @@ in
ProtectHome = true;
};
};
socketOpts = {
socketConfig.ListenStream = "${cfg.listenAddress}:${toString cfg.port}";
};
}
@@ -85,7 +85,6 @@ in
};
};
};
serviceOpts = {
after = mkIf cfg.systemd.enable [ cfg.systemd.unit ];
serviceConfig = {
@@ -96,7 +95,7 @@ in
SupplementaryGroups = mkIf cfg.systemd.enable [ "systemd-journal" ];
ExecStart = ''
${lib.getExe cfg.package} \
--web.systemd-socket \
--web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
--web.telemetry-path ${cfg.telemetryPath} \
--postfix.showq_path ${escapeShellArg cfg.showqPath} \
${concatStringsSep " \\\n " (
@@ -116,8 +115,4 @@ in
'';
};
};
socketOpts = {
socketConfig.ListenStream = "${cfg.listenAddress}:${toString cfg.port}";
};
}
@@ -185,7 +185,7 @@ in
${optionalString (cfg.fileTransferIP != null) "filetransfer_ip=${cfg.fileTransferIP}"} \
${optionalString (cfg.queryIP != null) "query_ip=${cfg.queryIP}"} \
${optionalString (cfg.queryIP != null) "query_ssh_ip=${cfg.queryIP}"} \
${optionalString (cfg.queryIP != null) "query_http_ip=${cfg.queryIP}"} \
${optionalString (cfg.queryIP != null) "query_http_ip=${cfg.queryIP}"}
'';
WorkingDirectory = cfg.dataDir;
User = user;
+3 -8
View File
@@ -163,6 +163,9 @@ in
];
environment.TTY = "%I";
restartIfChanged = false;
# logind hardcodes spawning autovt@ttyN.service on VT switch. Upstream
# declares this alias via [Install] Alias=, which NixOS does not process.
aliases = [ "autovt@.service" ];
};
systemd.services."serial-getty@" = {
@@ -173,14 +176,6 @@ in
restartIfChanged = false;
};
systemd.services."autovt@" = {
serviceConfig.ExecStart = [
"" # override upstream default with an empty ExecStart
(gettyCmd "--noclear %I $TERM")
];
restartIfChanged = false;
};
systemd.services."container-getty@" = {
serviceConfig.ExecStart = [
"" # override upstream default with an empty ExecStart
+6 -1
View File
@@ -172,10 +172,15 @@ in
];
restartIfChanged = false;
# logind spawns autovt@ttyN.service on VT switch; point it at kmscon
aliases = [ "autovt@.service" ];
};
systemd.suppressedSystemUnits = [ "autovt@.service" ];
# tty1 is special: logind does not spawn autovt@tty1, it expects a static
# pull-in via getty.target. With getty@ suppressed, we must replace it.
systemd.services."kmsconvt@tty1".wantedBy = [ "getty.target" ];
systemd.suppressedSystemUnits = [ "getty@.service" ];
services.kmscon.extraConfig =
let
@@ -306,7 +306,7 @@ in
group = config.users.groups.epgstation.name;
isSystemUser = true;
# NPM insists on creating ~/.npm
# npm insists on creating ~/.npm
home = "/var/cache/epgstation";
};
+1 -1
View File
@@ -160,7 +160,7 @@ in
group = "video";
isSystemUser = true;
# NPM insists on creating ~/.npm
# npm insists on creating ~/.npm
home = "/var/cache/mirakurun";
};
@@ -0,0 +1,403 @@
{
config,
lib,
pkgs,
...
}:
let
inherit (lib)
mkEnableOption
mkIf
mkOption
mkPackageOption
optionalAttrs
types
;
cfg = config.services.linkding;
in
{
options.services.linkding = {
enable = mkEnableOption "linkding, a self-hosted bookmark manager";
package = mkPackageOption pkgs "linkding" { };
user = mkOption {
type = types.str;
default = "linkding";
description = ''
User account under which linkding runs.
::: {.note}
If left as the default value this user will automatically be created
on system activation, otherwise you are responsible for ensuring the
user exists before the linkding service starts.
:::
'';
};
group = mkOption {
type = types.str;
default = "linkding";
description = ''
Group under which linkding runs.
::: {.note}
If left as the default value this group will automatically be created
on system activation, otherwise you are responsible for ensuring the
group exists before the linkding service starts.
:::
'';
};
dataDir = mkOption {
type = types.path;
default = "/var/lib/linkding";
description = "Directory used for all mutable state: SQLite database, secret key, favicons, previews, and assets.";
};
address = mkOption {
type = types.str;
default = "127.0.0.1";
description = "Address on which linkding listens.";
};
port = mkOption {
type = types.port;
default = 9090;
description = "Port on which linkding listens.";
};
contextPath = mkOption {
type = types.str;
default = "";
example = "linkding/";
description = ''
Configures a URL context path under which linkding is accessible.
When set, linkding is available at `http://host:<port>/<contextPath>`.
Must end with a `/` when non-empty.
'';
};
environmentFile = mkOption {
type = types.nullOr types.path;
default = null;
example = "/run/secrets/linkding.env";
description = ''
Path to an environment file loaded by all linkding services.
Useful for injecting secrets that should not appear in the Nix store,
such as `LD_DB_PASSWORD` or `LD_SUPERUSER_PASSWORD`.
'';
};
settings = mkOption {
type = types.attrsOf types.str;
default = { };
example = {
LD_DISABLE_BACKGROUND_TASKS = "True";
LD_DISABLE_URL_VALIDATION = "True";
LD_ENABLE_OIDC = "True";
};
description = ''
Additional environment variables passed to linkding.
Refer to the [linkding documentation](https://linkding.link/options/)
for the full list of supported `LD_*` options.
'';
};
database = {
type = mkOption {
type = types.enum [
"sqlite"
"postgres"
];
default = "sqlite";
description = "Database engine to use. Defaults to SQLite.";
};
host = mkOption {
type = types.str;
default = "localhost";
description = "PostgreSQL server host.";
};
port = mkOption {
type = types.port;
default = 5432;
description = "PostgreSQL server port.";
};
name = mkOption {
type = types.str;
default = "linkding";
description = "PostgreSQL database name.";
};
user = mkOption {
type = types.str;
default = "linkding";
description = "PostgreSQL user name.";
};
createLocally = mkOption {
type = types.bool;
default = false;
description = "Whether to automatically create a local PostgreSQL database and user.";
};
};
openFirewall = mkOption {
type = types.bool;
default = false;
description = "Open the linkding port in the firewall.";
};
};
config = mkIf cfg.enable (
let
pkg = cfg.package;
usePostgres = cfg.database.type == "postgres";
pythonPath =
"${pkg.passthru.python.pkgs.makePythonPath pkg.passthru.dependencies}:${lib.getBin pkg}/${pkg.passthru.python.sitePackages}"
+ lib.strings.optionalString usePostgres ":${pkg.passthru.python.pkgs.makePythonPath pkg.optional-dependencies.postgres}";
# Build the environment passed to every linkding process.
environment = {
DJANGO_SETTINGS_MODULE = "bookmarks.settings.prod";
_NIXOS_LINKDING_DATA_DIR = cfg.dataDir;
LD_SERVER_PORT = toString cfg.port;
}
// optionalAttrs (cfg.contextPath != "") {
LD_CONTEXT_PATH = cfg.contextPath;
}
// optionalAttrs usePostgres {
LD_DB_ENGINE = "postgres";
LD_DB_DATABASE = cfg.database.name;
LD_DB_USER = cfg.database.user;
LD_DB_HOST = "/run/postgresql";
}
// optionalAttrs (usePostgres && !cfg.database.createLocally) {
LD_DB_HOST = cfg.database.host;
LD_DB_PORT = toString cfg.database.port;
}
// cfg.settings;
environmentFile = pkgs.writeText "linkding-environment" (lib.generators.toKeyValue { } environment);
# Generate a uwsgi.ini for the linkding instance, adapted for NixOS from
# the upstream uwsgi.ini. The static-map entries serve pre-generated
# static files from the Nix store as well as the mutable user-data
# directories (favicons, previews) from the data directory.
uwsgiIni = pkgs.writeText "linkding-uwsgi.ini" ''
[uwsgi]
plugins-dir = ${pkg.passthru.uwsgiWithPython}/lib/uwsgi
plugin = python3
module = bookmarks.wsgi:application
env = DJANGO_SETTINGS_MODULE=bookmarks.settings.prod
processes = 2
threads = 2
buffer-size = 8192
die-on-term = true
mime-file = ${pkgs.mailcap}/etc/mime.types
http = ${cfg.address}:${toString cfg.port}
static-map = /${cfg.contextPath}static=${pkg}/${pkg.passthru.python.sitePackages}/bookmarks/static
static-map = /${cfg.contextPath}static=${cfg.dataDir}/favicons
static-map = /${cfg.contextPath}static=${cfg.dataDir}/previews
static-map = /${cfg.contextPath}robots.txt=${pkg}/${pkg.passthru.python.sitePackages}/bookmarks/static/robots.txt
if-env = LD_REQUEST_TIMEOUT
http-timeout = %(_)
socket-timeout = %(_)
harakiri = %(_)
endif =
if-env = LD_REQUEST_MAX_CONTENT_LENGTH
limit-post = %(_)
endif =
if-env = LD_LOG_X_FORWARDED_FOR
log-x-forwarded-for = %(_)
endif =
if-env = LD_DISABLE_REQUEST_LOGS=true
disable-logging = true
log-4xx = true
log-5xx = true
endif =
'';
# Manage wrapper script installed into the system PATH so administrators can
# run Django management commands as the linkding service user.
linkdingManageScript =
let
args = lib.escapeShellArgs (
[
"--uid=${cfg.user}"
"--gid=${cfg.group}"
"--working-directory=${cfg.dataDir}"
"--property=EnvironmentFile=${environmentFile}"
]
++ lib.optional (cfg.environmentFile != null) "--property=EnvironmentFile=${cfg.environmentFile}"
++ [
"--property=ReadWritePaths=${cfg.dataDir}"
"--setenv=PYTHONPATH=${pythonPath}"
"--pty"
"--wait"
"--collect"
"--service-type=exec"
"--quiet"
"--"
"${lib.getExe' pkg "linkding"}"
]
);
in
pkgs.writeShellScriptBin "linkding-manage" ''
exec ${lib.getExe' config.systemd.package "systemd-run"} ${args} "$@"
'';
commonServiceConfig = {
Slice = "system-linkding.slice";
User = cfg.user;
Group = cfg.group;
EnvironmentFile = [
environmentFile
]
++ lib.optional (cfg.environmentFile != null) cfg.environmentFile;
Environment = "PYTHONPATH=${pythonPath}";
WorkingDirectory = cfg.dataDir;
StateDirectory = [
"linkding"
"linkding/favicons"
"linkding/previews"
"linkding/assets"
];
StateDirectoryMode = "0750";
# Hardening
NoNewPrivileges = true;
PrivateTmp = true;
PrivateDevices = true;
ProtectSystem = "strict";
ProtectHome = true;
ReadWritePaths = [ cfg.dataDir ];
PrivateMounts = true;
ProtectClock = true;
ProtectControlGroups = true;
ProtectHostname = true;
ProtectKernelLogs = true;
ProtectKernelModules = true;
ProtectKernelTunables = true;
ProtectProc = "invisible";
RemoveIPC = true;
RestrictRealtime = true;
RestrictSUIDSGID = true;
};
in
{
assertions = [
{
assertion = cfg.database.createLocally -> usePostgres;
message = "services.linkding.database.createLocally requires services.linkding.database.type = \"postgres\"";
}
{
assertion =
cfg.database.createLocally -> cfg.database.host == "localhost" || cfg.database.host == "";
message = "services.linkding.database.host should be empty or \"localhost\" when createLocally is enabled";
}
{
assertion =
cfg.database.createLocally
-> cfg.database.user == cfg.user && cfg.database.user == cfg.database.name;
message = "services.linkding.database.user must match services.linkding.user and services.linkding.database.name when createLocally is enabled";
}
{
assertion = cfg.contextPath == "" || lib.hasSuffix "/" cfg.contextPath;
message = "services.linkding.contextPath must end with \"/\" when non-empty";
}
];
networking.firewall = mkIf cfg.openFirewall {
allowedTCPPorts = [ cfg.port ];
};
environment.systemPackages = [ linkdingManageScript ];
users.users.${cfg.user} = {
isSystemUser = true;
group = cfg.group;
home = cfg.dataDir;
};
users.groups.${cfg.group} = { };
systemd.slices.system-linkding = {
description = "linkding bookmark manager System Slice";
documentation = [ "https://linkding.link/" ];
};
# One-shot setup service: run database migrations and first-time
# initialization steps taken from the upstream bootstrap.sh.
systemd.services.linkding-setup = {
description = "linkding database migrations and initialization";
after = [
"network.target"
]
++ lib.optionals (usePostgres && cfg.database.createLocally) [ "postgresql.target" ];
requires = lib.optionals (usePostgres && cfg.database.createLocally) [ "postgresql.target" ];
serviceConfig = commonServiceConfig // {
Type = "oneshot";
ExecStart = "${lib.getExe' pkg "linkding-bootstrap"}";
};
};
# Main WSGI service — starts after setup completes.
systemd.services.linkding = {
description = "linkding bookmark manager";
wantedBy = [ "multi-user.target" ];
after = [ "linkding-setup.service" ];
requires = [ "linkding-setup.service" ];
startLimitBurst = 5;
startLimitIntervalSec = 60;
serviceConfig = commonServiceConfig // {
Type = "exec";
ExecStart = "${lib.getExe pkgs.uwsgi} --ini ${uwsgiIni}";
Restart = "on-failure";
};
};
# Background task processor (Huey). Can be disabled via
# services.linkding.settings.LD_DISABLE_BACKGROUND_TASKS = "True".
systemd.services.linkding-background-tasks =
mkIf ((cfg.settings.LD_DISABLE_BACKGROUND_TASKS or "False") != "True")
{
description = "linkding background task processor";
wantedBy = [ "multi-user.target" ];
after = [ "linkding-setup.service" ];
requires = [ "linkding-setup.service" ];
serviceConfig = commonServiceConfig // {
Type = "exec";
ExecStart = "${lib.getExe' pkg "linkding"} run_huey -f";
Restart = "on-failure";
RestartSec = "5s";
};
};
# Automatically provision a local PostgreSQL database when requested.
services.postgresql = mkIf cfg.database.createLocally {
enable = true;
ensureDatabases = [ cfg.database.name ];
ensureUsers = [
{
name = cfg.database.user;
ensureDBOwnership = true;
}
];
};
}
);
meta.maintainers = with lib.maintainers; [ squat ];
}
+1 -1
View File
@@ -29,7 +29,7 @@ in
type = types.bool;
default = false;
description = ''
Give Node-RED access to NPM and GCC at runtime, so 'Nodes' can be
Give Node-RED access to npm and GCC at runtime, so 'Nodes' can be
downloaded and managed imperatively via the 'Palette Manager'.
'';
};
@@ -55,7 +55,7 @@ in
${cfg.package}/bin/unclutter \
--timeout ${toString cfg.timeout} \
--jitter ${toString (cfg.threshold - 1)} \
${concatMapStrings (x: " --" + x) cfg.extraOptions} \
${concatMapStrings (x: " --" + x) cfg.extraOptions}
'';
serviceConfig.RestartSec = 3;
serviceConfig.Restart = "always";
+1 -1
View File
@@ -69,7 +69,7 @@ in
-jitter ${toString (cfg.threshold - 1)} \
${optionalString cfg.keystroke "-keystroke"} \
${concatMapStrings (x: " -" + x) cfg.extraOptions} \
-not ${concatStringsSep " " cfg.excluded} \
-not ${concatStringsSep " " cfg.excluded}
'';
serviceConfig.PassEnvironment = "DISPLAY";
serviceConfig.RestartSec = 3;
+3
View File
@@ -4175,8 +4175,11 @@ let
"systemd-networkd.service"
"systemd-networkd.socket"
"systemd-networkd-persistent-storage.service"
"systemd-networkd-varlink-metrics.socket"
];
systemd.sockets.systemd-networkd-varlink-metrics.wantedBy = [ "sockets.target" ];
environment.etc."systemd/networkd.conf" = renderConfig cfg.config;
systemd.services.systemd-networkd =
-10
View File
@@ -856,16 +856,6 @@ in
};
};
# Remove with systemd 259.4
security.polkit.extraConfig = mkIf config.security.polkit.enable ''
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.machine1.register-machine" &&
subject.user != "root") {
return polkit.Result.AUTH_ADMIN_KEEP;
}
});
'';
# run0 is supposed to authenticate the user via polkit and then run a command. Without this next
# part, run0 would fail to run the command even if authentication is successful and the user has
# permission to run the command. This next part is only enabled if polkit is enabled because the
+1 -1
View File
@@ -248,7 +248,7 @@ in
'';
example = literalExpression ''
{
umount = ''${pkgs.util-linux}/bin/umount;
umount = "''${pkgs.util-linux}/bin/umount";
}
'';
type = types.attrsOf types.path;
@@ -126,6 +126,8 @@ in
"systemd-journald-sync@.service"
"systemd-journald-audit.socket"
"systemd-journald-dev-log.socket"
"systemd-journalctl.socket"
"systemd-journalctl@.service"
"syslog.socket"
];
@@ -47,7 +47,6 @@
config = lib.mkIf config.services.logind.enable {
systemd.additionalUpstreamSystemUnits = [
"systemd-logind.service"
"autovt@.service"
"systemd-user-sessions.service"
]
++ lib.optionals config.systemd.package.withImportd [
+2
View File
@@ -891,6 +891,8 @@ in
lighttpd = runTest ./lighttpd.nix;
limesurvey = runTest ./limesurvey.nix;
limine = import ./limine { inherit runTest; };
linkding = runTest ./web-apps/linkding.nix;
linkding-postgres = runTest ./web-apps/linkding-postgres.nix;
linkwarden = runTest ./web-apps/linkwarden.nix;
listmonk = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./listmonk.nix { };
litellm = runTest ./litellm.nix;
+1 -1
View File
@@ -17,7 +17,7 @@ let
csr = runWithOpenSSL "matrix.csr" ''
openssl req \
-new -key ${key} \
-out $out -subj "/CN=localhost" \
-out $out -subj "/CN=localhost"
'';
cert = runWithOpenSSL "matrix_cert.pem" ''
openssl x509 \
+1 -1
View File
@@ -19,7 +19,7 @@ let
csr = runWithOpenSSL "matrix.csr" ''
openssl req \
-new -key ${key} \
-out $out -subj "/CN=localhost" \
-out $out -subj "/CN=localhost"
'';
cert = runWithOpenSSL "matrix_cert.pem" ''
openssl x509 \
+26 -1
View File
@@ -1,14 +1,39 @@
{
name = "systemd-pstore";
nodes.machine = { };
nodes.machine = {
virtualisation.useEFIBoot = true;
boot.initrd.systemd.enable = true;
testing.initrdBackdoor = true;
};
testScript = ''
machine.switch_root()
with subtest("pstore API fs is mounted"):
machine.succeed("stat /sys/fs/pstore")
with subtest("systemd-pstore.service doesn't run because nothing crashed"):
output = machine.execute("systemctl status systemd-pstore.service", check_return=False)[1]
t.assertIn("condition unmet", output)
machine.fail("stat /var/lib/systemd/pstore/*/*/dmesg.txt")
with subtest("systemd-pstore.service saves dmesg.txt files"):
machine.execute("echo c > /proc/sysrq-trigger", check_return=False, check_output=False)
machine.wait_for_shutdown()
machine.switch_root()
machine.wait_for_unit("systemd-pstore.service")
machine.succeed("stat /var/lib/systemd/pstore/*/*/dmesg.txt")
with subtest("crashes in initrd can be recovered too"):
machine.succeed(
"rm -r /var/lib/systemd/pstore/*",
"sync",
)
machine.shutdown()
machine.execute("echo c > /proc/sysrq-trigger", check_return=False, check_output=False)
machine.wait_for_shutdown()
machine.switch_root()
machine.wait_for_unit("systemd-pstore.service")
machine.succeed("stat /var/lib/systemd/pstore/*/*/dmesg.txt")
'';
}
+12
View File
@@ -44,6 +44,18 @@
print(date_result)
assert date_result == "1970-01-01 09:00:00\n", "Timezone was not adjusted"
# Stop systemd-timedated.service to clear /etc/localtime read cache
node_nulltz.systemctl("stop systemd-timedated.service")
timedatectl_result = node_nulltz.succeed("timedatectl status")
print(timedatectl_result)
assert "Asia/Tokyo" in timedatectl_result, "'timedatectl status' output is missing 'Asia/Tokyo'"
with subtest("imperative - Ensure /etc/localtime symlink includes '/zoneinfo/' like icu expects"):
# https://github.com/unicode-org/icu/blob/release-78.3/icu4c/source/common/putil.cpp#L686-L695
readlink_result = node_nulltz.succeed("readlink --no-newline /etc/localtime")
print(readlink_result)
assert "/zoneinfo/" in readlink_result, f"/etc/localtime symlink is missing '/zoneinfo/': {readlink_result}"
with subtest("imperative - Ensure timezone adjustment persists across reboot"):
# Adjustment should persist across a reboot
node_nulltz.shutdown()
@@ -0,0 +1,42 @@
{ lib, ... }:
{
name = "linkding-postgres";
meta = {
maintainers = with lib.maintainers; [ squat ];
};
nodes.machine =
{ ... }:
{
services.linkding = {
enable = true;
port = 9090;
database = {
createLocally = true;
type = "postgres";
};
};
};
testScript = ''
machine.start()
machine.wait_for_unit("linkding.service")
machine.wait_for_open_port(9090)
with subtest("Login page loads"):
machine.succeed(
"curl -sSfL http://127.0.0.1:9090 | grep -i 'linkding'"
)
with subtest("Health endpoint responds"):
machine.succeed(
"curl -sSf http://127.0.0.1:9090/health"
)
with subtest("linkding-manage works"):
machine.succeed(
"linkding-manage version"
)
'';
}
+38
View File
@@ -0,0 +1,38 @@
{ lib, pkgs, ... }:
{
name = "linkding";
meta = {
maintainers = with lib.maintainers; [ squat ];
};
nodes.machine =
{ ... }:
{
services.linkding = {
enable = true;
port = 9090;
};
};
testScript = ''
machine.start()
machine.wait_for_unit("linkding.service")
machine.wait_for_open_port(9090)
with subtest("Login page loads"):
machine.succeed(
"curl -sSfL http://127.0.0.1:9090 | grep -i 'linkding'"
)
with subtest("Health endpoint responds"):
machine.succeed(
"curl -sSf http://127.0.0.1:9090/health"
)
with subtest("linkding-manage works"):
machine.succeed(
"linkding-manage version"
)
'';
}
@@ -26,9 +26,9 @@ let
url = "https://edgedl.me.gvt1.com/android/studio/ide-zips/2025.3.4.5/android-studio-panda4-rc1-linux.tar.gz";
};
latestVersion = {
version = "2025.3.4.4"; # "Android Studio Panda 4 | 2025.3.4 Canary 4"
sha256Hash = "sha256-sPGJuOm5T7EZV5hhOJsZc7P8CTXyv9A6k82hM1GZGpY=";
url = "https://edgedl.me.gvt1.com/android/studio/ide-zips/2025.3.4.4/android-studio-panda4-canary4-linux.tar.gz";
version = "2026.1.1.1"; # "Android Studio Quail 1 | 2026.1.1 Canary 1"
sha256Hash = "sha256-Nr7V6B4sEZrcwkMdKoevLEkyIHawxUx/ejN0nBL4KW0=";
url = "https://edgedl.me.gvt1.com/android/studio/ide-zips/2026.1.1.1/android-studio-quail1-canary1-linux.tar.gz";
};
in
{
@@ -115,6 +115,9 @@ in
name = "inhibit-lexical-cookie-warning-67916.patch";
path = ./inhibit-lexical-cookie-warning-67916-30.patch;
})
# tree-sitter 0.26 compatibility fix, from FreeBSD
# https://cgit.freebsd.org/ports/plain/editors/emacs/files/patch-src_treesit.c
./tree-sitter-0.26.patch
];
});
@@ -0,0 +1,56 @@
--- a/src/treesit.c
+++ b/src/treesit.c
@@ -34,7 +34,7 @@ along with GNU Emacs. If not, see <https://www.gnu.or
# include "w32common.h"
/* In alphabetical order. */
-#undef ts_language_version
+#undef ts_language_abi_version
#undef ts_node_child
#undef ts_node_child_by_field_name
#undef ts_node_child_count
@@ -89,7 +89,7 @@ along with GNU Emacs. If not, see <https://www.gnu.or
#undef ts_tree_get_changed_ranges
#undef ts_tree_root_node
-DEF_DLL_FN (uint32_t, ts_language_version, (const TSLanguage *));
+DEF_DLL_FN (uint32_t, ts_language_abi_version, (const TSLanguage *));
DEF_DLL_FN (TSNode, ts_node_child, (TSNode, uint32_t));
DEF_DLL_FN (TSNode, ts_node_child_by_field_name,
(TSNode, const char *, uint32_t));
@@ -166,7 +166,7 @@ init_treesit_functions (void)
if (!library)
return false;
- LOAD_DLL_FN (library, ts_language_version);
+ LOAD_DLL_FN (library, ts_language_abi_version);
LOAD_DLL_FN (library, ts_node_child);
LOAD_DLL_FN (library, ts_node_child_by_field_name);
LOAD_DLL_FN (library, ts_node_child_count);
@@ -224,7 +224,7 @@ init_treesit_functions (void)
return true;
}
-#define ts_language_version fn_ts_language_version
+#define ts_language_abi_version fn_ts_language_abi_version
#define ts_node_child fn_ts_node_child
#define ts_node_child_by_field_name fn_ts_node_child_by_field_name
#define ts_node_child_count fn_ts_node_child_count
@@ -746,7 +746,7 @@ treesit_load_language (Lisp_Object language_symbol,
{
*signal_symbol = Qtreesit_load_language_error;
*signal_data = list2 (Qversion_mismatch,
- make_fixnum (ts_language_version (lang)));
+ make_fixnum (ts_language_abi_version (lang)));
return NULL;
}
return lang;
@@ -817,7 +817,7 @@ Return nil if a grammar library for LANGUAGE is not av
&signal_data);
if (ts_language == NULL)
return Qnil;
- uint32_t version = ts_language_version (ts_language);
+ uint32_t version = ts_language_abi_version (ts_language);
return make_fixnum((ptrdiff_t) version);
}
}
@@ -5,13 +5,13 @@
}:
mkLibretroCore {
core = "mednafen-supafaust";
version = "0-unstable-2026-03-31";
version = "0-unstable-2026-04-20";
src = fetchFromGitHub {
owner = "libretro";
repo = "supafaust";
rev = "584ef2c5571f1ece95f6117aa04b7e8fee213fb1";
hash = "sha256-aptn3igUIvU/ho+6iXAg0J7X5ymdWeTM+zL+BA06tG4=";
rev = "2b93c0d7dff5b8f6c4e60e049d66849923fa8bba";
hash = "sha256-cK+2MR4dJBhTRkPRuRtP2zWGw+mROZMgUOLc8BOxuz8=";
};
makefile = "Makefile";
@@ -10,13 +10,13 @@
}:
mkLibretroCore {
core = "desmume2015";
version = "0-unstable-2022-04-05";
version = "0-unstable-2026-04-20";
src = fetchFromGitHub {
owner = "libretro";
repo = "desmume2015";
rev = "af397ff3d1f208c27f3922cc8f2b8e08884ba893";
hash = "sha256-kEb+og4g7rJvCinBZKcb42geZO6W8ynGsTG9yqYgI+U=";
rev = "f43dd42aae0816fcc69b2ebaa9299cbfef2ce2cc";
hash = "sha256-jozi1aFgrvlBJ2cc+gXRHi1TguzSTz+GC4C3UNMl1D4=";
};
extraBuildInputs = [
+10 -1
View File
@@ -92,6 +92,14 @@ let
})
];
patches-add-dll-accept-device-paths-wine-older-than-11_1 = [
(pkgs.fetchpatch {
name = "add-dll-accept-device-paths";
url = "https://gitlab.winehq.org/wine/wine/-/commit/401910ae25a11032f2da7baa1666d71e8bca2496.patch";
hash = "sha256-2726u9/vhhx39Tq7vOw24hslmeyZZEbxRRqe7JMFvCU";
})
];
inherit (pkgs) writeShellScript;
in
rec {
@@ -123,7 +131,8 @@ rec {
patches = [
# Also look for root certificates at $NIX_SSL_CERT_FILE
./cert-path.patch
];
]
++ patches-add-dll-accept-device-paths-wine-older-than-11_1;
updateScript = writeShellScript "update-wine-stable" ''
${updateScriptPreamble}
@@ -15,7 +15,7 @@
qtwayland,
kcoreaddons,
lz4,
xxHash,
xxhash,
ffmpeg_6,
protobuf,
openal-soft,
@@ -71,7 +71,7 @@ stdenv.mkDerivation (finalAttrs: {
qtbase
qtsvg
lz4
xxHash
xxhash
ffmpeg_6
openal-soft
minizip-ng
@@ -17,7 +17,11 @@
let
f =
pkgs: prev:
if !pkgs.stdenv.hostPlatform.isDarwin || pkgs.stdenv.name == "bootstrap-stage0-stdenv-darwin" then
if
!pkgs.stdenv.hostPlatform.isDarwin
|| pkgs.stdenv.name == "bootstrap-stage0-stdenv-darwin"
|| !(pkgs.stdenv ? __bootPackages)
then
prev.darwin.sourceRelease
else
f pkgs.stdenv.__bootPackages pkgs;
@@ -15,7 +15,7 @@
enableOpenSSL ? true,
openssl,
enableXXHash ? true,
xxHash,
xxhash,
enableZstd ? true,
zstd,
nixosTests,
@@ -55,7 +55,7 @@ stdenv.mkDerivation rec {
++ lib.optional enableZstd zstd
++ lib.optional enableLZ4 lz4
++ lib.optional enableOpenSSL openssl
++ lib.optional enableXXHash xxHash;
++ lib.optional enableXXHash xxhash;
configureFlags = [
(lib.enableFeature enableLZ4 "lz4")
@@ -24,7 +24,7 @@ let
lib.optionalString (num != null) ''
-I ${num}/lib/ocaml/${ocaml.version}/site-lib/num \
-I ${num}/lib/ocaml/${ocaml.version}/site-lib/top-num \
-I ${num}/lib/ocaml/${ocaml.version}/site-lib/stublibs \
-I ${num}/lib/ocaml/${ocaml.version}/site-lib/stublibs
'';
start_script = ''
@@ -9,6 +9,7 @@
lib,
stdenv,
fetchurl,
fetchpatch,
apr,
aprutil,
zlib,
@@ -81,7 +82,18 @@ let
++ lib.optional perlBindings perl
++ lib.optional saslSupport sasl;
patches = [ ./apr-1.patch ] ++ extraPatches;
patches = [
./apr-1.patch
# swig-4.4 support:
# https://lists.apache.org/thread/7rtyfcmg737bnmnrwf6bjmlxx4wpq2og
(fetchpatch {
name = "swig-4.4.patch";
url = "https://github.com/apache/subversion/commit/bf72420e86059a894fa3aacbbd6e3bee9286e46e.patch";
hash = "sha256-0X9y/0qDDctKo1vu86pKu3k79zIqhOhQU9rvyG4v6jg=";
})
]
++ extraPatches;
# remove vendored swig-3 files as these will shadow the swig provided
# ones and result in compile errors
@@ -66,7 +66,7 @@ stdenv.mkDerivation rec {
postFixup = ''
wrapProgram $out/bin/krunvm \
--prefix PATH : ${lib.makeBinPath [ buildah ]} \
--prefix PATH : ${lib.makeBinPath [ buildah ]}
'';
meta = {
+38 -26
View File
@@ -12,10 +12,35 @@ STDOUT->autoflush(1);
$SIG{__WARN__} = sub { warn "pkgs.buildEnv warning: ", @_ };
$SIG{__DIE__} = sub { die "pkgs.buildEnv error: ", @_ };
my $out = $ENV{"out"};
my $extraPrefix = $ENV{"extraPrefix"};
my $out;
my $extraPrefix;
my @pathsToLink;
my $ignoreCollisions;
my $checkCollisionContents;
my $ignoreSingleFileOutputs;
my @chosenOutputsRefs;
my $extraPathsFrom;
my $manifest;
my @pathsToLink = @{decode_json $ENV{"pathsToLinkJSON"}};
if ($ENV{"NIX_ATTRS_JSON_FILE"} // "") {
open FILE, $ENV{"NIX_ATTRS_JSON_FILE"} or die "cannot open structured attrs JSON file $ENV{NIX_ATTRS_JSON_FILE}: $!";
my $json_text = do { local $/; <FILE> };
my $attrsFromJSONRef = decode_json $json_text;
close FILE;
my $outputsRef = $attrsFromJSONRef->{"outputs"};
$out = $outputsRef->{"out"} // (values %{$outputsRef})[0];
$extraPrefix = $attrsFromJSONRef->{"extraPrefix"};
@pathsToLink = @{$attrsFromJSONRef->{"pathsToLink"}};
$ignoreCollisions = $attrsFromJSONRef->{"ignoreCollisions"};
$checkCollisionContents = $attrsFromJSONRef->{"checkCollisionContents"};
$ignoreSingleFileOutputs = $attrsFromJSONRef->{"ignoreSingleFileOutputs"};
@chosenOutputsRefs = @{$attrsFromJSONRef->{"chosenOutputs"}};
$extraPathsFrom = $attrsFromJSONRef->{"extraPathsFrom"};
$manifest = $attrsFromJSONRef->{"manifest"};
} else {
die "missing required environment variable NIX_ATTRS_JSON_FILE";
}
sub isInPathsToLink($path) {
$path = "/" if $path eq "";
@@ -210,26 +235,15 @@ sub addPkg($pkgDir, $ignoreCollisions, $checkCollisionContents, $priority, $igno
}
}
# Read packages list.
my $pkgs;
if (exists $ENV{"pkgsPath"}) {
open FILE, $ENV{"pkgsPath"};
$pkgs = <FILE>;
close FILE;
} else {
$pkgs = $ENV{"pkgs"}
}
# Symlink to the packages that have been installed explicitly by the
# user.
for my $pkg (@{decode_json $pkgs}) {
for my $pkg (@chosenOutputsRefs) {
for my $path (@{$pkg->{paths}}) {
addPkg($path,
$ENV{"ignoreCollisions"} eq "1",
$ENV{"checkCollisionContents"} eq "1",
$ignoreCollisions,
$checkCollisionContents,
$pkg->{priority},
$ENV{"ignoreSingleFileOutputs"} eq "1")
$ignoreSingleFileOutputs)
if -e $path;
}
}
@@ -244,21 +258,20 @@ while (scalar(keys %postponed) > 0) {
my @pkgDirs = keys %postponed;
%postponed = ();
foreach my $pkgDir (sort @pkgDirs) {
addPkg($pkgDir, 2, $ENV{"checkCollisionContents"} eq "1", $priorityCounter++, $ENV{"ignoreSingleFileOutputs"} eq "1");
addPkg($pkgDir, 2, $checkCollisionContents, $priorityCounter++, $ignoreSingleFileOutputs);
}
}
my $extraPathsFilePath = $ENV{"extraPathsFrom"};
if ($extraPathsFilePath) {
open FILE, $extraPathsFilePath or die "cannot open extra paths file $extraPathsFilePath: $!";
if ($extraPathsFrom) {
open FILE, $extraPathsFrom or die "cannot open extra paths file $extraPathsFrom: $!";
while(my $line = <FILE>) {
chomp $line;
addPkg($line,
$ENV{"ignoreCollisions"} eq "1",
$ENV{"checkCollisionContents"} eq "1",
$ignoreCollisions,
$checkCollisionContents,
1000,
$ENV{"ignoreSingleFileOutputs"} eq "1")
$ignoreSingleFileOutputs)
if -d $line;
}
@@ -286,7 +299,6 @@ foreach my $relName (sort keys %symlinks) {
print STDERR "created $nrLinks symlinks in user environment\n";
my $manifest = $ENV{"manifest"};
if ($manifest) {
symlink($manifest, "$out/manifest") or die "cannot create manifest";
}
+139 -101
View File
@@ -1,9 +1,9 @@
# buildEnv creates a tree of symlinks to the specified paths. This is
# a fork of the hardcoded buildEnv in the Nix distribution.
# buildEnv creates a tree of symlinks to the specified paths.
# This is a fork of the hardcoded buildEnv in the Nix distribution.
{
buildPackages,
runCommand,
stdenvNoCC,
lib,
replaceVars,
writeClosure,
@@ -15,115 +15,153 @@ let
};
in
# Backward compatibility for deprecated custom overrider <env-pkg>.override
# TODO(@ShamrockLee): Warn, throw and remove after tree-wide transition.
lib.makeOverridable (
{
name ? lib.throwIf (
pname == null || version == null
) "buildEnv: expect arguments 'pname' and 'version' or 'name'" "${pname}-${version}",
pname ? null,
version ? null,
lib.extendMkDerivation {
constructDrv = stdenvNoCC.mkDerivation;
excludeDrvArgNames = [
# Override these arguments directly
"derivationArgs"
# The manifest file (if any). A symlink $out/manifest will be
# created to it.
manifest ? "",
# The paths to symlink.
paths,
# Whether to ignore collisions or abort.
ignoreCollisions ? false,
# Whether to ignore outputs that are a single file instead of a directory.
ignoreSingleFileOutputs ? false,
# Whether to include closures of all input paths.
includeClosures ? false,
# If there is a collision, check whether the contents and permissions match
# and only if not, throw a collision error.
checkCollisionContents ? true,
# The paths (relative to each element of `paths') that we want to
# symlink (e.g., ["/bin"]). Any file not inside any of the
# directories in the list is not symlinked.
pathsToLink ? [ "/" ],
# The package outputs to include. By default, only the default
# output is included.
extraOutputsToInstall ? [ ],
# Root the result in directory "$out${extraPrefix}", e.g. "/share".
extraPrefix ? "",
# Shell commands to run after building the symlink tree.
postBuild ? "",
# Additional inputs
nativeBuildInputs ? [ ], # Handy e.g. if using makeWrapper in `postBuild`.
buildInputs ? [ ],
passthru ? { },
meta ? { },
}:
let
chosenOutputs = map (drv: {
paths =
# First add the usual output(s): respect if user has chosen explicitly,
# and otherwise use `meta.outputsToInstall`. The attribute is guaranteed
# to exist in mkDerivation-created cases. The other cases (e.g. runCommand)
# aren't expected to have multiple outputs.
(
if
(!drv ? outputSpecified || !drv.outputSpecified) && drv.meta.outputsToInstall or null != null
then
map (outName: drv.${outName}) drv.meta.outputsToInstall
else
[ drv ]
)
# Add any extra outputs specified by the caller of `buildEnv`.
++ lib.filter (p: p != null) (map (outName: drv.${outName} or null) extraOutputsToInstall);
priority = drv.meta.priority or lib.meta.defaultPriority;
}) paths;
pathsForClosure = lib.pipe chosenOutputs [
(map (p: p.paths))
lib.flatten
(lib.remove null)
# `meta.outputsToInstall` and `extraOutputsToInstall` does not necessarily include the first
# element of outputs, while the outPath of the latter will be the string-interpolated result.
# Exclude to prevent unexpected context.
"paths"
];
in
runCommand name
(
rec {
extendDrvArgs =
finalAttrs:
{
# The manifest file (if any). A symlink $out/manifest will be
# created to it.
manifest ? "",
# The paths to symlink.
paths,
# Whether to ignore collisions or abort.
ignoreCollisions ? false,
# Whether to ignore outputs that are a single file instead of a directory.
ignoreSingleFileOutputs ? false,
# Whether to include closures of all input paths.
includeClosures ? false,
# If there is a collision, check whether the contents and permissions match
# and only if not, throw a collision error.
checkCollisionContents ? true,
# The paths (relative to each element of `paths') that we want to
# symlink (e.g., ["/bin"]). Any file not inside any of the
# directories in the list is not symlinked.
pathsToLink ? [ "/" ],
# The package outputs to include. By default, only the default
# output is included.
extraOutputsToInstall ? [ ],
# Root the result in directory "$out${extraPrefix}", e.g. "/share".
extraPrefix ? "",
# Shell commands to run after building the symlink tree.
postBuild ? "",
passthru ? { },
meta ? { },
# Additional stdenv.mkDerivation arguments
# such as nativeBuildInputs/buildInputs for postBuild dependencies.
derivationArgs ? { },
# Placeholder name arguments.
name ? null,
pname ? null,
version ? null,
# `stdenv.mkDerivation` args before introducing derivationArgs.
nativeBuildInputs ? null,
buildInputs ? null,
}@args:
let
compatArgs =
lib.optionalAttrs (args ? nativeBuildInputs) {
inherit nativeBuildInputs;
}
// lib.optionalAttrs (args ? buildInputs) {
inherit buildInputs;
};
in
compatArgs
// derivationArgs
// {
# Explicitly opt in: builder.pl reads all configuration from file $ENV["NIX_ATTRS_JSON_FILE"].
__structuredAttrs = true;
inherit
extraOutputsToInstall
manifest
ignoreCollisions
checkCollisionContents
ignoreSingleFileOutputs
passthru
includeClosures
meta
pathsToLink
extraPrefix
postBuild
nativeBuildInputs
buildInputs
;
pathsToLinkJSON = builtins.toJSON pathsToLink;
pkgs = builtins.toJSON chosenOutputs;
extraPathsFrom = lib.optional includeClosures (writeClosure pathsForClosure);
preferLocalBuild = true;
allowSubstitutes = false;
# XXX: The size is somewhat arbitrary
passAsFile = if builtins.stringLength pkgs >= 128 * 1024 then [ "pkgs" ] else [ ];
}
// lib.optionalAttrs (pname != null) {
inherit pname;
}
// lib.optionalAttrs (version != null) {
inherit version;
}
)
''
${buildPackages.perl}/bin/perl -w ${builder}
eval "$postBuild"
''
chosenOutputs = map (drv: {
paths =
# First add the usual output(s): respect if user has chosen explicitly,
# and otherwise use `meta.outputsToInstall`. The attribute is guaranteed
# to exist in mkDerivation-created cases. The other cases (e.g. runCommand)
# aren't expected to have multiple outputs.
(
if
(!drv ? outputSpecified || !drv.outputSpecified) && drv.meta.outputsToInstall or null != null
then
map (outName: drv.${outName}) drv.meta.outputsToInstall
else
[ drv ]
)
# Add any extra outputs specified by the caller of `buildEnv`.
++ lib.filter (p: p != null) (
map (outName: drv.${outName} or null) finalAttrs.extraOutputsToInstall
);
priority = drv.meta.priority or lib.meta.defaultPriority;
# Silently use the original `paths` if `passthru.paths` is missing.
}) finalAttrs.passthru.paths or paths;
extraPathsFrom = lib.optionalString finalAttrs.includeClosures (
let
pathsForClosure = lib.pipe finalAttrs.chosenOutputs [
(map (p: p.paths))
lib.flatten
(lib.remove null)
];
in
writeClosure pathsForClosure
);
preferLocalBuild = derivationArgs.preferLocalBuild or true;
allowSubstitutes = derivationArgs.allowSubstitutes or false;
buildCommand = ''
${buildPackages.perl}/bin/perl -w ${builder}
eval "$postBuild"
'';
passthru = {
# The `paths` attribute is referenced and overridden from passthru
inherit paths;
}
// derivationArgs.passthru or { }
// passthru;
};
# Function argument set pattern doesn't have an ellipsis
inheritFunctionArgs = false;
}
)
+12 -10
View File
@@ -786,29 +786,31 @@ stdenvNoCC.mkDerivation {
# This confuses libtool. So add it to the compiler tool search
# path explicitly.
+ optionalString (!nativeTools && !isArocc) ''
ccLDFlags=()
ccCFlags=()
if [ -e "${cc_solib}/lib64" -a ! -L "${cc_solib}/lib64" ]; then
ccLDFlags+=" -L${cc_solib}/lib64"
ccCFlags+=" -B${cc_solib}/lib64"
ccLDFlags+=("-L${cc_solib}/lib64")
ccCFlags+=("-B${cc_solib}/lib64")
fi
ccLDFlags+=" -L${cc_solib}/lib"
ccCFlags+=" -B${cc_solib}/lib"
ccLDFlags+=("-L${cc_solib}/lib")
ccCFlags+=("-B${cc_solib}/lib")
''
+ optionalString (cc.langAda or false && !isArocc) ''
touch "$out/nix-support/gnat-cflags"
touch "$out/nix-support/gnat-ldflags"
basePath=$(echo $cc/lib/*/*/*)
ccCFlags+=" -B$basePath -I$basePath/adainclude"
ccCFlags+=("-B$basePath" "-I$basePath/adainclude")
gnatCFlags="-I$basePath/adainclude -I$basePath/adalib"
echo "$gnatCFlags" >> $out/nix-support/gnat-cflags
''
+ ''
echo "$ccLDFlags" >> $out/nix-support/cc-ldflags
echo "$ccCFlags" >> $out/nix-support/cc-cflags
echo "''${ccLDFlags[*]}" >> $out/nix-support/cc-ldflags
echo "''${ccCFlags[*]}" >> $out/nix-support/cc-cflags
''
+ optionalString (targetPlatform.isDarwin && (libcxx != null) && (cc.isClang or false)) ''
echo " -L${libcxx_solib}" >> $out/nix-support/cc-ldflags
echo "-L${libcxx_solib}" >> $out/nix-support/cc-ldflags
''
## Prevent clang from seeing /usr/include. There is a desire to achieve this
@@ -830,7 +832,7 @@ stdenvNoCC.mkDerivation {
&& !targetPlatform.isAndroid
)
''
echo " -nostdlibinc" >> $out/nix-support/cc-cflags
echo "-nostdlibinc" >> $out/nix-support/cc-cflags
''
##
@@ -867,7 +869,7 @@ stdenvNoCC.mkDerivation {
);
in
optionalString enable_fp ''
echo " -fno-omit-frame-pointer ${optionalString enable_leaf_fp "-mno-omit-leaf-frame-pointer "}" >> $out/nix-support/cc-cflags-before
echo "-fno-omit-frame-pointer${optionalString enable_leaf_fp " -mno-omit-leaf-frame-pointer"}" >> $out/nix-support/cc-cflags-before
''
)
@@ -95,9 +95,9 @@ npmConfigHook() {
fi
export CACHE_MAP_PATH="$TMP/MEOW"
@prefetchNpmDeps@ --map-cache
npmDeps="$npmDeps" @prefetchNpmDeps@ --map-cache
@prefetchNpmDeps@ --fixup-lockfile "$srcLockfile"
npmDeps="$npmDeps" @prefetchNpmDeps@ --fixup-lockfile "$srcLockfile"
local cachePath
@@ -12,6 +12,7 @@ let
match
elemAt
toJSON
toFile
removeAttrs
;
inherit (lib) importJSON mapAttrs;
@@ -165,18 +166,15 @@ lib.fix (self: {
{
inherit pname version;
passAsFile = [
"package"
"packageLock"
];
package = toJSON packageJSON';
packageLock = toJSON packageLock';
__structuredAttrs = true;
}
''
mkdir $out
cp "$packagePath" $out/package.json
cp "$packageLockPath" $out/package-lock.json
printf "%s" "$package" > $out/package.json
printf "%s" "$packageLock" > $out/package-lock.json
'';
# Build node modules from package.json & package-lock.json
@@ -188,6 +186,11 @@ lib.fix (self: {
nodejs,
derivationArgs ? { },
}:
let
# Backwards compatibility: if derivationArgs contains passAsFile,
# we can't force structuredAttrs here yet.
__structuredAttrs = !(derivationArgs ? passAsFile);
in
stdenv.mkDerivation (
{
pname = derivationArgs.pname or "${getName package}-node-modules";
@@ -221,17 +224,29 @@ lib.fix (self: {
++ lib.optionals stdenv.hostPlatform.isDarwin [ cctools ]
++ derivationArgs.nativeBuildInputs or [ ];
postPatch =
(
if __structuredAttrs then
''
printf "%s" "$package" > package.json
printf "%s" "$packageLock" > package-lock.json
''
else
''
cp --no-preserve=mode "$packagePath" package.json
cp --no-preserve=mode "$packageLockPath" package-lock.json
''
)
+ derivationArgs.postPatch or "";
inherit __structuredAttrs;
}
// lib.optionalAttrs (!__structuredAttrs) {
passAsFile = [
"package"
"packageLock"
]
++ derivationArgs.passAsFile or [ ];
postPatch = ''
cp --no-preserve=mode "$packagePath" package.json
cp --no-preserve=mode "$packageLockPath" package-lock.json
''
+ derivationArgs.postPatch or "";
++ derivationArgs.passAsFile;
}
);
@@ -263,7 +263,7 @@
exit 1
fi
prefetch-npm-deps $srcLockfile $out
outputHash="${hash_.outputHash}" prefetch-npm-deps $srcLockfile $out
runHook postBuild
'';
@@ -274,29 +274,31 @@
# `{ "registry.example.com": "example-registry-bearer-token", ... }`
impureEnvVars = lib.fetchers.proxyImpureEnvVars ++ [ "NIX_NPM_TOKENS" ];
NIX_NPM_REGISTRY_OVERRIDES = npmRegistryOverridesString;
env = {
NIX_NPM_REGISTRY_OVERRIDES = npmRegistryOverridesString;
# Fetcher version controls which features are enabled in prefetch-npm-deps
# Version 2+ enables packument fetching for workspace support
NPM_FETCHER_VERSION = toString fetcherVersion;
# Fetcher version controls which features are enabled in prefetch-npm-deps
# Version 2+ enables packument fetching for workspace support
NPM_FETCHER_VERSION = toString fetcherVersion;
SSL_CERT_FILE =
if
(
hash_.outputHash == ""
|| hash_.outputHash == lib.fakeSha256
|| hash_.outputHash == lib.fakeSha512
|| hash_.outputHash == lib.fakeHash
)
then
"${cacert}/etc/ssl/certs/ca-bundle.crt"
else
"/no-cert-file.crt";
SSL_CERT_FILE =
if
(
hash_.outputHash == ""
|| hash_.outputHash == lib.fakeSha256
|| hash_.outputHash == lib.fakeSha512
|| hash_.outputHash == lib.fakeHash
)
then
"${cacert}/etc/ssl/certs/ca-bundle.crt"
else
"/no-cert-file.crt";
}
// forceGitDeps_
// forceEmptyCache_;
outputHashMode = "recursive";
}
// hash_
// forceGitDeps_
// forceEmptyCache_
);
}
@@ -57,7 +57,7 @@ pub fn get_url(url: &Url) -> Result<Body, anyhow::Error> {
&& let Ok(tokens) = serde_json::from_str::<Map<String, Value>>(&npm_tokens)
&& let Some(token) = tokens.get(host).and_then(serde_json::Value::as_str)
{
info!("Found NPM token for {host}. Adding authorization header to request.");
info!("Found npm token for {host}. Adding authorization header to request.");
request = request.header("Authorization", format!("Bearer {token}"));
}
+20 -14
View File
@@ -263,26 +263,32 @@ let
vendorDir =
runCommand "cargo-vendor-dir"
(
if lockFile == null then
{
inherit lockFileContents;
passAsFile = [ "lockFileContents" ];
}
else
{
passthru = {
inherit lockFile;
};
}
{
__structuredAttrs = true;
}
// (
if lockFile == null then
{
inherit lockFileContents;
}
else
{
passthru = {
inherit lockFile;
};
}
)
)
''
mkdir -p $out/.cargo
${
if lockFile != null then
"ln -s ${lockFile} $out/Cargo.lock"
if lockFile == null then
''
printf "%s" "$lockFileContents" > "$out/Cargo.lock"
''
else
"cp $lockFileContentsPath $out/Cargo.lock"
"ln -s ${lockFile} $out/Cargo.lock"
}
cat > $out/.cargo/config.toml <<EOF
+1 -1
View File
@@ -77,7 +77,7 @@
+ lib.optionalString (rustTargetPlatform != rustHostPlatform) ''
"CC_${stdenv.targetPlatform.rust.cargoEnvVarTarget}=${ccForTarget}" \
"CXX_${stdenv.targetPlatform.rust.cargoEnvVarTarget}=${cxxForTarget}" \
"CARGO_TARGET_${stdenv.targetPlatform.rust.cargoEnvVarTarget}_LINKER=${ccForTarget}" \
"CARGO_TARGET_${stdenv.targetPlatform.rust.cargoEnvVarTarget}_LINKER=${ccForTarget}"
'';
};
}
@@ -3,38 +3,38 @@
runCommand,
rustc-unwrapped,
sysroot ? null,
stdenvNoCC,
shell ? stdenvNoCC.shell,
}:
let
sysrootFlag = lib.optionalString (sysroot != null) "--sysroot ${sysroot}";
# Upstream rustc still assumes that musl = static[1]. The fix for
# this is to disable crt-static by default for non-static musl
# targets.
#
# Even though Cargo will build build.rs files for the build platform,
# cross-compiling _from_ musl appears to work fine, so we only need
# to do this when rustc's target platform is dynamically linked musl.
#
# [1]: https://github.com/rust-lang/compiler-team/issues/422
#
# WARNING: using defaultArgs is dangerous, as it will apply to all
# targets used by this compiler (host and target). This means
# that it can't be used to set arguments that should only be
# applied to the target. It's fine to do this for -crt-static,
# because rustc does not support +crt-static host platforms
# anyway.
defaultArgs = lib.optionalString (
with rustc-unwrapped.stdenv.targetPlatform; isMusl && !isStatic
) "-C target-feature=-crt-static";
in
runCommand "${rustc-unwrapped.pname}-wrapper-${rustc-unwrapped.version}"
{
preferLocalBuild = true;
strictDeps = true;
inherit (rustc-unwrapped) outputs;
env = {
sysroot = lib.optionalString (sysroot != null) "--sysroot ${sysroot}";
# Upstream rustc still assumes that musl = static[1]. The fix for
# this is to disable crt-static by default for non-static musl
# targets.
#
# Even though Cargo will build build.rs files for the build platform,
# cross-compiling _from_ musl appears to work fine, so we only need
# to do this when rustc's target platform is dynamically linked musl.
#
# [1]: https://github.com/rust-lang/compiler-team/issues/422
#
# WARNING: using defaultArgs is dangerous, as it will apply to all
# targets used by this compiler (host and target). This means
# that it can't be used to set arguments that should only be
# applied to the target. It's fine to do this for -crt-static,
# because rustc does not support +crt-static host platforms
# anyway.
defaultArgs = lib.optionalString (
with rustc-unwrapped.stdenv.targetPlatform; isMusl && !isStatic
) "-C target-feature=-crt-static";
};
passthru = {
inherit (rustc-unwrapped)
pname
@@ -58,10 +58,18 @@ runCommand "${rustc-unwrapped.pname}-wrapper-${rustc-unwrapped.version}"
mkdir -p $out/bin
ln -s ${rustc-unwrapped}/bin/* $out/bin
rm $out/bin/{rustc,rustdoc}
prog=${rustc-unwrapped}/bin/rustc extraFlagsVar=NIX_RUSTFLAGS \
substituteAll ${./rustc-wrapper.sh} $out/bin/rustc
prog=${rustc-unwrapped}/bin/rustdoc extraFlagsVar=NIX_RUSTDOCFLAGS \
substituteAll ${./rustc-wrapper.sh} $out/bin/rustdoc
substitute ${./rustc-wrapper.sh} $out/bin/rustc \
--replace-fail "@shell@" ${lib.escapeShellArg shell} \
--replace-fail "@sysrootFlag@" ${lib.escapeShellArg sysrootFlag} \
--replace-fail "@defaultArgs@" ${lib.escapeShellArg defaultArgs} \
--replace-fail "@prog@" ${lib.escapeShellArg rustc-unwrapped}/bin/rustc \
--replace-fail "@extraFlagsVar@" "NIX_RUSTFLAGS"
substitute ${./rustc-wrapper.sh} $out/bin/rustdoc \
--replace-fail "@shell@" ${lib.escapeShellArg shell} \
--replace-fail "@sysrootFlag@" ${lib.escapeShellArg sysrootFlag} \
--replace-fail "@defaultArgs@" ${lib.escapeShellArg defaultArgs} \
--replace-fail "@prog@" ${lib.escapeShellArg rustc-unwrapped}/bin/rustdoc \
--replace-fail "@extraFlagsVar@" "NIX_RUSTDOCFLAGS"
chmod +x $out/bin/{rustc,rustdoc}
${lib.concatMapStrings (output: "ln -s ${rustc-unwrapped.${output}} \$${output}\n") (
lib.remove "out" rustc-unwrapped.outputs
@@ -1,6 +1,6 @@
#!@shell@
defaultSysroot=(@sysroot@)
defaultSysroot=(@sysrootFlag@)
for arg; do
case "$arg" in
+2
View File
@@ -23,6 +23,8 @@ stdenv.mkDerivation (finalAttrs: {
"--enable-shared"
# Define inline as __attribute__ ((__always_inline__))
"ac_cv_c_inline=yes"
# C23 (Clang default w/ autoconf 2.73) rejects K&R-style declarations
"CFLAGS=-std=gnu17"
];
makeFlags = [ "AR=${stdenv.cc.targetPrefix}ar" ];
+2 -2
View File
@@ -14,13 +14,13 @@
stdenv.mkDerivation (finalAttrs: {
pname = "ada";
version = "3.4.3";
version = "3.4.4";
src = fetchFromGitHub {
owner = "ada-url";
repo = "ada";
tag = "v${finalAttrs.version}";
hash = "sha256-CSFo5aXxN1jhmD9SUh8XysObEyOvm53XPzbwJyCE0WE=";
hash = "sha256-kfUbsqQ+CsqnySKgeL1GFJLcDe1Irivp4CoZG93BZYg=";
};
nativeBuildInputs = [
+2 -2
View File
@@ -25,7 +25,7 @@
triehash,
udev,
w3m,
xxHash,
xxhash,
xz,
zstd,
withDocs ? true,
@@ -84,7 +84,7 @@ stdenv.mkDerivation (finalAttrs: {
lz4
p11-kit
udev
xxHash
xxhash
xz
zstd
]
+8 -12
View File
@@ -2,7 +2,6 @@
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
cmake,
zlib,
nix-update-script,
@@ -10,7 +9,7 @@
stdenv.mkDerivation (finalAttrs: {
pname = "assimp";
version = "6.0.2";
version = "6.0.4";
outputs = [
"out"
"lib"
@@ -21,18 +20,15 @@ stdenv.mkDerivation (finalAttrs: {
owner = "assimp";
repo = "assimp";
tag = "v${finalAttrs.version}";
hash = "sha256-ixtqK+3iiL17GEbEVHz5S6+gJDDQP7bVuSfRMJMGEOY=";
hash = "sha256-ryTgsN0z9BZBz7i9aUMKuneN5oqfxpduwJlb+Q0q3Mk=";
};
patches = [
# Fix build with gcc15
# https://github.com/assimp/assimp/pull/6283
(fetchpatch {
name = "assimp-fix-invalid-vector-gcc15.patch";
url = "https://github.com/assimp/assimp/commit/59bc03d931270b6354690512d0c881eec8b97678.patch";
hash = "sha256-O+JPwcOdyFtmFE7eZojHo1DUavF5EhLYlUyxtYo/KF4=";
})
];
postPatch = ''
# nix build sandbox does not set /var/tmp up:
# https://github.com/assimp/assimp/issues/6270
substituteInPlace test/unit/UnitTestFileGenerator.h \
--replace-fail 'define TMP_PATH "/var/tmp/"' 'define TMP_PATH "/tmp/"'
'';
nativeBuildInputs = [ cmake ];
+1 -1
View File
@@ -27,7 +27,7 @@ python3.pkgs.buildPythonApplication (finalAttrs: {
postPatch = ''
substituteInPlace setup.py \
--replace "boto3>=1.34.75" "boto3>=1.34.58" \
--replace "boto3>=1.34.75" "boto3>=1.34.58"
'';
nativeCheckInputs = with python3.pkgs; [
@@ -56,7 +56,7 @@ stdenv.mkDerivation (finalAttrs: {
tests/volume-control-test.cc \
--replace-quiet 'loop(50)' 'loop(500)' \
--replace-quiet 'loop(100)' 'loop(1000)' \
--replace-quiet 'loop(500)' 'loop(5000)' \
--replace-quiet 'loop(500)' 'loop(5000)'
'';
strictDeps = true;
+1 -1
View File
@@ -57,7 +57,7 @@ stdenvNoCC.mkDerivation (finalAttrs: {
export PATH=$PATH:$out/bin
installShellCompletion --cmd bleep \
--bash <(bleep install-tab-completions-bash --stdout) \
--zsh <(bleep install-tab-completions-zsh --stdout) \
--zsh <(bleep install-tab-completions-zsh --stdout)
'';
passthru.tests.version = testers.testVersion {
+1 -1
View File
@@ -51,7 +51,7 @@ stdenv.mkDerivation (finalAttrs: {
cctools.libtool
];
# Required for `sharp` NPM dependency
# Required for `sharp` npm dependency
buildInputs = [ vips ];
pnpmDeps = fetchPnpmDeps {
+2 -2
View File
@@ -10,14 +10,14 @@
stdenv.mkDerivation (finalAttrs: {
pname = "bluez-headers";
version = "5.84";
version = "5.86";
# This package has the source, because of the emulatorAvailable check in the
# bluez function args, that causes an infinite recursion with Python on cross
# builds.
src = fetchurl {
url = "mirror://kernel/linux/bluetooth/bluez-${finalAttrs.version}.tar.xz";
hash = "sha256-W6c9Aw97AAh9Z4ALDjIWAa7A+JKCfHLlosg5DYyIaxE=";
hash = "sha256-mfFEVAxgcFkeTFO8uXfrQmZMYrezbLNaKc9y3tM5Yh0=";
};
dontConfigure = true;
+2 -2
View File
@@ -10,11 +10,11 @@
stdenv.mkDerivation (finalAttrs: {
pname = "bmake";
version = "20251111";
version = "20260313";
src = fetchurl {
url = "https://www.crufty.net/ftp/pub/sjg/bmake-${finalAttrs.version}.tar.gz";
hash = "sha256-RaP4UVZ3uo85M9ghP0u2EaXDyIOAvi5GIi+kRwlQYGA=";
hash = "sha256-dsjzzULuBc/7R7zIElbj1edCb00I5zN4i0WYXe30+XU=";
};
patches = [
+1 -1
View File
@@ -60,7 +60,7 @@ stdenvNoCC.mkDerivation rec {
gnugrep
busybox
]
} \
}
'';
meta = {
+2 -2
View File
@@ -9,7 +9,7 @@
openssh,
openssl,
python3,
xxHash,
xxhash,
zstd,
installShellFiles,
nixosTests,
@@ -62,7 +62,7 @@ python.pkgs.buildPythonApplication (finalAttrs: {
buildInputs = [
libb2
lz4
xxHash
xxhash
zstd
openssl
]
+2
View File
@@ -79,6 +79,8 @@ stdenv.mkDerivation (finalAttrs: {
makeFlags = [ "udevruledir=$(out)/lib/udev/rules.d" ];
separateDebugInfo = true;
outputs = [
"out"
"dev"
+2 -2
View File
@@ -14,13 +14,13 @@
stdenv.mkDerivation (finalAttrs: {
pname = "bubblewrap";
version = "0.11.0";
version = "0.11.1";
src = fetchFromGitHub {
owner = "containers";
repo = "bubblewrap";
rev = "v${finalAttrs.version}";
hash = "sha256-8IDMLQPeO576N1lizVudXUmTV6hNOiowjzRpEWBsZ+U=";
hash = "sha256-sp5XYkTuoL778p5xQRDtFbX0ocdJuRbVxJCkKbEUgZs=";
};
outputs = [
+2 -2
View File
@@ -9,13 +9,13 @@
stdenv.mkDerivation rec {
pname = "catch2";
version = "3.13.0";
version = "3.14.0";
src = fetchFromGitHub {
owner = "catchorg";
repo = "Catch2";
tag = "v${version}";
hash = "sha256-WKp6/NX1SQJFLijW/fKwbR1FRoboAklDiHT6WqPRBjw=";
hash = "sha256-tegAa+cNF7pJcW33B+VZ86ZlDG7dwS3o6QnN/XvTI2A=";
};
patches = lib.optionals stdenv.cc.isClang [
+1 -1
View File
@@ -80,7 +80,7 @@ stdenv.mkDerivation (finalAttrs: {
mv $out/bin/ls_parse.py $out/share/cbmc/ls_parse.py
chmod +x $out/share/cbmc/ls_parse.py
wrapProgram $out/bin/goto-cc \
--prefix PATH : "$out/share/cbmc" \
--prefix PATH : "$out/share/cbmc"
'';
env.NIX_CFLAGS_COMPILE = toString (
+2 -2
View File
@@ -9,7 +9,7 @@
perl,
fmt,
hiredis,
xxHash,
xxhash,
zstd,
bashInteractive,
doctest,
@@ -77,7 +77,7 @@ stdenv.mkDerivation (finalAttrs: {
buildInputs = [
fmt
hiredis
xxHash
xxhash
zstd
];
+4 -1
View File
@@ -2,7 +2,6 @@
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
autoreconfHook,
pkg-config,
libiconv,
@@ -40,6 +39,10 @@ stdenv.mkDerivation (finalAttrs: {
libao
];
env = {
am_cv_func_iconv_works = "yes";
};
hardeningDisable = [ "format" ];
# we have glibc/include/linux as a symlink to the kernel headers,
+3 -3
View File
@@ -23,14 +23,14 @@ in
stdenv.mkDerivation (finalAttrs: {
pname = "chameleon-cli";
version = "2.1.0-unstable-2026-04-06";
version = "2.1.0-unstable-2026-04-19";
src = fetchFromGitHub {
owner = "RfidResearchGroup";
repo = "ChameleonUltra";
rev = "93c1e150ab17b81cec40639fea7e88b1920e2c95";
rev = "75eb389fe97a18b5ba6c8754cdfa0ec716a2dcf1";
rootDir = "software";
hash = "sha256-5yxXmKRBNmmJgiA2E3gUmGRgPZpO/CRFlMw5YFCFUUs=";
hash = "sha256-RnP+j6ZZxE167Xr6C0Hs/d6zV8jjQUyI91Ya8JVMrcs=";
};
postPatch = ''
+2 -2
View File
@@ -26,7 +26,7 @@
shaderc,
lcms2,
libdovi,
xxHash,
xxhash,
kdePackages,
}:
@@ -79,7 +79,7 @@ stdenv.mkDerivation (finalAttrs: {
shaderc
lcms2
libdovi
xxHash
xxhash
];
env.NIX_CFLAGS_COMPILE = "-std=gnu17";
+1
View File
@@ -25,6 +25,7 @@ stdenv.mkDerivation {
configureFlags = [
"--enable-examples"
"--enable-devel"
"CFLAGS=-std=gnu17"
];
meta = {
+1 -1
View File
@@ -24,7 +24,7 @@ stdenv.mkDerivation (finalAttrs: {
postPatch = ''
substituteInPlace cmake/coost.pc.in \
--replace-fail '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \
--replace-fail '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ \
--replace-fail '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@
'';
nativeBuildInputs = [ cmake ];
+1 -1
View File
@@ -3,7 +3,7 @@
stdenvNoCC,
cacert,
yarn-berry,
nodejs-slim, # no need for NPM
nodejs-slim, # no need for npm
fetchFromGitHub,
nix-update-script,
versionCheckHook,
+2 -2
View File
@@ -25,7 +25,7 @@
stdenv.mkDerivation (finalAttrs: {
pname = "cryptsetup";
version = "2.8.4";
version = "2.8.6";
outputs = [
"bin"
@@ -39,7 +39,7 @@ stdenv.mkDerivation (finalAttrs: {
url =
"mirror://kernel/linux/utils/cryptsetup/v${lib.versions.majorMinor finalAttrs.version}/"
+ "cryptsetup-${finalAttrs.version}.tar.xz";
hash = "sha256-RD5G+JZMmsx4D0Va+7jiOqDo7X7FBM/FngT0BvoeioM=";
hash = "sha256-gAQmX9mTiF0I97Yz2+BWhR3hohAwdhOk693HQ/zO/lo=";
};
patches = [
+1 -1
View File
@@ -25,7 +25,7 @@ appimageTools.wrapType2 rec {
install -Dm444 ${contents}/cubelify-overlay.desktop -t $out/share/applications/
install -Dm444 ${contents}/cubelify-overlay.png -t $out/share/pixmaps/
substituteInPlace $out/share/applications/cubelify-overlay.desktop \
--replace-fail 'Exec=AppRun --no-sandbox %U' 'Exec=cubelify' \
--replace-fail 'Exec=AppRun --no-sandbox %U' 'Exec=cubelify'
'';
passthru.updateScript = ./update.sh;
+2 -2
View File
@@ -87,7 +87,7 @@ assert
stdenv.mkDerivation (finalAttrs: {
pname = "curl";
version = "8.18.0";
version = "8.19.0";
src = fetchurl {
urls = [
@@ -96,7 +96,7 @@ stdenv.mkDerivation (finalAttrs: {
builtins.replaceStrings [ "." ] [ "_" ] finalAttrs.version
}/curl-${finalAttrs.version}.tar.xz"
];
hash = "sha256-QN95Fm50qiAUk2XhHuTHmKRq1Xw05PaP0TEA4smpGUY=";
hash = "sha256-TrQUiXkNGeGQ16x+GOgoV83Wivj05mspLO1WLTM/Ed8=";
};
# this could be accomplished by updateAutotoolsGnuConfigScriptsHook, but that causes infinite recursion
+1
View File
@@ -80,6 +80,7 @@ stdenv.mkDerivation rec {
"--enable-login"
"--enable-shared"
]
++ lib.optional stdenv.cc.isClang "CFLAGS=-std=gnu17"
++ lib.optional enableLdap "--with-ldap=${openldap.dev}"
++ lib.optionals enableMySQL [
# https://github.com/cyrusimap/cyrus-sasl/blob/ac0c278817a082c625c496ec812318c019e0b96f/docsrc/sasl/installation.rst#build-configuration
+2 -2
View File
@@ -15,7 +15,7 @@
libgee,
gst_all_1,
sqlite,
xxHash,
xxhash,
}:
stdenv.mkDerivation (finalAttrs: {
@@ -51,7 +51,7 @@ stdenv.mkDerivation (finalAttrs: {
gst_all_1.gst-plugins-ugly
gst_all_1.gst-plugins-rs
sqlite
xxHash
xxhash
];
mesonFlags = [
+2 -2
View File
@@ -15,11 +15,11 @@
stdenv.mkDerivation (finalAttrs: {
pname = "dash";
version = "0.5.13.1";
version = "0.5.13.2";
src = fetchurl {
url = "http://gondor.apana.org.au/~herbert/dash/files/dash-${finalAttrs.version}.tar.gz";
hash = "sha256-2ScbzgnBJ9mGbiXAEVgt3HWrmIlYoEvE2FU6O48w43A=";
hash = "sha256-5xNoJrHu1s4xk+iv+i9wsbK5Fo3ZH/p9209G6eYgVP4=";
};
strictDeps = true;
+2 -2
View File
@@ -6,7 +6,7 @@
ninja,
nasm,
pkg-config,
xxHash,
xxhash,
withTools ? false, # "dav1d" binary
withExamples ? false,
SDL2, # "dav1dplay" binary
@@ -49,7 +49,7 @@ stdenv.mkDerivation (finalAttrs: {
];
# TODO: doxygen (currently only HTML and not build by default).
buildInputs = [
xxHash
xxhash
]
++ lib.optional withExamples SDL2
++ lib.optionals useVulkan [
+2 -2
View File
@@ -23,13 +23,13 @@ let
in
stdenv.mkDerivation (finalAttrs: {
pname = "davmail";
version = "6.5.1";
version = "6.6.0";
src = fetchFromGitHub {
owner = "mguessan";
repo = "davmail";
tag = finalAttrs.version;
hash = "sha256-D/MEWq696PFXlarQZdSrTS9VFODg7u7yhUsbCwHV9qs=";
hash = "sha256-La6nrbAGeZlIhs0i5dm6pIcvn+V1wQjuqBza4w+Aa3A=";
};
buildPhase = ''
+2 -2
View File
@@ -7,7 +7,7 @@
autoreconfHook,
pkg-config,
elfutils,
xxHash,
xxhash,
help2man,
util-linux,
cpio,
@@ -41,7 +41,7 @@ stdenv.mkDerivation (finalAttrs: {
buildInputs = [
elfutils
xxHash
xxhash
];
nativeCheckInputs = [

Some files were not shown because too many files have changed in this diff Show More