···2930## Variables controlling zig.hook {#variables-controlling-zig-hook}
3132-### `dontUseZigBuild` {#dontUseZigBuild}
3334-Disables using `zigBuildPhase`.
3536-### `zigBuildFlags` {#zigBuildFlags}
3738-Controls the flags passed to the build phase.
3940-### `dontUseZigCheck` {#dontUseZigCheck}
4142Disables using `zigCheckPhase`.
4344-### `zigCheckFlags` {#zigCheckFlags}
45-46-Controls the flags passed to the check phase.
47-48-### `dontUseZigInstall` {#dontUseZigInstall}
4950Disables using `zigInstallPhase`.
5152-### `zigInstallFlags` {#zigInstallFlags}
5354-Controls the flags passed to the install phase.
0000005556### Variables honored by zig.hook {#variables-honored-by-zig-hook}
005758- `prefixKey`
59- `dontAddPrefix`
···2930## Variables controlling zig.hook {#variables-controlling-zig-hook}
3132+### `zig.hook` Exclusive Variables {#zigHookExclusiveVariables}
3334+The variables below are exclusive to `zig.hook`.
3536+#### `dontUseZigBuild` {#dontUseZigBuild}
3738+Disables using `zigBuildPhase`.
3940+#### `dontUseZigCheck` {#dontUseZigCheck}
4142Disables using `zigCheckPhase`.
4344+#### `dontUseZigInstall` {#dontUseZigInstall}
00004546Disables using `zigInstallPhase`.
4748+### Similar variables {#similarVariables}
4950+The following variables are similar to their `stdenv.mkDerivation` counterparts.
51+52+| `zig.hook` Variable | `stdenv.mkDerivation` Counterpart |
53+|---------------------|-----------------------------------|
54+| `zigBuildFlags` | `buildFlags` |
55+| `zigCheckFlags` | `checkFlags` |
56+| `zigInstallFlags` | `installFlags` |
5758### Variables honored by zig.hook {#variables-honored-by-zig-hook}
59+60+The following variables commonly used by `stdenv.mkDerivation` are honored by `zig.hook`.
6162- `prefixKey`
63- `dontAddPrefix`
+2
nixos/doc/manual/release-notes/rl-2311.section.md
···231232- `services.nginx` gained a `defaultListen` option at server-level with support for PROXY protocol listeners, also `proxyProtocol` is now exposed in `services.nginx.virtualHosts.<name>.listen` option. It is now possible to run PROXY listeners and non-PROXY listeners at a server-level, see [#213510](https://github.com/NixOS/nixpkgs/pull/213510/) for more details.
23300234- `services.prometheus.exporters` has a new exporter to monitor electrical power consumption based on PowercapRAPL sensor called [Scaphandre](https://github.com/hubblo-org/scaphandre), see [#239803](https://github.com/NixOS/nixpkgs/pull/239803) for more details.
235236- The MariaDB C client library was upgraded from 3.2.x to 3.3.x. It is recomended to review the [upstream release notes](https://mariadb.com/kb/en/mariadb-connector-c-33-release-notes/).
···231232- `services.nginx` gained a `defaultListen` option at server-level with support for PROXY protocol listeners, also `proxyProtocol` is now exposed in `services.nginx.virtualHosts.<name>.listen` option. It is now possible to run PROXY listeners and non-PROXY listeners at a server-level, see [#213510](https://github.com/NixOS/nixpkgs/pull/213510/) for more details.
233234+- `services.restic.backups` now adds wrapper scripts to your system path, which set the same environment variables as the service, so restic operations can easly be run from the command line. This behavior can be disabled by setting `createWrapper` to `false`, per backup configuration.
235+236- `services.prometheus.exporters` has a new exporter to monitor electrical power consumption based on PowercapRAPL sensor called [Scaphandre](https://github.com/hubblo-org/scaphandre), see [#239803](https://github.com/NixOS/nixpkgs/pull/239803) for more details.
237238- The MariaDB C client library was upgraded from 3.2.x to 3.3.x. It is recomended to review the [upstream release notes](https://mariadb.com/kb/en/mariadb-connector-c-33-release-notes/).
···23 '';
24 };
2526+ apiTokenFile = mkOption {
27+ default = null;
28+ type = types.nullOr types.str;
29+ description = lib.mdDoc ''
30+ The path to a file containing the API Token
31+ used to authenticate with CloudFlare.
32+ '';
33+ };
34+35 apikeyFile = mkOption {
36 default = null;
37 type = types.nullOr types.str;
···64 Group = config.ids.gids.cfdyndns;
65 };
66 environment = {
067 CLOUDFLARE_RECORDS="${concatStringsSep "," cfg.records}";
68 };
69 script = ''
70 ${optionalString (cfg.apikeyFile != null) ''
71 export CLOUDFLARE_APIKEY="$(cat ${escapeShellArg cfg.apikeyFile})"
72+ export CLOUDFLARE_EMAIL="${cfg.email}"
73+ ''}
74+ ${optionalString (cfg.apiTokenFile != null) ''
75+ export CLOUDFLARE_APITOKEN="$(cat ${escapeShellArg cfg.apiTokenFile})"
76 ''}
77 ${pkgs.cfdyndns}/bin/cfdyndns
78 '';
+2-2
nixos/modules/services/networking/wstunnel.nix
···86 description = mdDoc "Address and port to listen on. Setting the port to a value below 1024 will also give the process the required `CAP_NET_BIND_SERVICE` capability.";
87 type = types.submodule hostPortSubmodule;
88 default = {
89- address = "0.0.0.0";
90 port = if config.enableHTTPS then 443 else 80;
91 };
92 defaultText = literalExpression ''
93 {
94- address = "0.0.0.0";
95 port = if enableHTTPS then 443 else 80;
96 }
97 '';
···86 description = mdDoc "Address and port to listen on. Setting the port to a value below 1024 will also give the process the required `CAP_NET_BIND_SERVICE` capability.";
87 type = types.submodule hostPortSubmodule;
88 default = {
89+ host = "0.0.0.0";
90 port = if config.enableHTTPS then 443 else 80;
91 };
92 defaultText = literalExpression ''
93 {
94+ host = "0.0.0.0";
95 port = if enableHTTPS then 443 else 80;
96 }
97 '';
+3-41
nixos/modules/services/web-apps/tt-rss.nix
···595 tt-rss = {
596 description = "Tiny Tiny RSS feeds update daemon";
597598- preStart = let
599- callSql = e:
600- if cfg.database.type == "pgsql" then ''
601- ${optionalString (cfg.database.password != null) "PGPASSWORD=${cfg.database.password}"} \
602- ${optionalString (cfg.database.passwordFile != null) "PGPASSWORD=$(cat ${cfg.database.passwordFile})"} \
603- ${config.services.postgresql.package}/bin/psql \
604- -U ${cfg.database.user} \
605- ${optionalString (cfg.database.host != null) "-h ${cfg.database.host} --port ${toString dbPort}"} \
606- -c '${e}' \
607- ${cfg.database.name}''
608-609- else if cfg.database.type == "mysql" then ''
610- echo '${e}' | ${config.services.mysql.package}/bin/mysql \
611- -u ${cfg.database.user} \
612- ${optionalString (cfg.database.password != null) "-p${cfg.database.password}"} \
613- ${optionalString (cfg.database.host != null) "-h ${cfg.database.host} -P ${toString dbPort}"} \
614- ${cfg.database.name}''
615-616- else "";
617-618- in (optionalString (cfg.database.type == "pgsql") ''
619- exists=$(${callSql "select count(*) > 0 from pg_tables where tableowner = user"} \
620- | tail -n+3 | head -n-2 | sed -e 's/[ \n\t]*//')
621-622- if [ "$exists" == 'f' ]; then
623- ${callSql "\\i ${pkgs.tt-rss}/schema/ttrss_schema_${cfg.database.type}.sql"}
624- else
625- echo 'The database contains some data. Leaving it as it is.'
626- fi;
627- '')
628-629- + (optionalString (cfg.database.type == "mysql") ''
630- exists=$(${callSql "select count(*) > 0 from information_schema.tables where table_schema = schema()"} \
631- | tail -n+2 | sed -e 's/[ \n\t]*//')
632-633- if [ "$exists" == '0' ]; then
634- ${callSql "\\. ${pkgs.tt-rss}/schema/ttrss_schema_${cfg.database.type}.sql"}
635- else
636- echo 'The database contains some data. Leaving it as it is.'
637- fi;
638- '');
639640 serviceConfig = {
641 User = "${cfg.user}";
···279 support your new systems.
280 Warning: the builder can execute all emulated systems within the same build, which introduces impurities in the case of cross compilation.
281 '';
282- type = types.listOf types.str;
283 };
284 };
285 };
···279 support your new systems.
280 Warning: the builder can execute all emulated systems within the same build, which introduces impurities in the case of cross compilation.
281 '';
282+ type = types.listOf (types.enum (builtins.attrNames magics));
283 };
284 };
285 };
···9 propagatedBuildInputs = [ zig ];
1011 substitutions = {
12+ # This zig_default_flags below is meant to avoid CPU feature impurity in
13+ # Nixpkgs. However, this flagset is "unstable": it is specifically meant to
14+ # be controlled by the upstream development team - being up to that team
15+ # exposing or not that flags to the outside (especially the package manager
16+ # teams).
17+18+ # Because of this hurdle, @andrewrk from Zig Software Foundation proposed
19+ # some solutions for this issue. Hopefully they will be implemented in
20+ # future releases of Zig. When this happens, this flagset should be
21+ # revisited accordingly.
22+23+ # Below are some useful links describing the discovery process of this 'bug'
24+ # in Nixpkgs:
25+26+ # https://github.com/NixOS/nixpkgs/issues/169461
27+ # https://github.com/NixOS/nixpkgs/issues/185644
28+ # https://github.com/NixOS/nixpkgs/pull/197046
29+ # https://github.com/NixOS/nixpkgs/pull/241741#issuecomment-1624227485
30+ # https://github.com/ziglang/zig/issues/14281#issuecomment-1624220653
31+32 zig_default_flags =
33 let
34 releaseType =
+3-23
pkgs/development/compilers/zig/setup-hook.sh
···1# shellcheck shell=bash disable=SC2154,SC2086
23-# This readonly zigDefaultBuildFlagsArray below is meant to avoid CPU feature
4-# impurity in Nixpkgs. However, this flagset is "unstable": it is specifically
5-# meant to be controlled by the upstream development team - being up to that
6-# team exposing or not that flags to the outside (especially the package manager
7-# teams).
8-9-# Because of this hurdle, @andrewrk from Zig Software Foundation proposed some
10-# solutions for this issue. Hopefully they will be implemented in future
11-# releases of Zig. When this happens, this flagset should be revisited
12-# accordingly.
13-14-# Below are some useful links describing the discovery process of this 'bug' in
15-# Nixpkgs:
16-17-# https://github.com/NixOS/nixpkgs/issues/169461
18-# https://github.com/NixOS/nixpkgs/issues/185644
19-# https://github.com/NixOS/nixpkgs/pull/197046
20-# https://github.com/NixOS/nixpkgs/pull/241741#issuecomment-1624227485
21-# https://github.com/ziglang/zig/issues/14281#issuecomment-1624220653
22-23readonly zigDefaultFlagsArray=(@zig_default_flags@)
2425function zigSetGlobalCacheDir {
···35 $zigBuildFlags "${zigBuildFlagsArray[@]}"
36 )
3738- echoCmd 'build flags' "${flagsArray[@]}"
39 zig build "${flagsArray[@]}"
4041 runHook postBuild
···49 $zigCheckFlags "${zigCheckFlagsArray[@]}"
50 )
5152- echoCmd 'check flags' "${flagsArray[@]}"
53 zig build test "${flagsArray[@]}"
5455 runHook postCheck
···69 flagsArray+=("${prefixKey:---prefix}" "$prefix")
70 fi
7172- echoCmd 'install flags' "${flagsArray[@]}"
73 zig build install "${flagsArray[@]}"
7475 runHook postInstall
···5 # also update version of the vim plugin in
6 # pkgs/applications/editors/vim/plugins/overrides.nix
7 # the version can be found in flake.nix of the source code
8- version = "0.5.6";
910 src = fetchFromGitHub {
11 owner = "nerdypepper";
12 repo = pname;
13 rev = "v${version}";
14- sha256 = "sha256-OQk80eTUufVUbYvZ38el2lmkgkU+5gr0hLTrBvzIp4A=";
15 };
1617- cargoSha256 = "sha256-j+FcV5JtO66Aa0ncIUfjuWtqnMmFb7zW7rNXttYBUU4=";
1819 buildFeatures = lib.optional withJson "json";
20
···5 # also update version of the vim plugin in
6 # pkgs/applications/editors/vim/plugins/overrides.nix
7 # the version can be found in flake.nix of the source code
8+ version = "0.5.8";
910 src = fetchFromGitHub {
11 owner = "nerdypepper";
12 repo = pname;
13 rev = "v${version}";
14+ sha256 = "sha256-bMs3XMiGP6sXCqdjna4xoV6CANOIWuISSzCaL5LYY4c=";
15 };
1617+ cargoSha256 = "sha256-QF7P0CWlKfBzVQC//eKhf/u1qV9AfLIJDxWDDWzMG8g=";
1819 buildFeatures = lib.optional withJson "json";
20
···1+{ stdenv
2+, cacert
3+, curl
4+, runCommandLocal
5+, lib
6+, autoPatchelfHook
7+, libcxx
8+, libcxxabi
9+, libGL
10+, gcc7
11+}:
12+13+stdenv.mkDerivation rec {
14+ pname = "blackmagic-desktop-video";
15+ version = "12.5a15";
16+17+ buildInputs = [
18+ autoPatchelfHook
19+ libcxx
20+ libcxxabi
21+ libGL
22+ gcc7.cc.lib
23+ ];
24+25+ # yes, the below download function is an absolute mess.
26+ # blame blackmagicdesign.
27+ src = runCommandLocal "${pname}-${lib.versions.majorMinor version}-src.tar.gz"
28+ rec {
29+ outputHashMode = "recursive";
30+ outputHashAlgo = "sha256";
31+ outputHash = "sha256-ss7Ab5dy7cmXp9LBirFXMeGY4ZbYHvWnXmYvNeBq0RY=";
32+33+ impureEnvVars = lib.fetchers.proxyImpureEnvVars;
34+35+ nativeBuildInputs = [ curl ];
36+37+ # ENV VARS
38+ SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
39+40+ # from the URL that the POST happens to, see browser console
41+ DOWNLOADID = "fecacc0f9b2f4c2e8bf2863e9e26c8e1";
42+ # from the URL the download page where you click the "only download" button is at
43+ REFERID = "052d944af6744608b27da496dfc4396d";
44+ SITEURL = "https://www.blackmagicdesign.com/api/register/us/download/${DOWNLOADID}";
45+46+ USERAGENT = builtins.concatStringsSep " " [
47+ "User-Agent: Mozilla/5.0 (X11; Linux ${stdenv.targetPlatform.linuxArch})"
48+ "AppleWebKit/537.36 (KHTML, like Gecko)"
49+ "Chrome/77.0.3865.75"
50+ "Safari/537.36"
51+ ];
52+53+ REQJSON = builtins.toJSON {
54+ "country" = "nl";
55+ "downloadOnly" = true;
56+ "platform" = "Linux";
57+ "policy" = true;
58+ };
59+60+ } ''
61+ RESOLVEURL=$(curl \
62+ -s \
63+ -H "$USERAGENT" \
64+ -H 'Content-Type: application/json;charset=UTF-8' \
65+ -H "Referer: https://www.blackmagicdesign.com/support/download/$REFERID/Linux" \
66+ --data-ascii "$REQJSON" \
67+ --compressed \
68+ "$SITEURL")
69+70+ curl \
71+ --retry 3 --retry-delay 3 \
72+ --compressed \
73+ "$RESOLVEURL" \
74+ > $out
75+ '';
76+77+ postUnpack = ''
78+ tar xf Blackmagic_Desktop_Video_Linux_${lib.versions.majorMinor version}/other/${stdenv.hostPlatform.uname.processor}/desktopvideo-${version}-${stdenv.hostPlatform.uname.processor}.tar.gz
79+ unpacked=$NIX_BUILD_TOP/desktopvideo-${version}-${stdenv.hostPlatform.uname.processor}
80+ '';
81+82+ installPhase = ''
83+ runHook preInstall
84+85+ mkdir -p $out/{bin,share/doc,lib/systemd/system}
86+ cp -r $unpacked/usr/share/doc/desktopvideo $out/share/doc
87+ cp $unpacked/usr/lib/*.so $out/lib
88+ cp $unpacked/usr/lib/systemd/system/DesktopVideoHelper.service $out/lib/systemd/system
89+ cp $unpacked/usr/lib/blackmagic/DesktopVideo/DesktopVideoHelper $out/bin/
90+91+ substituteInPlace $out/lib/systemd/system/DesktopVideoHelper.service --replace "/usr/lib/blackmagic/DesktopVideo/DesktopVideoHelper" "$out/bin/DesktopVideoHelper"
92+93+ runHook postInstall
94+ '';
95+96+ # i know this is ugly, but it's the cleanest way i found to tell the DesktopVideoHelper where to find its own library
97+ appendRunpaths = [ "$ORIGIN/../lib" ];
98+99+ meta = with lib; {
100+ homepage = "https://www.blackmagicdesign.com/support/family/capture-and-playback";
101+ maintainers = [ maintainers.hexchen ];
102+ license = licenses.unfree;
103+ description = "Supporting applications for Blackmagic Decklink. Doesn't include the desktop applications, only the helper required to make the driver work";
104+ platforms = platforms.linux;
105+ };
106+}
+2
pkgs/top-level/aliases.nix
···1305 percona-server = percona-server56; # Added 2022-11-01
1306 percona-server56 = throw "'percona-server56' has been dropped due to lack of maintenance, no upstream support and security issues"; # Added 2022-11-01
1307 percona-xtrabackup_2_4 = throw "'percona-xtrabackup_2_4' has been renamed to/replaced by 'percona-xtrabackup'"; # Added 2022-12-23
001308 perlXMLParser = throw "'perlXMLParser' has been renamed to/replaced by 'perlPackages.XMLParser'"; # Converted to throw 2022-02-22
1309 perlArchiveCpio = throw "'perlArchiveCpio' has been renamed to/replaced by 'perlPackages.ArchiveCpio'"; # Converted to throw 2022-02-22
1310 pgadmin = pgadmin4;
···1305 percona-server = percona-server56; # Added 2022-11-01
1306 percona-server56 = throw "'percona-server56' has been dropped due to lack of maintenance, no upstream support and security issues"; # Added 2022-11-01
1307 percona-xtrabackup_2_4 = throw "'percona-xtrabackup_2_4' has been renamed to/replaced by 'percona-xtrabackup'"; # Added 2022-12-23
1308+ perldevel = throw "'perldevel' has been dropped due to lack of updates in nixpkgs and lack of consistent support for devel versions by 'perl-cross' releases, use 'perl' instead";
1309+ perldevelPackages = perldevel;
1310 perlXMLParser = throw "'perlXMLParser' has been renamed to/replaced by 'perlPackages.XMLParser'"; # Converted to throw 2022-02-22
1311 perlArchiveCpio = throw "'perlArchiveCpio' has been renamed to/replaced by 'perlPackages.ArchiveCpio'"; # Converted to throw 2022-02-22
1312 pgadmin = pgadmin4;