···11{ lib }:
22- let inherit (lib.attrsets) mapAttrs; in
22+33+let
44+ inherit (lib)
55+ any
66+ filterAttrs
77+ foldl
88+ hasInfix
99+ isFunction
1010+ isList
1111+ isString
1212+ mapAttrs
1313+ optional
1414+ optionalAttrs
1515+ optionalString
1616+ removeSuffix
1717+ replaceStrings
1818+ toUpper
1919+ ;
2020+2121+ inherit (lib.strings) toJSON;
32244-rec {
523 doubles = import ./doubles.nix { inherit lib; };
624 parse = import ./parse.nix { inherit lib; };
725 inspect = import ./inspect.nix { inherit lib; };
···2442 both arguments have been `elaborate`-d.
2543 */
2644 equals =
2727- let removeFunctions = a: lib.filterAttrs (_: v: !builtins.isFunction v) a;
4545+ let removeFunctions = a: filterAttrs (_: v: !isFunction v) a;
2846 in a: b: removeFunctions a == removeFunctions b;
29473048 /* List of all Nix system doubles the nixpkgs flake will expose the package set
···4159 # clearly preferred, and to prevent cycles. A simpler fixed point where the RHS
4260 # always just used `final.*` would fail on both counts.
4361 elaborate = args': let
4444- args = if lib.isString args' then { system = args'; }
6262+ args = if isString args' then { system = args'; }
4563 else args';
46644765 # TODO: deprecate args.rustc in favour of args.rust after 23.05 is EOL.
···96114 then "lib64"
97115 else "lib"
98116 else null;
9999- extensions = lib.optionalAttrs final.hasSharedLibraries {
117117+ extensions = optionalAttrs final.hasSharedLibraries {
100118 sharedLibrary =
101119 if final.isDarwin then ".dylib"
102120 else if final.isWindows then ".dll"
···134152 # uname -m
135153 processor =
136154 if final.isPower64
137137- then "ppc64${lib.optionalString final.isLittleEndian "le"}"
155155+ then "ppc64${optionalString final.isLittleEndian "le"}"
138156 else if final.isPower
139139- then "ppc${lib.optionalString final.isLittleEndian "le"}"
157157+ then "ppc${optionalString final.isLittleEndian "le"}"
140158 else if final.isMips64
141159 then "mips64" # endianness is *not* included on mips64
142160 else final.parsed.cpu.name;
···202220 else if final.isS390 && !final.isS390x then null
203221 else if final.isx86_64 then "x86_64"
204222 else if final.isx86 then "i386"
205205- else if final.isMips64n32 then "mipsn32${lib.optionalString final.isLittleEndian "el"}"
206206- else if final.isMips64 then "mips64${lib.optionalString final.isLittleEndian "el"}"
223223+ else if final.isMips64n32 then "mipsn32${optionalString final.isLittleEndian "el"}"
224224+ else if final.isMips64 then "mips64${optionalString final.isLittleEndian "el"}"
207225 else final.uname.processor;
208226209227 # Name used by UEFI for architectures.
···259277 if pkgs.stdenv.hostPlatform.canExecute final
260278 then "${pkgs.runtimeShell} -c '\"$@\"' --"
261279 else if final.isWindows
262262- then "${wine}/bin/wine${lib.optionalString (final.parsed.cpu.bits == 64) "64"}"
280280+ then "${wine}/bin/wine${optionalString (final.parsed.cpu.bits == 64) "64"}"
263281 else if final.isLinux && pkgs.stdenv.hostPlatform.isLinux && final.qemuArch != null
264282 then "${qemu-user}/bin/qemu-${final.qemuArch}"
265283 else if final.isWasi
···310328 let
311329 f = args.rustc.platform.target-family;
312330 in
313313- if builtins.isList f then f else [ f ]
331331+ if isList f then f else [ f ]
314332 )
315315- else lib.optional final.isUnix "unix"
316316- ++ lib.optional final.isWindows "windows";
333333+ else optional final.isUnix "unix"
334334+ ++ optional final.isWindows "windows";
317335318336 # https://doc.rust-lang.org/reference/conditional-compilation.html#target_vendor
319337 vendor = let
···337355 vendor_ = final.rust.platform.vendor;
338356 # TODO: deprecate args.rustc in favour of args.rust after 23.05 is EOL.
339357 in args.rust.rustcTarget or args.rustc.config
340340- or "${cpu_}-${vendor_}-${kernel.name}${lib.optionalString (abi.name != "unknown") "-${abi.name}"}";
358358+ or "${cpu_}-${vendor_}-${kernel.name}${optionalString (abi.name != "unknown") "-${abi.name}"}";
341359342360 # The name of the rust target if it is standard, or the json file
343361 # containing the custom target spec.
344362 rustcTargetSpec = rust.rustcTargetSpec or (
345363 /**/ if rust ? platform
346346- then builtins.toFile (final.rust.rustcTarget + ".json") (builtins.toJSON rust.platform)
364364+ then builtins.toFile (final.rust.rustcTarget + ".json") (toJSON rust.platform)
347365 else final.rust.rustcTarget);
348366349367 # The name of the rust target if it is standard, or the
···352370 #
353371 # This is the name used by Cargo for target subdirectories.
354372 cargoShortTarget =
355355- lib.removeSuffix ".json" (baseNameOf "${final.rust.rustcTargetSpec}");
373373+ removeSuffix ".json" (baseNameOf "${final.rust.rustcTargetSpec}");
356374357375 # When used as part of an environment variable name, triples are
358376 # uppercased and have all hyphens replaced by underscores:
···360378 # https://github.com/rust-lang/cargo/pull/9169
361379 # https://github.com/rust-lang/cargo/issues/8285#issuecomment-634202431
362380 cargoEnvVarTarget =
363363- lib.strings.replaceStrings ["-"] ["_"]
364364- (lib.strings.toUpper final.rust.cargoShortTarget);
381381+ replaceStrings ["-"] ["_"]
382382+ (toUpper final.rust.cargoShortTarget);
365383366384 # True if the target is no_std
367385 # https://github.com/rust-lang/rust/blob/2e44c17c12cec45b6a682b1e53a04ac5b5fcc9d2/src/bootstrap/config.rs#L415-L421
368386 isNoStdTarget =
369369- builtins.any (t: lib.hasInfix t final.rust.rustcTarget) ["-none" "nvptx" "switch" "-uefi"];
387387+ any (t: hasInfix t final.rust.rustcTarget) ["-none" "nvptx" "switch" "-uefi"];
370388 };
371389 };
372390 in assert final.useAndroidPrebuilt -> final.isAndroid;
373373- assert lib.foldl
391391+ assert foldl
374392 (pass: { assertion, message }:
375393 if assertion final
376394 then pass
···378396 true
379397 (final.parsed.abi.assertions or []);
380398 final;
399399+400400+in
401401+402402+# Everything in this attrset is the public interface of the file.
403403+{
404404+ inherit
405405+ architectures
406406+ doubles
407407+ elaborate
408408+ equals
409409+ examples
410410+ flakeExposed
411411+ inspect
412412+ parse
413413+ platforms
414414+ ;
381415}
+35-14
lib/systems/inspect.nix
···11{ lib }:
22-with import ./parse.nix { inherit lib; };
33-with lib.attrsets;
44-with lib.lists;
22+33+let
44+ inherit (lib)
55+ any
66+ attrValues
77+ concatMap
88+ filter
99+ hasPrefix
1010+ isList
1111+ mapAttrs
1212+ matchAttrs
1313+ recursiveUpdateUntil
1414+ toList
1515+ ;
1616+1717+ inherit (lib.strings) toJSON;
1818+1919+ inherit (lib.systems.parse)
2020+ kernels
2121+ kernelFamilies
2222+ significantBytes
2323+ cpuTypes
2424+ execFormats
2525+ ;
52666-let abis_ = abis; in
77-let abis = lib.mapAttrs (_: abi: builtins.removeAttrs abi [ "assertions" ]) abis_; in
2727+ abis = mapAttrs (_: abi: removeAttrs abi [ "assertions" ]) lib.systems.parse.abis;
2828+in
829930rec {
1031 # these patterns are to be matched against {host,build,target}Platform.parsed
···3253 isx86 = { cpu = { family = "x86"; }; };
3354 isAarch32 = { cpu = { family = "arm"; bits = 32; }; };
3455 isArmv7 = map ({ arch, ... }: { cpu = { inherit arch; }; })
3535- (lib.filter (cpu: lib.hasPrefix "armv7" cpu.arch or "")
3636- (lib.attrValues cpuTypes));
5656+ (filter (cpu: hasPrefix "armv7" cpu.arch or "")
5757+ (attrValues cpuTypes));
3758 isAarch64 = { cpu = { family = "arm"; bits = 64; }; };
3859 isAarch = { cpu = { family = "arm"; }; };
3960 isMicroBlaze = { cpu = { family = "microblaze"; }; };
···111132 let
112133 # patterns can be either a list or a (bare) singleton; turn
113134 # them into singletons for uniform handling
114114- pat1 = lib.toList pat1_;
115115- pat2 = lib.toList pat2_;
135135+ pat1 = toList pat1_;
136136+ pat2 = toList pat2_;
116137 in
117117- lib.concatMap (attr1:
138138+ concatMap (attr1:
118139 map (attr2:
119119- lib.recursiveUpdateUntil
140140+ recursiveUpdateUntil
120141 (path: subattr1: subattr2:
121142 if (builtins.intersectAttrs subattr1 subattr2) == {} || subattr1 == subattr2
122143 then true
123144 else throw ''
124145 pattern conflict at path ${toString path}:
125125- ${builtins.toJSON subattr1}
126126- ${builtins.toJSON subattr2}
146146+ ${toJSON subattr1}
147147+ ${toJSON subattr2}
127148 '')
128149 attr1
129150 attr2
···132153 pat1;
133154134155 matchAnyAttrs = patterns:
135135- if builtins.isList patterns then attrs: any (pattern: matchAttrs pattern attrs) patterns
156156+ if isList patterns then attrs: any (pattern: matchAttrs pattern attrs) patterns
136157 else matchAttrs patterns;
137158138159 predicates = mapAttrs (_: matchAnyAttrs) patterns;
+51-17
lib/systems/parse.nix
···1515# systems that overlap with existing ones and won't notice something amiss.
1616#
1717{ lib }:
1818-with lib.lists;
1919-with lib.types;
2020-with lib.attrsets;
2121-with lib.strings;
2222-with (import ./inspect.nix { inherit lib; }).predicates;
23182419let
2525- inherit (lib.options) mergeOneOption;
2020+ inherit (lib)
2121+ all
2222+ any
2323+ attrValues
2424+ elem
2525+ elemAt
2626+ hasPrefix
2727+ id
2828+ length
2929+ mapAttrs
3030+ mergeOneOption
3131+ optionalString
3232+ splitString
3333+ versionAtLeast
3434+ ;
3535+3636+ inherit (lib.strings) match;
3737+3838+ inherit (lib.systems.inspect.predicates)
3939+ isAarch32
4040+ isBigEndian
4141+ isDarwin
4242+ isLinux
4343+ isPower64
4444+ isWindows
4545+ ;
4646+4747+ inherit (lib.types)
4848+ enum
4949+ float
5050+ isType
5151+ mkOptionType
5252+ number
5353+ setType
5454+ string
5555+ types
5656+ ;
26572758 setTypes = type:
2859 mapAttrs (name: value:
···3364 # regex `e?abi.*$` when determining the validity of a triple. In
3465 # other words, `i386-linuxabichickenlips` is a valid triple.
3566 removeAbiSuffix = x:
3636- let match = builtins.match "(.*)e?abi.*" x;
3737- in if match==null
6767+ let found = match "(.*)e?abi.*" x;
6868+ in if found == null
3869 then x
3939- else lib.elemAt match 0;
7070+ else elemAt found 0;
40714172in
4273···7610777108 types.cpuType = enum (attrValues cpuTypes);
781097979- cpuTypes = with significantBytes; setTypes types.openCpuType {
110110+ cpuTypes = let inherit (significantBytes) bigEndian littleEndian; in setTypes types.openCpuType {
80111 arm = { bits = 32; significantByte = littleEndian; family = "arm"; };
81112 armv5tel = { bits = 32; significantByte = littleEndian; family = "arm"; version = "5"; arch = "armv5t"; };
82113 armv6m = { bits = 32; significantByte = littleEndian; family = "arm"; version = "6"; arch = "armv6-m"; };
···166197 # Note: Since 22.11 the archs of a mode switching CPU are no longer considered
167198 # pairwise compatible. Mode switching implies that binaries built for A
168199 # and B respectively can't be executed at the same time.
169169- isCompatible = a: b: with cpuTypes; lib.any lib.id [
200200+ isCompatible = with cpuTypes; a: b: any id [
170201 # x86
171202 (b == i386 && isCompatible a i486)
172203 (b == i486 && isCompatible a i586)
···287318288319 types.kernel = enum (attrValues kernels);
289320290290- kernels = with execFormats; with kernelFamilies; setTypes types.openKernel {
321321+ kernels = let
322322+ inherit (execFormats) elf pe wasm unknown macho;
323323+ inherit (kernelFamilies) bsd darwin;
324324+ in setTypes types.openKernel {
291325 # TODO(@Ericson2314): Don't want to mass-rebuild yet to keeping 'darwin' as
292326 # the normalized name for macOS.
293327 macos = { execFormat = macho; families = { inherit darwin; }; name = "darwin"; };
···359393 The "gnu" ABI is ambiguous on 32-bit ARM. Use "gnueabi" or "gnueabihf" instead.
360394 '';
361395 }
362362- { assertion = platform: with platform; !(isPower64 && isBigEndian);
396396+ { assertion = platform: !(platform.isPower64 && platform.isBigEndian);
363397 message = ''
364398 The "gnu" ABI is ambiguous on big-endian 64-bit PowerPC. Use "gnuabielfv2" or "gnuabielfv1" instead.
365399 '';
···480514 /**/ if args ? abi then getAbi args.abi
481515 else if isLinux parsed || isWindows parsed then
482516 if isAarch32 parsed then
483483- if lib.versionAtLeast (parsed.cpu.version or "0") "6"
517517+ if versionAtLeast (parsed.cpu.version or "0") "6"
484518 then abis.gnueabihf
485519 else abis.gnueabi
486520 # Default ppc64 BE to ELFv2
···491525492526 in mkSystem parsed;
493527494494- mkSystemFromString = s: mkSystemFromSkeleton (mkSkeletonFromList (lib.splitString "-" s));
528528+ mkSystemFromString = s: mkSystemFromSkeleton (mkSkeletonFromList (splitString "-" s));
495529496530 kernelName = kernel:
497531 kernel.name + toString (kernel.version or "");
···503537504538 tripleFromSystem = { cpu, vendor, kernel, abi, ... } @ sys: assert isSystem sys; let
505539 optExecFormat =
506506- lib.optionalString (kernel.name == "netbsd" &&
540540+ optionalString (kernel.name == "netbsd" &&
507541 gnuNetBSDDefaultExecFormat cpu != kernel.execFormat)
508542 kernel.execFormat.name;
509509- optAbi = lib.optionalString (abi != abis.unknown) "-${abi.name}";
543543+ optAbi = optionalString (abi != abis.unknown) "-${abi.name}";
510544 in "${cpu.name}-${vendor.name}-${kernelName kernel}${optExecFormat}${optAbi}";
511545512546 ################################################################################
···330330 - The `erlang_node_short_name`, `erlang_node_name`, `port` and `options` configuration parameters are gone, and have been replaced with an `environment` parameter.
331331 Use the appropriate [environment variables](https://hexdocs.pm/livebook/readme.html#environment-variables) inside `environment` to configure the service instead.
332332333333+- The `crystal` package has been updated to 1.11.x, which has some breaking changes.
334334+ Refer to crystal's changelog for more information. ([v1.10](https://github.com/crystal-lang/crystal/blob/master/CHANGELOG.md#1100-2023-10-09), [v1.11](https://github.com/crystal-lang/crystal/blob/master/CHANGELOG.md#1110-2024-01-08))
335335+333336## Other Notable Changes {#sec-release-24.05-notable-changes}
334337335338<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
···449452- The `hardware.pulseaudio` module now sets permission of pulse user home directory to 755 when running in "systemWide" mode. It fixes [issue 114399](https://github.com/NixOS/nixpkgs/issues/114399).
450453451454- The module `services.github-runner` has been removed. To configure a single GitHub Actions Runner refer to `services.github-runners.*`. Note that this will trigger a new runner registration.
455455+456456+- The `services.slskd` has been refactored to include more configuation options in
457457+ the freeform `services.slskd.settings` option, and some defaults (including listen ports)
458458+ have been changed to match the upstream defaults. Additionally, disk logging is now
459459+ disabled by default, and the log rotation timer has been removed.
460460+ The nginx virtualhost option is now of the `vhost-options` type.
452461453462- The `btrbk` module now automatically selects and provides required compression
454463 program depending on the configured `stream_compress` option. Since this
+5
nixos/modules/profiles/macos-builder.nix
···145145 # This installCredentials script is written so that it's as easy as
146146 # possible for a user to audit before confirming the `sudo`
147147 installCredentials = hostPkgs.writeShellScript "install-credentials" ''
148148+ set -euo pipefail
149149+148150 KEYS="''${1}"
149151 INSTALL=${hostPkgs.coreutils}/bin/install
150152 "''${INSTALL}" -g nixbld -m 600 "''${KEYS}/${user}_${keyType}" ${privateKey}
···154156 hostPkgs = config.virtualisation.host.pkgs;
155157156158 script = hostPkgs.writeShellScriptBin "create-builder" (
159159+ ''
160160+ set -euo pipefail
161161+ '' +
157162 # When running as non-interactively as part of a DarwinConfiguration the working directory
158163 # must be set to a writeable directory.
159164 (if cfg.workingDirectory != "." then ''
···2233let
44 settingsFormat = pkgs.formats.yaml {};
55+ defaultUser = "slskd";
56in {
67 options.services.slskd = with lib; with types; {
78 enable = mkEnableOption "enable slskd";
8999- rotateLogs = mkEnableOption "enable an unit and timer that will rotate logs in /var/slskd/logs";
1010+ package = mkPackageOptionMD pkgs "slskd" { };
10111111- package = mkPackageOption pkgs "slskd" { };
1212+ user = mkOption {
1313+ type = types.str;
1414+ default = defaultUser;
1515+ description = "User account under which slskd runs.";
1616+ };
12171313- nginx = mkOption {
1414- description = lib.mdDoc "options for nginx";
1515- example = {
1616- enable = true;
1717- domain = "example.com";
1818- contextPath = "/slskd";
1919- };
2020- type = submodule ({name, config, ...}: {
2121- options = {
2222- enable = mkEnableOption "enable nginx as a reverse proxy";
1818+ group = mkOption {
1919+ type = types.str;
2020+ default = defaultUser;
2121+ description = "Group under which slskd runs.";
2222+ };
23232424- domainName = mkOption {
2525- type = str;
2626- description = "Domain you want to use";
2727- };
2828- contextPath = mkOption {
2929- type = types.path;
3030- default = "/";
3131- description = lib.mdDoc ''
3232- The context path, i.e., the last part of the slskd
3333- URL. Typically '/' or '/slskd'. Default '/'
3434- '';
3535- };
3636- };
3737- });
2424+ domain = mkOption {
2525+ type = types.nullOr types.str;
2626+ description = ''
2727+ If non-null, enables an nginx reverse proxy virtual host at this FQDN,
2828+ at the path configurated with `services.slskd.web.url_base`.
2929+ '';
3030+ example = "slskd.example.com";
3131+ };
3232+3333+ nginx = mkOption {
3434+ type = types.submodule (import ../web-servers/nginx/vhost-options.nix { inherit config lib; });
3535+ default = {};
3636+ example = lib.literalExpression ''
3737+ {
3838+ enableACME = true;
3939+ forceHttps = true;
4040+ }
4141+ '';
4242+ description = ''
4343+ This option customizes the nginx virtual host set up for slskd.
4444+ '';
3845 };
39464047 environmentFile = mkOption {
4148 type = path;
4249 description = ''
4343- Path to a file containing secrets.
4444- It must at least contain the variable `SLSKD_SLSK_PASSWORD`
5050+ Path to the environment file sourced on startup.
5151+ It must at least contain the variables `SLSKD_SLSK_USERNAME` and `SLSKD_SLSK_PASSWORD`.
5252+ Web interface credentials should also be set here in `SLSKD_USERNAME` and `SLSKD_PASSWORD`.
5353+ Other, optional credentials like SOCKS5 with `SLSKD_SLSK_PROXY_USERNAME` and `SLSKD_SLSK_PROXY_PASSWORD`
5454+ should all reside here instead of in the world-readable nix store.
5555+ Variables are documented at https://github.com/slskd/slskd/blob/master/docs/config.md
4556 '';
4657 };
47584859 openFirewall = mkOption {
4960 type = bool;
5050- description = ''
5151- Whether to open the firewall for services.slskd.settings.listen_port";
5252- '';
6161+ description = "Whether to open the firewall for the soulseek network listen port (not the web interface port).";
5362 default = false;
5463 };
55645665 settings = mkOption {
5757- description = lib.mdDoc ''
5858- Configuration for slskd, see
5959- [available options](https://github.com/slskd/slskd/blob/master/docs/config.md)
6060- `APP_DIR` is set to /var/lib/slskd, where default download & incomplete directories,
6161- log and databases will be created.
6666+ description = ''
6767+ Application configuration for slskd. See
6868+ [documentation](https://github.com/slskd/slskd/blob/master/docs/config.md).
6269 '';
6370 default = {};
6471 type = submodule {
6572 freeformType = settingsFormat.type;
6673 options = {
7474+ remote_file_management = mkEnableOption "modification of share contents through the web ui";
7575+7676+ flags = {
7777+ force_share_scan = mkOption {
7878+ type = bool;
7979+ description = "Force a rescan of shares on every startup.";
8080+ };
8181+ no_version_check = mkOption {
8282+ type = bool;
8383+ default = true;
8484+ visible = false;
8585+ description = "Don't perform a version check on startup.";
8686+ };
8787+ };
8888+8989+ directories = {
9090+ incomplete = mkOption {
9191+ type = nullOr path;
9292+ description = "Directory where incomplete downloading files are stored.";
9393+ defaultText = "/var/lib/slskd/incomplete";
9494+ default = null;
9595+ };
9696+ downloads = mkOption {
9797+ type = nullOr path;
9898+ description = "Directory where downloaded files are stored.";
9999+ defaultText = "/var/lib/slskd/downloads";
100100+ default = null;
101101+ };
102102+ };
103103+104104+ shares = {
105105+ directories = mkOption {
106106+ type = listOf str;
107107+ description = ''
108108+ Paths to shared directories. See
109109+ [documentation](https://github.com/slskd/slskd/blob/master/docs/config.md#directories)
110110+ for advanced usage.
111111+ '';
112112+ example = lib.literalExpression ''[ "/home/John/Music" "!/home/John/Music/Recordings" "[Music Drive]/mnt" ]'';
113113+ };
114114+ filters = mkOption {
115115+ type = listOf str;
116116+ example = lib.literalExpression ''[ "\.ini$" "Thumbs.db$" "\.DS_Store$" ]'';
117117+ description = "Regular expressions of files to exclude from sharing.";
118118+ };
119119+ };
120120+121121+ rooms = mkOption {
122122+ type = listOf str;
123123+ description = "Chat rooms to join on startup.";
124124+ };
6712568126 soulseek = {
6969- username = mkOption {
127127+ description = mkOption {
70128 type = str;
7171- description = "Username on the Soulseek Network";
129129+ description = "The user description for the Soulseek network.";
130130+ defaultText = "A slskd user. https://github.com/slskd/slskd";
72131 };
73132 listen_port = mkOption {
74133 type = port;
7575- description = "Port to use for communication on the Soulseek Network";
7676- default = 50000;
134134+ description = "The port on which to listen for incoming connections.";
135135+ default = 50300;
136136+ };
137137+ };
138138+139139+ global = {
140140+ # TODO speed units
141141+ upload = {
142142+ slots = mkOption {
143143+ type = ints.unsigned;
144144+ description = "Limit of the number of concurrent upload slots.";
145145+ };
146146+ speed_limit = mkOption {
147147+ type = ints.unsigned;
148148+ description = "Total upload speed limit.";
149149+ };
150150+ };
151151+ download = {
152152+ slots = mkOption {
153153+ type = ints.unsigned;
154154+ description = "Limit of the number of concurrent download slots.";
155155+ };
156156+ speed_limit = mkOption {
157157+ type = ints.unsigned;
158158+ description = "Total upload download limit";
159159+ };
77160 };
78161 };
79162163163+ filters.search.request = mkOption {
164164+ type = listOf str;
165165+ example = lib.literalExpression ''[ "^.{1,2}$" ]'';
166166+ description = "Incoming search requests which match this filter are ignored.";
167167+ };
168168+80169 web = {
81170 port = mkOption {
82171 type = port;
8383- default = 5001;
8484- description = "The HTTP listen port";
172172+ default = 5030;
173173+ description = "The HTTP listen port.";
85174 };
86175 url_base = mkOption {
87176 type = path;
8888- default = config.services.slskd.nginx.contextPath;
8989- defaultText = "config.services.slskd.nginx.contextPath";
9090- description = lib.mdDoc ''
9191- The context path, i.e., the last part of the slskd URL
9292- '';
177177+ default = "/";
178178+ description = "The base path in the url for web requests.";
179179+ };
180180+ # Users should use a reverse proxy instead for https
181181+ https.disabled = mkOption {
182182+ type = bool;
183183+ default = true;
184184+ description = "Disable the built-in HTTPS server";
93185 };
94186 };
951879696- shares = {
9797- directories = mkOption {
9898- type = listOf str;
9999- description = lib.mdDoc ''
100100- Paths to your shared directories. See
101101- [documentation](https://github.com/slskd/slskd/blob/master/docs/config.md#directories)
102102- for advanced usage
103103- '';
188188+ retention = {
189189+ transfers = {
190190+ upload = {
191191+ succeeded = mkOption {
192192+ type = ints.unsigned;
193193+ description = "Lifespan of succeeded upload tasks.";
194194+ defaultText = "(indefinite)";
195195+ };
196196+ errored = mkOption {
197197+ type = ints.unsigned;
198198+ description = "Lifespan of errored upload tasks.";
199199+ defaultText = "(indefinite)";
200200+ };
201201+ cancelled = mkOption {
202202+ type = ints.unsigned;
203203+ description = "Lifespan of cancelled upload tasks.";
204204+ defaultText = "(indefinite)";
205205+ };
206206+ };
207207+ download = {
208208+ succeeded = mkOption {
209209+ type = ints.unsigned;
210210+ description = "Lifespan of succeeded download tasks.";
211211+ defaultText = "(indefinite)";
212212+ };
213213+ errored = mkOption {
214214+ type = ints.unsigned;
215215+ description = "Lifespan of errored download tasks.";
216216+ defaultText = "(indefinite)";
217217+ };
218218+ cancelled = mkOption {
219219+ type = ints.unsigned;
220220+ description = "Lifespan of cancelled download tasks.";
221221+ defaultText = "(indefinite)";
222222+ };
223223+ };
224224+ };
225225+ files = {
226226+ complete = mkOption {
227227+ type = ints.unsigned;
228228+ description = "Lifespan of completely downloaded files in minutes.";
229229+ example = 20160;
230230+ defaultText = "(indefinite)";
231231+ };
232232+ incomplete = mkOption {
233233+ type = ints.unsigned;
234234+ description = "Lifespan of incomplete downloading files in minutes.";
235235+ defaultText = "(indefinite)";
236236+ };
104237 };
105238 };
106239107107- directories = {
108108- incomplete = mkOption {
109109- type = nullOr path;
110110- description = "Directory where downloading files are stored";
111111- defaultText = "<APP_DIR>/incomplete";
112112- default = null;
113113- };
114114- downloads = mkOption {
115115- type = nullOr path;
116116- description = "Directory where downloaded files are stored";
117117- defaultText = "<APP_DIR>/downloads";
118118- default = null;
240240+ logger = {
241241+ # Disable by default, journald already retains as needed
242242+ disk = mkOption {
243243+ type = bool;
244244+ description = "Whether to log to the application directory.";
245245+ default = false;
246246+ visible = false;
119247 };
120248 };
121249 };
···126254 config = let
127255 cfg = config.services.slskd;
128256129129- confWithoutNullValues = (lib.filterAttrs (key: value: value != null) cfg.settings);
257257+ confWithoutNullValues = (lib.filterAttrsRecursive (key: value: (builtins.tryEval value).success && value != null) cfg.settings);
130258131259 configurationYaml = settingsFormat.generate "slskd.yml" confWithoutNullValues;
132260133261 in lib.mkIf cfg.enable {
134262135135- users = {
136136- users.slskd = {
263263+ # Force off, configuration file is in nix store and is immutable
264264+ services.slskd.settings.remote_configuration = lib.mkForce false;
265265+266266+ users.users = lib.optionalAttrs (cfg.user == defaultUser) {
267267+ "${defaultUser}" = {
268268+ group = cfg.group;
137269 isSystemUser = true;
138138- group = "slskd";
139270 };
140140- groups.slskd = {};
141271 };
142272143143- # Reverse proxy configuration
144144- services.nginx.enable = true;
145145- services.nginx.virtualHosts."${cfg.nginx.domainName}" = {
146146- forceSSL = true;
147147- enableACME = true;
148148- locations = {
149149- "${cfg.nginx.contextPath}" = {
150150- proxyPass = "http://localhost:${toString cfg.settings.web.port}";
151151- proxyWebsockets = true;
152152- };
153153- };
273273+ users.groups = lib.optionalAttrs (cfg.group == defaultUser) {
274274+ "${defaultUser}" = {};
154275 };
155276156156- # Hide state & logs
157157- systemd.tmpfiles.rules = [
158158- "d /var/lib/slskd/data 0750 slskd slskd - -"
159159- "d /var/lib/slskd/logs 0750 slskd slskd - -"
160160- ];
161161-162277 systemd.services.slskd = {
163278 description = "A modern client-server application for the Soulseek file sharing network";
164279 after = [ "network.target" ];
165280 wantedBy = [ "multi-user.target" ];
166281 serviceConfig = {
167282 Type = "simple";
168168- User = "slskd";
283283+ User = cfg.user;
284284+ Group = cfg.group;
169285 EnvironmentFile = lib.mkIf (cfg.environmentFile != null) cfg.environmentFile;
170170- StateDirectory = "slskd";
286286+ StateDirectory = "slskd"; # Creates /var/lib/slskd and manages permissions
171287 ExecStart = "${cfg.package}/bin/slskd --app-dir /var/lib/slskd --config ${configurationYaml}";
172288 Restart = "on-failure";
173289 ReadOnlyPaths = map (d: builtins.elemAt (builtins.split "[^/]*(/.+)" d) 1) cfg.settings.shares.directories;
290290+ ReadWritePaths =
291291+ (lib.optional (cfg.settings.directories.incomplete != null) cfg.settings.directories.incomplete) ++
292292+ (lib.optional (cfg.settings.directories.downloads != null) cfg.settings.directories.downloads);
174293 LockPersonality = true;
175294 NoNewPrivileges = true;
176295 PrivateDevices = true;
···194313195314 networking.firewall.allowedTCPPorts = lib.optional cfg.openFirewall cfg.settings.soulseek.listen_port;
196315197197- systemd.services.slskd-rotatelogs = lib.mkIf cfg.rotateLogs {
198198- description = "Rotate slskd logs";
199199- serviceConfig = {
200200- Type = "oneshot";
201201- User = "slskd";
202202- ExecStart = [
203203- "${pkgs.findutils}/bin/find /var/lib/slskd/logs/ -type f -mtime +10 -delete"
204204- "${pkgs.findutils}/bin/find /var/lib/slskd/logs/ -type f -mtime +1 -exec ${pkgs.gzip}/bin/gzip -q {} ';'"
205205- ];
206206- };
207207- startAt = "daily";
316316+ services.nginx = lib.mkIf (cfg.domain != null) {
317317+ enable = lib.mkDefault true;
318318+ virtualHosts."${cfg.domain}" = lib.mkMerge [
319319+ cfg.nginx
320320+ {
321321+ locations."${cfg.settings.web.url_base}" = {
322322+ proxyPass = "http://127.0.0.1:${toString cfg.settings.web.port}";
323323+ proxyWebsockets = true;
324324+ };
325325+ }
326326+ ];
208327 };
328328+ };
209329330330+ meta = {
331331+ maintainers = with lib.maintainers; [ ppom melvyn2 ];
210332 };
211333}
+4
nixos/modules/tasks/filesystems/envfs.nix
···77 device = "none";
88 fsType = "envfs";
99 options = [
1010+ "bind-mount=/bin"
1011 "fallback-path=${pkgs.runCommand "fallback-path" {} (''
1112 mkdir -p $out
1213 ln -s ${config.environment.usrbinenv} $out/env
···1516 "nofail"
1617 ];
1718 };
1919+ # We need to bind-mount /bin to /usr/bin, because otherwise upgrading
2020+ # from envfs < 1.0.5 will cause having the old envs with no /bin bind mount.
2121+ # Systemd is smart enough to not mount /bin if it's already mounted.
1822 "/bin" = {
1923 device = "/usr/bin";
2024 fsType = "none";
···11-import ./make-test-python.nix ({ pkgs, ... }: {
11+import ./make-test-python.nix ({ pkgs, ... }: rec {
22 name = "tracee-integration";
33 meta.maintainers = pkgs.tracee.meta.maintainers;
44+55+ passthru.hello-world-builder = pkgs: pkgs.dockerTools.buildImage {
66+ name = "hello-world";
77+ tag = "latest";
88+ config.Cmd = [ "${pkgs.hello}/bin/hello" ];
99+ };
410511 nodes = {
612 machine = { config, pkgs, ... }: {
···1218 environment.systemPackages = with pkgs; [
1319 # required by Test_EventFilters/trace_events_from_ls_and_which_binary_in_separate_scopes
1420 which
1515- # build the go integration tests as a binary
1616- (tracee.overrideAttrs (oa: {
1717- pname = oa.pname + "-integration";
1818- postPatch = oa.postPatch or "" + ''
1919- # prepare tester.sh (which will be embedded in the test binary)
2020- patchShebangs tests/integration/tester.sh
2121+ # the go integration tests as a binary
2222+ tracee.passthru.tests.integration-test-cli
2323+ ];
2424+ };
2525+ };
21262222- # fix the test to look at nixos paths for running programs
2323- substituteInPlace tests/integration/integration_test.go \
2424- --replace "bin=/usr/bin/" "comm=" \
2525- --replace "binary=/usr/bin/" "comm=" \
2626- --replace "/usr/bin/dockerd" "dockerd" \
2727- --replace "/usr/bin" "/run/current-system/sw/bin"
2828- '';
2929- nativeBuildInputs = oa.nativeBuildInputs or [ ] ++ [ makeWrapper ];
3030- buildPhase = ''
3131- runHook preBuild
3232- # just build the static lib we need for the go test binary
3333- make $makeFlags ''${enableParallelBuilding:+-j$NIX_BUILD_CORES} bpf-core ./dist/btfhub
2727+ testScript =
2828+ let
2929+ skippedTests = [
3030+ # these comm tests for some reason do not resolve.
3131+ # something about the test is different as it works fine if I replicate
3232+ # the policies and run tracee myself but doesn't work in the integration
3333+ # test either with the automatic run or running the commands by hand
3434+ # while it's searching.
3535+ "Test_EventFilters/comm:_event:_args:_trace_event_set_in_a_specific_policy_with_args_from_ls_command"
3636+ "Test_EventFilters/comm:_event:_trace_events_set_in_two_specific_policies_from_ls_and_uname_commands"
34373535- # then compile the tests to be ran later
3636- CGO_LDFLAGS="$(pkg-config --libs libbpf)" go test -tags core,ebpf,integration -p 1 -c -o $GOPATH/tracee-integration ./tests/integration/...
3737- runHook postBuild
3838- '';
3939- doCheck = false;
4040- outputs = [ "out" ];
4141- installPhase = ''
4242- mkdir -p $out/bin
4343- mv $GOPATH/tracee-integration $out/bin/
4444- '';
4545- doInstallCheck = false;
4646-4747- meta = oa.meta // {
4848- outputsToInstall = [];
4949- };
5050- }))
3838+ # worked at some point, seems to be flakey
3939+ "Test_EventFilters/pid:_event:_args:_trace_event_sched_switch_with_args_from_pid_0"
5140 ];
5252- };
5353- };
4141+ in
4242+ ''
4343+ with subtest("prepare for integration tests"):
4444+ machine.wait_for_unit("docker.service")
4545+ machine.succeed('which bash')
54465555- testScript = ''
5656- machine.wait_for_unit("docker.service")
4747+ # EventFilters/trace_only_events_from_new_containers also requires a container called "hello-world"
4848+ machine.succeed('docker load < ${passthru.hello-world-builder pkgs}')
57495858- with subtest("run integration tests"):
5959- # EventFilters/trace_only_events_from_new_containers also requires a container called "alpine"
6060- machine.succeed('tar c -C ${pkgs.pkgsStatic.busybox} . | docker import - alpine --change "ENTRYPOINT [\"sleep\"]"')
5050+ # exec= needs fully resolved paths
5151+ machine.succeed(
5252+ 'mkdir /tmp/testdir',
5353+ 'cp $(which who) /tmp/testdir/who',
5454+ 'cp $(which uname) /tmp/testdir/uname',
5555+ )
61566262- # Test_EventFilters/trace_event_set_in_a_specific_scope expects to be in a dir that includes "integration"
6363- print(machine.succeed(
6464- 'mkdir /tmp/integration',
6565- 'cd /tmp/integration && tracee-integration -test.v'
6666- ))
6767- '';
5757+ with subtest("run integration tests"):
5858+ # Test_EventFilters/trace_event_set_in_a_specific_scope expects to be in a dir that includes "integration"
5959+ # tests must be ran with 1 process
6060+ print(machine.succeed(
6161+ 'mkdir /tmp/integration',
6262+ 'cd /tmp/integration && export PATH="/tmp/testdir:$PATH" && integration.test -test.v -test.parallel 1 -test.skip="^${builtins.concatStringsSep "$|^" skippedTests}$"'
6363+ ))
6464+ '';
6865})
···6767 deprecatedNativeMessagingHost = option: pkg:
6868 if (cfg.${option} or false)
6969 then
7070- lib.warn "The cfg.${option} argument for `firefox.override` is deprecated, please add `pkgs.${pkg.pname}` to `nativeMessagingHosts.packages` instead"
7070+ lib.warn "The cfg.${option} argument for `firefox.override` is deprecated, please add `pkgs.${pkg.pname}` to `nativeMessagingHosts` instead"
7171 [pkg]
7272 else [];
7373
···123123 ro_mounts=()
124124 symlinks=()
125125 etc_ignored=()
126126+127127+ # loop through all entries of root in the fhs environment, except its /etc.
126128 for i in ${fhsenv}/*; do
127129 path="/''${i##*/}"
128130 if [[ $path == '/etc' ]]; then
···136138 fi
137139 done
138140141141+ # loop through the entries of /etc in the fhs environment.
139142 if [[ -d ${fhsenv}/etc ]]; then
140143 for i in ${fhsenv}/etc/*; do
141144 path="/''${i##*/}"
···144147 if [[ $path == '/fonts' || $path == '/ssl' ]]; then
145148 continue
146149 fi
147147- ro_mounts+=(--ro-bind "$i" "/etc$path")
150150+ if [[ -L $i ]]; then
151151+ symlinks+=(--symlink "$i" "/etc$path")
152152+ else
153153+ ro_mounts+=(--ro-bind "$i" "/etc$path")
154154+ fi
148155 etc_ignored+=("/etc$path")
149156 done
150157 fi
···156163 ro_mounts+=(--ro-bind /etc /.host-etc)
157164 fi
158165166166+ # link selected etc entries from the actual root
159167 for i in ${lib.escapeShellArgs etcBindEntries}; do
160168 if [[ "''${etc_ignored[@]}" =~ "$i" ]]; then
161169 continue
+68
pkgs/by-name/af/affine/package.nix
···11+{ lib
22+, writeText
33+, fetchurl
44+, stdenvNoCC
55+, copyDesktopItems
66+, makeDesktopItem
77+, makeWrapper
88+, unzip
99+, bash
1010+, electron
1111+, commandLineArgs ? ""
1212+}:
1313+1414+stdenvNoCC.mkDerivation (finalAttrs: let
1515+ icon = fetchurl {
1616+ url = "https://raw.githubusercontent.com/toeverything/AFFiNE/v${finalAttrs.version}/packages/frontend/core/public/favicon-192.png";
1717+ hash = "sha256-smZ5W7fy3TK3bvjwV4i71j2lVmKSZcyhMhcWfPxNnN4=";
1818+ };
1919+in {
2020+ pname = "affine";
2121+ version = "0.13.1";
2222+ src = fetchurl {
2323+ url = "https://github.com/toeverything/AFFiNE/releases/download/v${finalAttrs.version}/affine-${finalAttrs.version}-stable-linux-x64.zip";
2424+ hash = "sha256-2Du5g/I82iTr8Bwb+qkLzyfbk1OrOlXqx6FHImVoAoE=";
2525+ };
2626+ nativeBuildInputs = [
2727+ copyDesktopItems
2828+ makeWrapper
2929+ unzip
3030+ ];
3131+ postInstall = ''
3232+ mkdir -p $out/lib
3333+ cp -r ./resources/* -t $out/lib/
3434+ cp LICENSE* $out/
3535+ install -Dm644 ${icon} $out/share/pixmaps/affine.png
3636+ makeWrapper "${electron}/bin/electron" $out/bin/affine \
3737+ --inherit-argv0 \
3838+ --add-flags $out/lib/app.asar \
3939+ --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \
4040+ --add-flags ${lib.escapeShellArg commandLineArgs}
4141+ '';
4242+ desktopItems = [
4343+ (makeDesktopItem {
4444+ name = "affine";
4545+ desktopName = "AFFiNE";
4646+ exec = "affine %U";
4747+ terminal = false;
4848+ icon = "affine";
4949+ startupWMClass = "affine";
5050+ categories = ["Utility"];
5151+ })
5252+ ];
5353+ meta = with lib; {
5454+ description = "A workspace with fully merged docs, whiteboards and databases";
5555+ longDescription = ''
5656+ AFFiNE is an open-source, all-in-one workspace and an operating
5757+ system for all the building blocks that assemble your knowledge
5858+ base and much more -- wiki, knowledge management, presentation
5959+ and digital assets
6060+ '';
6161+ homepage = "https://affine.pro/";
6262+ downloadPage = "https://affine.pro/download";
6363+ license = licenses.mit;
6464+ maintainers = with maintainers; [richar];
6565+ mainProgram = "affine";
6666+ platforms = ["x86_64-linux"];
6767+ };
6868+})
···11# this release doesn't exist yet, but satisfay the by-name checks
22# will be added as incus-lts in all-packages.nix once ready
33-_: { }
33+import ./generic.nix { }
···11+This patch introduces an intermediate Gradle build step to alter the behavior
22+of flutter_tools' Gradle project, specifically moving the creation of `build`
33+and `.gradle` directories from within the Nix Store to somewhere in `$HOME/.cache/flutter/nix-flutter-tools-gradle/$engineShortRev`.
44+55+Without this patch, flutter_tools' Gradle project tries to generate `build` and `.gradle`
66+directories within the Nix Store. Resulting in read-only errors when trying to build a
77+Flutter Android app at runtime.
88+99+This patch takes advantage of the fact settings.gradle takes priority over settings.gradle.kts to build the intermediate Gradle project
1010+when a Flutter app runs `includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")`
1111+1212+`rootProject.buildFileName = "/dev/null"` so that the intermediate project doesn't use `build.gradle.kts` that's in the same directory.
1313+1414+The intermediate project makes a `settings.gradle` file in `$HOME/.cache/flutter/nix-flutter-tools-gradle/<short engine rev>/` and `includeBuild`s it.
1515+This Gradle project will build the actual `packages/flutter_tools/gradle` project by setting
1616+`rootProject.projectDir = new File("$settingsDir")` and `apply from: new File("$settingsDir/settings.gradle.kts")`.
1717+1818+Now the `.gradle` will be built in `$HOME/.cache/flutter/nix-flutter-tools-gradle/<short engine rev>/`, but `build` doesn't.
1919+To move `build` to `$HOME/.cache/flutter/nix-flutter-tools-gradle/<short engine rev>/` as well, we need to set `buildDirectory`.
2020+diff --git a/packages/flutter_tools/gradle/settings.gradle b/packages/flutter_tools/gradle/settings.gradle
2121+new file mode 100644
2222+index 0000000000..b2485c94b4
2323+--- /dev/null
2424++++ b/packages/flutter_tools/gradle/settings.gradle
2525+@@ -0,0 +1,19 @@
2626++rootProject.buildFileName = "/dev/null"
2727++
2828++def engineShortRev = (new File("$settingsDir/../../../bin/internal/engine.version")).text.take(10)
2929++def dir = new File("$System.env.HOME/.cache/flutter/nix-flutter-tools-gradle/$engineShortRev")
3030++dir.mkdirs()
3131++def file = new File(dir, "settings.gradle")
3232++
3333++file.text = """
3434++rootProject.projectDir = new File("$settingsDir")
3535++apply from: new File("$settingsDir/settings.gradle.kts")
3636++
3737++gradle.allprojects { project ->
3838++ project.beforeEvaluate {
3939++ project.layout.buildDirectory = new File("$dir/build")
4040++ }
4141++}
4242++"""
4343++
4444++includeBuild(dir)
+260
pkgs/development/compilers/openjdk/22.nix
···11+{ stdenv
22+, lib
33+, fetchurl
44+, fetchpatch
55+, fetchFromGitHub
66+, bash
77+, pkg-config
88+, autoconf
99+, cpio
1010+, file
1111+, which
1212+, unzip
1313+, zip
1414+, perl
1515+, cups
1616+, freetype
1717+, alsa-lib
1818+, libjpeg
1919+, giflib
2020+, libpng
2121+, zlib
2222+, lcms2
2323+, libX11
2424+, libICE
2525+, libXrender
2626+, libXext
2727+, libXt
2828+, libXtst
2929+, libXi
3030+, libXinerama
3131+, libXcursor
3232+, libXrandr
3333+, fontconfig
3434+, openjdk22-bootstrap
3535+, ensureNewerSourcesForZipFilesHook
3636+, setJavaClassPath
3737+ # TODO(@sternenseemann): gtk3 fails to evaluate in pkgsCross.ghcjs.buildPackages
3838+ # which should be fixable, this is a no-rebuild workaround for GHC.
3939+, headless ? stdenv.targetPlatform.isGhcjs
4040+, enableJavaFX ? false
4141+, openjfx
4242+, enableGnome2 ? true
4343+, gtk3
4444+, gnome_vfs
4545+, glib
4646+, GConf
4747+}:
4848+4949+let
5050+ version = {
5151+ feature = "22";
5252+ interim = "";
5353+ build = "36";
5454+ };
5555+5656+ # when building a headless jdk, also bootstrap it with a headless jdk
5757+ openjdk-bootstrap = openjdk22-bootstrap.override { gtkSupport = !headless; };
5858+5959+ openjdk = stdenv.mkDerivation {
6060+ pname = "openjdk" + lib.optionalString headless "-headless";
6161+ version = "${version.feature}${version.interim}+${version.build}";
6262+6363+ src = fetchFromGitHub {
6464+ owner = "openjdk";
6565+ repo = "jdk${version.feature}u";
6666+ rev = "jdk-${version.feature}${version.interim}+${version.build}";
6767+ hash = "sha256-itjvIedPwJl/l3a2gIVpNMs1zkbrjioVqbCj1Z1nCJE=";
6868+ };
6969+7070+ nativeBuildInputs = [ pkg-config autoconf unzip ensureNewerSourcesForZipFilesHook ];
7171+ buildInputs = [
7272+ cpio
7373+ file
7474+ which
7575+ zip
7676+ perl
7777+ zlib
7878+ cups
7979+ freetype
8080+ alsa-lib
8181+ libjpeg
8282+ giflib
8383+ libpng
8484+ zlib
8585+ lcms2
8686+ libX11
8787+ libICE
8888+ libXrender
8989+ libXext
9090+ libXtst
9191+ libXt
9292+ libXtst
9393+ libXi
9494+ libXinerama
9595+ libXcursor
9696+ libXrandr
9797+ fontconfig
9898+ openjdk-bootstrap
9999+ ] ++ lib.optionals (!headless && enableGnome2) [
100100+ gtk3
101101+ gnome_vfs
102102+ GConf
103103+ glib
104104+ ];
105105+106106+ patches = [
107107+ ./fix-java-home-jdk21.patch
108108+ ./read-truststore-from-env-jdk10.patch
109109+ ./currency-date-range-jdk10.patch
110110+ ./increase-javadoc-heap-jdk13.patch
111111+ ./ignore-LegalNoticeFilePlugin-jdk18.patch
112112+113113+ # -Wformat etc. are stricter in newer gccs, per
114114+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79677
115115+ # so grab the work-around from
116116+ # https://src.fedoraproject.org/rpms/java-openjdk/pull-request/24
117117+ (fetchurl {
118118+ url = "https://src.fedoraproject.org/rpms/java-openjdk/raw/06c001c7d87f2e9fe4fedeef2d993bcd5d7afa2a/f/rh1673833-remove_removal_of_wformat_during_test_compilation.patch";
119119+ sha256 = "082lmc30x64x583vqq00c8y0wqih3y4r0mp1c4bqq36l22qv6b6r";
120120+ })
121121+122122+ # Fix build for gnumake-4.4.1:
123123+ # https://github.com/openjdk/jdk/pull/12992
124124+ (fetchpatch {
125125+ name = "gnumake-4.4.1";
126126+ url = "https://github.com/openjdk/jdk/commit/9341d135b855cc208d48e47d30cd90aafa354c36.patch";
127127+ hash = "sha256-Qcm3ZmGCOYLZcskNjj7DYR85R4v07vYvvavrVOYL8vg=";
128128+ })
129129+ ] ++ lib.optionals (!headless && enableGnome2) [
130130+ ./swing-use-gtk-jdk13.patch
131131+ ];
132132+133133+ postPatch = ''
134134+ chmod +x configure
135135+ patchShebangs --build configure
136136+ '';
137137+138138+ # JDK's build system attempts to specifically detect
139139+ # and special-case WSL, and we don't want it to do that,
140140+ # so pass the correct platform names explicitly
141141+ configurePlatforms = [ "build" "host" ];
142142+143143+144144+ # https://openjdk.org/groups/build/doc/building.html
145145+ configureFlags = [
146146+ "--with-boot-jdk=${openjdk-bootstrap.home}"
147147+ "--with-version-build=${version.build}"
148148+ "--with-version-opt=nixos"
149149+ "--with-version-pre="
150150+ "--enable-unlimited-crypto"
151151+ "--with-native-debug-symbols=internal"
152152+ "--with-libjpeg=system"
153153+ "--with-giflib=system"
154154+ "--with-libpng=system"
155155+ "--with-zlib=system"
156156+ "--with-lcms=system"
157157+ "--with-stdc++lib=dynamic"
158158+ ]
159159+ ++ lib.optional headless "--enable-headless-only"
160160+ ++ lib.optional (!headless && enableJavaFX) "--with-import-modules=${openjfx}";
161161+162162+ separateDebugInfo = true;
163163+164164+ env.NIX_CFLAGS_COMPILE = "-Wno-error";
165165+166166+ NIX_LDFLAGS = toString (lib.optionals (!headless) [
167167+ "-lfontconfig"
168168+ "-lcups"
169169+ "-lXinerama"
170170+ "-lXrandr"
171171+ "-lmagic"
172172+ ] ++ lib.optionals (!headless && enableGnome2) [
173173+ "-lgtk-3"
174174+ "-lgio-2.0"
175175+ "-lgnomevfs-2"
176176+ "-lgconf-2"
177177+ ]);
178178+179179+ # -j flag is explicitly rejected by the build system:
180180+ # Error: 'make -jN' is not supported, use 'make JOBS=N'
181181+ # Note: it does not make build sequential. Build system
182182+ # still runs in parallel.
183183+ enableParallelBuilding = false;
184184+185185+ buildFlags = [ "images" ];
186186+187187+ installPhase = ''
188188+ mkdir -p $out/lib
189189+190190+ mv build/*/images/jdk $out/lib/openjdk
191191+192192+ # Remove some broken manpages.
193193+ rm -rf $out/lib/openjdk/man/ja*
194194+195195+ # Mirror some stuff in top-level.
196196+ mkdir -p $out/share
197197+ ln -s $out/lib/openjdk/include $out/include
198198+ ln -s $out/lib/openjdk/man $out/share/man
199199+200200+ # IDEs use the provided src.zip to navigate the Java codebase (https://github.com/NixOS/nixpkgs/pull/95081)
201201+ ln -s $out/lib/openjdk/lib/src.zip $out/lib/src.zip
202202+203203+ # jni.h expects jni_md.h to be in the header search path.
204204+ ln -s $out/include/linux/*_md.h $out/include/
205205+206206+ # Remove crap from the installation.
207207+ rm -rf $out/lib/openjdk/demo
208208+ ${lib.optionalString headless ''
209209+ rm $out/lib/openjdk/lib/{libjsound,libfontmanager}.so
210210+ ''}
211211+212212+ ln -s $out/lib/openjdk/bin $out/bin
213213+ '';
214214+215215+ preFixup = ''
216216+ # Propagate the setJavaClassPath setup hook so that any package
217217+ # that depends on the JDK has $CLASSPATH set up properly.
218218+ mkdir -p $out/nix-support
219219+ #TODO or printWords? cf https://github.com/NixOS/nixpkgs/pull/27427#issuecomment-317293040
220220+ echo -n "${setJavaClassPath}" > $out/nix-support/propagated-build-inputs
221221+222222+ # Set JAVA_HOME automatically.
223223+ mkdir -p $out/nix-support
224224+ cat <<EOF > $out/nix-support/setup-hook
225225+ if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out/lib/openjdk; fi
226226+ EOF
227227+ '';
228228+229229+ postFixup = ''
230230+ # Build the set of output library directories to rpath against
231231+ LIBDIRS=""
232232+ for output in $(getAllOutputNames); do
233233+ if [ "$output" = debug ]; then continue; fi
234234+ LIBDIRS="$(find $(eval echo \$$output) -name \*.so\* -exec dirname {} \+ | sort -u | tr '\n' ':'):$LIBDIRS"
235235+ done
236236+ # Add the local library paths to remove dependencies on the bootstrap
237237+ for output in $(getAllOutputNames); do
238238+ if [ "$output" = debug ]; then continue; fi
239239+ OUTPUTDIR=$(eval echo \$$output)
240240+ BINLIBS=$(find $OUTPUTDIR/bin/ -type f; find $OUTPUTDIR -name \*.so\*)
241241+ echo "$BINLIBS" | while read i; do
242242+ patchelf --set-rpath "$LIBDIRS:$(patchelf --print-rpath "$i")" "$i" || true
243243+ patchelf --shrink-rpath "$i" || true
244244+ done
245245+ done
246246+ '';
247247+248248+ disallowedReferences = [ openjdk-bootstrap ];
249249+250250+ pos = builtins.unsafeGetAttrPos "feature" version;
251251+ meta = import ./meta.nix lib version.feature;
252252+253253+ passthru = {
254254+ architecture = "";
255255+ home = "${openjdk}/lib/openjdk";
256256+ inherit gtk3;
257257+ };
258258+ };
259259+in
260260+openjdk
···11+{ callPackage
22+, enableJavaFX ? false
33+, ...
44+}@args:
55+66+callPackage ./common.nix ({
77+ # Details from https://www.azul.com/downloads/?version=java-22-lts&package=jdk
88+ # Note that the latest build may differ by platform
99+ dists = {
1010+ x86_64-linux = {
1111+ zuluVersion = "22.28.91";
1212+ jdkVersion = "22.0.0";
1313+ hash =
1414+ if enableJavaFX then "sha256-HvMiODsz+puu1xtxG2RRXH/PWCk91PGNZ7UcOd9orqQ="
1515+ else "sha256-HvMiODsz+puu1xtxG2RRXH/PWCk91PGNZ7UcOd9orqQ=";
1616+ };
1717+1818+ aarch64-linux = {
1919+ zuluVersion = "22.28.91";
2020+ jdkVersion = "22.0.0";
2121+ hash =
2222+ if enableJavaFX then throw "JavaFX is not available for aarch64-linux"
2323+ else "sha256-3RLNNEbMk5wAZsQmbQj/jpx9iTL/yr9N3wL4t7m6c+s=";
2424+ };
2525+2626+ x86_64-darwin = {
2727+ zuluVersion = "22.28.91";
2828+ jdkVersion = "22.0.0";
2929+ hash =
3030+ if enableJavaFX then "sha256-Y6PSNQjHRXukwux2sVbvpTIqT+Cg+KeG1C0iSEwyKZw="
3131+ else "sha256-Y6PSNQjHRXukwux2sVbvpTIqT+Cg+KeG1C0iSEwyKZw=";
3232+ };
3333+3434+ aarch64-darwin = {
3535+ zuluVersion = "22.28.91";
3636+ jdkVersion = "22.0.0";
3737+ hash =
3838+ if enableJavaFX then "sha256-o0VkWB4+PzBmNNWy+FZlyjTgukBTe6owfydb3YNfEE0="
3939+ else "sha256-o0VkWB4+PzBmNNWy+FZlyjTgukBTe6owfydb3YNfEE0=";
4040+ };
4141+ };
4242+} // builtins.removeAttrs args [ "callPackage" ])
+4
pkgs/development/libraries/flatpak/default.nix
···9797 # The icon validator needs to access the gdk-pixbuf loaders in the Nix store
9898 # and cannot bind FHS paths since those are not available on NixOS.
9999 finalAttrs.passthru.icon-validator-patch
100100+101101+ # Try mounting fonts and icons from NixOS locations if FHS locations don't exist.
102102+ # https://github.com/NixOS/nixpkgs/issues/119433
103103+ ./fix-fonts-icons.patch
100104 ];
101105102106 nativeBuildInputs = [
···1111function arguments. Pass them into `propagatedBuildInputs`, for them to
1212be available to Home Assistant.
13131414-Out-of-tree components need to use python packages from
1414+Out-of-tree components need to use Python packages from
1515`home-assistant.python.pkgs` as to not introduce conflicting package
1616versions into the Python environment.
1717···58585959The `pname` attribute is a composition of both `owner` and `domain`.
60606161-Don't set `pname`, set `owner and `domain` instead.
6161+Don't set `pname`, set `owner` and `domain` instead.
62626363Exposing the `domain` attribute separately allows checking for
6464conflicting components at eval time.
···237237 docker-machine = throw "'docker-machine' has been removed, because the upstream project was archived"; # Added 2023-12-27
238238 docker-machine-kvm = throw "'docker-machine-kvm' has been removed, because 'docker-machine' was archived upstream and removed"; # Added 2023-12-27
239239 docker-machine-xhyve = throw "'docker-machine-xhyve' has been removed, because 'docker-machine' was archived upstream and removed"; # Added 2023-12-27
240240+ docker-proxy = throw "`docker-proxy` has been merged to the main repo of Moby since Docker 22.06"; # Added 2024-03-14
240241 dogecoin = throw "'dogecoin' has been removed, as it was broken and unmaintained"; # Added 2024-03-11
241242 dogecoind = throw "'dogecoind' has been removed, as it was broken and unmaintained"; # Added 2024-03-11
242243 dolphin-emu-beta = dolphin-emu; # Added 2023-02-11