···29293030## Variables controlling zig.hook {#variables-controlling-zig-hook}
31313232-### `dontUseZigBuild` {#dontUseZigBuild}
3232+### `zig.hook` Exclusive Variables {#zigHookExclusiveVariables}
33333434-Disables using `zigBuildPhase`.
3434+The variables below are exclusive to `zig.hook`.
35353636-### `zigBuildFlags` {#zigBuildFlags}
3636+#### `dontUseZigBuild` {#dontUseZigBuild}
37373838-Controls the flags passed to the build phase.
3838+Disables using `zigBuildPhase`.
39394040-### `dontUseZigCheck` {#dontUseZigCheck}
4040+#### `dontUseZigCheck` {#dontUseZigCheck}
41414242Disables using `zigCheckPhase`.
43434444-### `zigCheckFlags` {#zigCheckFlags}
4545-4646-Controls the flags passed to the check phase.
4747-4848-### `dontUseZigInstall` {#dontUseZigInstall}
4444+#### `dontUseZigInstall` {#dontUseZigInstall}
49455046Disables using `zigInstallPhase`.
51475252-### `zigInstallFlags` {#zigInstallFlags}
4848+### Similar variables {#similarVariables}
53495454-Controls the flags passed to the install phase.
5050+The following variables are similar to their `stdenv.mkDerivation` counterparts.
5151+5252+| `zig.hook` Variable | `stdenv.mkDerivation` Counterpart |
5353+|---------------------|-----------------------------------|
5454+| `zigBuildFlags` | `buildFlags` |
5555+| `zigCheckFlags` | `checkFlags` |
5656+| `zigInstallFlags` | `installFlags` |
55575658### Variables honored by zig.hook {#variables-honored-by-zig-hook}
5959+6060+The following variables commonly used by `stdenv.mkDerivation` are honored by `zig.hook`.
57615862- `prefixKey`
5963- `dontAddPrefix`
+2
nixos/doc/manual/release-notes/rl-2311.section.md
···231231232232- `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.
233233234234+- `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.
235235+234236- `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.
235237236238- 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/).
···8686 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.";
8787 type = types.submodule hostPortSubmodule;
8888 default = {
8989- address = "0.0.0.0";
8989+ host = "0.0.0.0";
9090 port = if config.enableHTTPS then 443 else 80;
9191 };
9292 defaultText = literalExpression ''
9393 {
9494- address = "0.0.0.0";
9494+ host = "0.0.0.0";
9595 port = if enableHTTPS then 443 else 80;
9696 }
9797 '';
+3-41
nixos/modules/services/web-apps/tt-rss.nix
···595595 tt-rss = {
596596 description = "Tiny Tiny RSS feeds update daemon";
597597598598- preStart = let
599599- callSql = e:
600600- if cfg.database.type == "pgsql" then ''
601601- ${optionalString (cfg.database.password != null) "PGPASSWORD=${cfg.database.password}"} \
602602- ${optionalString (cfg.database.passwordFile != null) "PGPASSWORD=$(cat ${cfg.database.passwordFile})"} \
603603- ${config.services.postgresql.package}/bin/psql \
604604- -U ${cfg.database.user} \
605605- ${optionalString (cfg.database.host != null) "-h ${cfg.database.host} --port ${toString dbPort}"} \
606606- -c '${e}' \
607607- ${cfg.database.name}''
608608-609609- else if cfg.database.type == "mysql" then ''
610610- echo '${e}' | ${config.services.mysql.package}/bin/mysql \
611611- -u ${cfg.database.user} \
612612- ${optionalString (cfg.database.password != null) "-p${cfg.database.password}"} \
613613- ${optionalString (cfg.database.host != null) "-h ${cfg.database.host} -P ${toString dbPort}"} \
614614- ${cfg.database.name}''
615615-616616- else "";
617617-618618- in (optionalString (cfg.database.type == "pgsql") ''
619619- exists=$(${callSql "select count(*) > 0 from pg_tables where tableowner = user"} \
620620- | tail -n+3 | head -n-2 | sed -e 's/[ \n\t]*//')
621621-622622- if [ "$exists" == 'f' ]; then
623623- ${callSql "\\i ${pkgs.tt-rss}/schema/ttrss_schema_${cfg.database.type}.sql"}
624624- else
625625- echo 'The database contains some data. Leaving it as it is.'
626626- fi;
627627- '')
628628-629629- + (optionalString (cfg.database.type == "mysql") ''
630630- exists=$(${callSql "select count(*) > 0 from information_schema.tables where table_schema = schema()"} \
631631- | tail -n+2 | sed -e 's/[ \n\t]*//')
632632-633633- if [ "$exists" == '0' ]; then
634634- ${callSql "\\. ${pkgs.tt-rss}/schema/ttrss_schema_${cfg.database.type}.sql"}
635635- else
636636- echo 'The database contains some data. Leaving it as it is.'
637637- fi;
638638- '');
598598+ preStart = ''
599599+ ${pkgs.php81}/bin/php ${cfg.root}/www/update.php --update-schema
600600+ '';
639601640602 serviceConfig = {
641603 User = "${cfg.user}";
+1-1
nixos/modules/system/boot/binfmt.nix
···279279 support your new systems.
280280 Warning: the builder can execute all emulated systems within the same build, which introduces impurities in the case of cross compilation.
281281 '';
282282- type = types.listOf types.str;
282282+ type = types.listOf (types.enum (builtins.attrNames magics));
283283 };
284284 };
285285 };
···99 propagatedBuildInputs = [ zig ];
10101111 substitutions = {
1212+ # This zig_default_flags below is meant to avoid CPU feature impurity in
1313+ # Nixpkgs. However, this flagset is "unstable": it is specifically meant to
1414+ # be controlled by the upstream development team - being up to that team
1515+ # exposing or not that flags to the outside (especially the package manager
1616+ # teams).
1717+1818+ # Because of this hurdle, @andrewrk from Zig Software Foundation proposed
1919+ # some solutions for this issue. Hopefully they will be implemented in
2020+ # future releases of Zig. When this happens, this flagset should be
2121+ # revisited accordingly.
2222+2323+ # Below are some useful links describing the discovery process of this 'bug'
2424+ # in Nixpkgs:
2525+2626+ # https://github.com/NixOS/nixpkgs/issues/169461
2727+ # https://github.com/NixOS/nixpkgs/issues/185644
2828+ # https://github.com/NixOS/nixpkgs/pull/197046
2929+ # https://github.com/NixOS/nixpkgs/pull/241741#issuecomment-1624227485
3030+ # https://github.com/ziglang/zig/issues/14281#issuecomment-1624220653
3131+1232 zig_default_flags =
1333 let
1434 releaseType =
+3-23
pkgs/development/compilers/zig/setup-hook.sh
···11# shellcheck shell=bash disable=SC2154,SC2086
2233-# This readonly zigDefaultBuildFlagsArray below is meant to avoid CPU feature
44-# impurity in Nixpkgs. However, this flagset is "unstable": it is specifically
55-# meant to be controlled by the upstream development team - being up to that
66-# team exposing or not that flags to the outside (especially the package manager
77-# teams).
88-99-# Because of this hurdle, @andrewrk from Zig Software Foundation proposed some
1010-# solutions for this issue. Hopefully they will be implemented in future
1111-# releases of Zig. When this happens, this flagset should be revisited
1212-# accordingly.
1313-1414-# Below are some useful links describing the discovery process of this 'bug' in
1515-# Nixpkgs:
1616-1717-# https://github.com/NixOS/nixpkgs/issues/169461
1818-# https://github.com/NixOS/nixpkgs/issues/185644
1919-# https://github.com/NixOS/nixpkgs/pull/197046
2020-# https://github.com/NixOS/nixpkgs/pull/241741#issuecomment-1624227485
2121-# https://github.com/ziglang/zig/issues/14281#issuecomment-1624220653
2222-233readonly zigDefaultFlagsArray=(@zig_default_flags@)
244255function zigSetGlobalCacheDir {
···3515 $zigBuildFlags "${zigBuildFlagsArray[@]}"
3616 )
37173838- echoCmd 'build flags' "${flagsArray[@]}"
1818+ echoCmd 'zig build flags' "${flagsArray[@]}"
3919 zig build "${flagsArray[@]}"
40204121 runHook postBuild
···4929 $zigCheckFlags "${zigCheckFlagsArray[@]}"
5030 )
51315252- echoCmd 'check flags' "${flagsArray[@]}"
3232+ echoCmd 'zig check flags' "${flagsArray[@]}"
5333 zig build test "${flagsArray[@]}"
54345535 runHook postCheck
···6949 flagsArray+=("${prefixKey:---prefix}" "$prefix")
7050 fi
71517272- echoCmd 'install flags' "${flagsArray[@]}"
5252+ echoCmd 'zig install flags' "${flagsArray[@]}"
7353 zig build install "${flagsArray[@]}"
74547555 runHook postInstall
···55 # also update version of the vim plugin in
66 # pkgs/applications/editors/vim/plugins/overrides.nix
77 # the version can be found in flake.nix of the source code
88- version = "0.5.6";
88+ version = "0.5.8";
991010 src = fetchFromGitHub {
1111 owner = "nerdypepper";
1212 repo = pname;
1313 rev = "v${version}";
1414- sha256 = "sha256-OQk80eTUufVUbYvZ38el2lmkgkU+5gr0hLTrBvzIp4A=";
1414+ sha256 = "sha256-bMs3XMiGP6sXCqdjna4xoV6CANOIWuISSzCaL5LYY4c=";
1515 };
16161717- cargoSha256 = "sha256-j+FcV5JtO66Aa0ncIUfjuWtqnMmFb7zW7rNXttYBUU4=";
1717+ cargoSha256 = "sha256-QF7P0CWlKfBzVQC//eKhf/u1qV9AfLIJDxWDDWzMG8g=";
18181919 buildFeatures = lib.optional withJson "json";
2020
···11+{ stdenv
22+, cacert
33+, curl
44+, runCommandLocal
55+, lib
66+, autoPatchelfHook
77+, libcxx
88+, libcxxabi
99+, libGL
1010+, gcc7
1111+}:
1212+1313+stdenv.mkDerivation rec {
1414+ pname = "blackmagic-desktop-video";
1515+ version = "12.5a15";
1616+1717+ buildInputs = [
1818+ autoPatchelfHook
1919+ libcxx
2020+ libcxxabi
2121+ libGL
2222+ gcc7.cc.lib
2323+ ];
2424+2525+ # yes, the below download function is an absolute mess.
2626+ # blame blackmagicdesign.
2727+ src = runCommandLocal "${pname}-${lib.versions.majorMinor version}-src.tar.gz"
2828+ rec {
2929+ outputHashMode = "recursive";
3030+ outputHashAlgo = "sha256";
3131+ outputHash = "sha256-ss7Ab5dy7cmXp9LBirFXMeGY4ZbYHvWnXmYvNeBq0RY=";
3232+3333+ impureEnvVars = lib.fetchers.proxyImpureEnvVars;
3434+3535+ nativeBuildInputs = [ curl ];
3636+3737+ # ENV VARS
3838+ SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
3939+4040+ # from the URL that the POST happens to, see browser console
4141+ DOWNLOADID = "fecacc0f9b2f4c2e8bf2863e9e26c8e1";
4242+ # from the URL the download page where you click the "only download" button is at
4343+ REFERID = "052d944af6744608b27da496dfc4396d";
4444+ SITEURL = "https://www.blackmagicdesign.com/api/register/us/download/${DOWNLOADID}";
4545+4646+ USERAGENT = builtins.concatStringsSep " " [
4747+ "User-Agent: Mozilla/5.0 (X11; Linux ${stdenv.targetPlatform.linuxArch})"
4848+ "AppleWebKit/537.36 (KHTML, like Gecko)"
4949+ "Chrome/77.0.3865.75"
5050+ "Safari/537.36"
5151+ ];
5252+5353+ REQJSON = builtins.toJSON {
5454+ "country" = "nl";
5555+ "downloadOnly" = true;
5656+ "platform" = "Linux";
5757+ "policy" = true;
5858+ };
5959+6060+ } ''
6161+ RESOLVEURL=$(curl \
6262+ -s \
6363+ -H "$USERAGENT" \
6464+ -H 'Content-Type: application/json;charset=UTF-8' \
6565+ -H "Referer: https://www.blackmagicdesign.com/support/download/$REFERID/Linux" \
6666+ --data-ascii "$REQJSON" \
6767+ --compressed \
6868+ "$SITEURL")
6969+7070+ curl \
7171+ --retry 3 --retry-delay 3 \
7272+ --compressed \
7373+ "$RESOLVEURL" \
7474+ > $out
7575+ '';
7676+7777+ postUnpack = ''
7878+ tar xf Blackmagic_Desktop_Video_Linux_${lib.versions.majorMinor version}/other/${stdenv.hostPlatform.uname.processor}/desktopvideo-${version}-${stdenv.hostPlatform.uname.processor}.tar.gz
7979+ unpacked=$NIX_BUILD_TOP/desktopvideo-${version}-${stdenv.hostPlatform.uname.processor}
8080+ '';
8181+8282+ installPhase = ''
8383+ runHook preInstall
8484+8585+ mkdir -p $out/{bin,share/doc,lib/systemd/system}
8686+ cp -r $unpacked/usr/share/doc/desktopvideo $out/share/doc
8787+ cp $unpacked/usr/lib/*.so $out/lib
8888+ cp $unpacked/usr/lib/systemd/system/DesktopVideoHelper.service $out/lib/systemd/system
8989+ cp $unpacked/usr/lib/blackmagic/DesktopVideo/DesktopVideoHelper $out/bin/
9090+9191+ substituteInPlace $out/lib/systemd/system/DesktopVideoHelper.service --replace "/usr/lib/blackmagic/DesktopVideo/DesktopVideoHelper" "$out/bin/DesktopVideoHelper"
9292+9393+ runHook postInstall
9494+ '';
9595+9696+ # i know this is ugly, but it's the cleanest way i found to tell the DesktopVideoHelper where to find its own library
9797+ appendRunpaths = [ "$ORIGIN/../lib" ];
9898+9999+ meta = with lib; {
100100+ homepage = "https://www.blackmagicdesign.com/support/family/capture-and-playback";
101101+ maintainers = [ maintainers.hexchen ];
102102+ license = licenses.unfree;
103103+ description = "Supporting applications for Blackmagic Decklink. Doesn't include the desktop applications, only the helper required to make the driver work";
104104+ platforms = platforms.linux;
105105+ };
106106+}
+2
pkgs/top-level/aliases.nix
···13051305 percona-server = percona-server56; # Added 2022-11-01
13061306 percona-server56 = throw "'percona-server56' has been dropped due to lack of maintenance, no upstream support and security issues"; # Added 2022-11-01
13071307 percona-xtrabackup_2_4 = throw "'percona-xtrabackup_2_4' has been renamed to/replaced by 'percona-xtrabackup'"; # Added 2022-12-23
13081308+ 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";
13091309+ perldevelPackages = perldevel;
13081310 perlXMLParser = throw "'perlXMLParser' has been renamed to/replaced by 'perlPackages.XMLParser'"; # Converted to throw 2022-02-22
13091311 perlArchiveCpio = throw "'perlArchiveCpio' has been renamed to/replaced by 'perlPackages.ArchiveCpio'"; # Converted to throw 2022-02-22
13101312 pgadmin = pgadmin4;