<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>NixOS on CuSO4_Deposit</title><link>https://depoze.xyz/tags/nixos/</link><description>Recent content in NixOS on CuSO4_Deposit</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Mon, 28 Sep 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://depoze.xyz/tags/nixos/index.xml" rel="self" type="application/rss+xml"/><item><title>找出所有依赖于特定 nix 包的其他包 - 记录 Qt5 被 deprecate 的修复</title><link>https://depoze.xyz/pages/nix-reverse-deps/</link><pubDate>Sat, 30 Aug 2025 00:00:00 +0000</pubDate><guid>https://depoze.xyz/pages/nix-reverse-deps/</guid><description>&lt;p&gt;TL;DR 使用以下命令可以找到所有依赖于特定包的其他 nix 包。&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;$ nix-store --query --referrers /nix/store/xxxxx&#10;&lt;/code&gt;&lt;/pre&gt;&lt;hr&gt;&#10;&lt;p&gt;今天在执行 &lt;code&gt;nixos-rebuild&lt;/code&gt; 时，出现了如下报错：&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;$ nrbt M A&#10;warning: Git tree &amp;#39;/home/cuso4d/.nixos&amp;#39; is dirty&#10;building the system configuration...&#10;warning: Git tree &amp;#39;/home/cuso4d/.nixos&amp;#39; is dirty&#10;error:&#10; … while calling the &amp;#39;head&amp;#39; builtin&#10; at /nix/store/4hm8lf740i8qvyg5pzdqfm0rpshwb7vn-source/lib/attrsets.nix:1544:13:&#10; 1543| if length values == 1 || pred here (elemAt values 1) (head values) then&#10; 1544| head values&#10; | ^&#10; 1545| else&#10;&#10; … while evaluating the attribute &amp;#39;value&amp;#39;&#10; at /nix/store/4hm8lf740i8qvyg5pzdqfm0rpshwb7vn-source/lib/modules.nix:1118:7:&#10; 1117| // {&#10; 1118| value = addErrorContext &amp;#34;while evaluating the option `${showOption loc}&amp;#39;:&amp;#34; value;&#10; | ^&#10; 1119| inherit (res.defsFinal&amp;#39;) highestPrio;&#10;&#10; … while evaluating the option `system.build.toplevel&amp;#39;:&#10;&#10; … while evaluating definitions from `/nix/store/4hm8lf740i8qvyg5pzdqfm0rpshwb7vn-source/nixos/modules/system/activation/top-level.nix&amp;#39;:&#10;&#10; … while evaluating the option `warnings&amp;#39;:&#10;&#10; … while evaluating definitions from `/nix/store/4hm8lf740i8qvyg5pzdqfm0rpshwb7vn-source/nixos/modules/system/boot/systemd.nix&amp;#39;:&#10;&#10; … while evaluating the option `systemd.services.home-manager-cuso4d.serviceConfig&amp;#39;:&#10;&#10; … while evaluating definitions from `/nix/store/7wkrw49sgffqpd9vm7dfa4ngbh4n2fk5-source/nixos&amp;#39;:&#10;&#10; … while evaluating the option `home-manager.users.cuso4d.home.file.&amp;#34;/home/cuso4d/.config/fontconfig/conf.d/10-hm-fonts.conf&amp;#34;.source&amp;#39;:&#10;&#10; … while evaluating definitions from `/nix/store/7wkrw49sgffqpd9vm7dfa4ngbh4n2fk5-source/modules/files.nix&amp;#39;:&#10;&#10; … while evaluating the option `home-manager.users.cuso4d.home.file.&amp;#34;/home/cuso4d/.config/fontconfig/conf.d/10-hm-fonts.conf&amp;#34;.text&amp;#39;:&#10;&#10; … while evaluating definitions from `/nix/store/7wkrw49sgffqpd9vm7dfa4ngbh4n2fk5-source/modules/misc/xdg.nix&amp;#39;:&#10;&#10; … while evaluating the option `home-manager.users.cuso4d.xdg.configFile.&amp;#34;fontconfig/conf.d/10-hm-fonts.conf&amp;#34;.text&amp;#39;:&#10;&#10; … while evaluating definitions from `/nix/store/7wkrw49sgffqpd9vm7dfa4ngbh4n2fk5-source/modules/misc/fontconfig.nix&amp;#39;:&#10;&#10; (stack trace truncated; use &amp;#39;--show-trace&amp;#39; to show the full, detailed trace)&#10;&#10; error: Package ‘qtwebengine-5.15.19’ in /nix/store/4hm8lf740i8qvyg5pzdqfm0rpshwb7vn-source/pkgs/development/libraries/qt-5/modules/qtwebengine.nix:442 is marked as insecure, refusing to evaluate.&#10;&#10;&#10; Known issues:&#10; - qt5 qtwebengine is unmaintained upstream since april 2025.&#10; It is based on chromium 87.0.4280.144, and supposedly patched up to 135.0.7049.95 which is outdated.&#10;&#10; Security issues are frequently discovered in chromium.&#10; The following list of CVEs was fixed in the life cycle of chromium 138 and likely also affects qtwebengine:&#10; - CVE-2025-8879&#10; - CVE-2025-8880&#10; - CVE-2025-8901&#10; - CVE-2025-8881&#10; - CVE-2025-8882&#10; - CVE-2025-8576&#10; - CVE-2025-8577&#10; - CVE-2025-8578&#10; - CVE-2025-8579&#10; - CVE-2025-8580&#10; - CVE-2025-8581&#10; - CVE-2025-8582&#10; - CVE-2025-8583&#10; - CVE-2025-8292&#10; - CVE-2025-8010&#10; - CVE-2025-8011&#10; - CVE-2025-7656&#10; - CVE-2025-6558 (known to be exploited in the wild)&#10; - CVE-2025-7657&#10; - CVE-2025-6554&#10; - CVE-2025-6555&#10; - CVE-2025-6556&#10; - CVE-2025-6557&#10;&#10; The actual list of CVEs affecting qtwebengine is likely much longer,&#10; as this list is missing issues fixed in chromium 136/137 and even more&#10; issues are continuously discovered and lack upstream fixes in qtwebengine.&#10;&#10;&#10; You can install it anyway by allowing this package, using the&#10; following methods:&#10;&#10; a) To temporarily allow all insecure packages, you can use an environment&#10; variable for a single invocation of the nix tools:&#10;&#10; $ export NIXPKGS_ALLOW_INSECURE=1&#10;&#10; Note: When using `nix shell`, `nix build`, `nix develop`, etc with a flake,&#10; then pass `--impure` in order to allow use of environment variables.&#10;&#10; b) for `nixos-rebuild` you can add ‘qtwebengine-5.15.19’ to&#10; `nixpkgs.config.permittedInsecurePackages` in the configuration.nix,&#10; like so:&#10;&#10; {&#10; nixpkgs.config.permittedInsecurePackages = [&#10; &amp;#34;qtwebengine-5.15.19&amp;#34;&#10; ];&#10; }&#10;&#10; c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add&#10; ‘qtwebengine-5.15.19’ to `permittedInsecurePackages` in&#10; ~/.config/nixpkgs/config.nix, like so:&#10;&#10; {&#10; permittedInsecurePackages = [&#10; &amp;#34;qtwebengine-5.15.19&amp;#34;&#10; ];&#10; }&#10;Command &amp;#39;nix --extra-experimental-features &amp;#39;nix-command flakes&amp;#39; build --print-out-paths &amp;#39;/home/cuso4d/.nixos#nixosConfigurations.&amp;#34;nightcord-dynamica&amp;#34;.config.system.build.toplevel&amp;#39; --no-link&amp;#39; returned non-zero exit status 1.&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;可以看出，在构建的过程中，&lt;code&gt;qtwebengine-5.15.19&lt;/code&gt; 这个包阻碍了构建。我需要找到是哪些包依赖了这个，从而进行对系统配置相对应的调整。&lt;/p&gt;</description></item><item><title>NixOS 上 build loong64 docker 镜像</title><link>https://depoze.xyz/pages/nixos-loong64-docker/</link><pubDate>Fri, 20 Jun 2025 00:00:00 +0000</pubDate><guid>https://depoze.xyz/pages/nixos-loong64-docker/</guid><description>&lt;p&gt;在 x86_64 平台上使用 docker buildx 尝试交叉编译 loong64 的镜像时，出现问题：&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;1 warning found (use docker --debug to expand):&#10;- InvalidBaseImagePlatform: Base image lcr.loongnix.cn/library/node:22.15-alpine3.21 was pulled with platform &amp;#34;linux/loong64&amp;#34;, expected &amp;#34;linux/amd64&amp;#34; for current build&#10;&#10;ERROR: failed to solve: process &amp;#34;/bin/sh -c npm run build&amp;#34; did not complete successfully: exit code: 1&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;在尝试 build 其他平台上的镜像的时候，需要提供的 build arg 是 &lt;code&gt;--build-arg BUILDPLATFORM=&amp;lt;arch&amp;gt;&lt;/code&gt;。docker buildx 使用的 builder 可以通过 &lt;code&gt;docker buildx ls&lt;/code&gt; 来看到。找到正在使用的 builder 并 inspect：&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f7f7f7;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-shell-session" data-lang="shell-session"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# docker buildx ls&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#1f2328"&gt;[sudo] password for cuso4d:&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#1f2328"&gt;NAME/NODE DRIVER/ENDPOINT STATUS BUILDKIT PLATFORMS&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#1f2328"&gt;default* docker&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#1f2328"&gt; \_ default \_ default running v0.22.0 linux/amd64, linux/arm64, linux/386&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#1f2328"&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# docker buildx inspect default&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#1f2328"&gt;ame: default&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#1f2328"&gt;Driver: docker&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#1f2328"&gt;Last Activity: 2025-06-20 09:43:16 +0000 UTC&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f6f8fa;background-color:#82071e"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#1f2328"&gt;Nodes:&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#1f2328"&gt;Name: default&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#1f2328"&gt;Endpoint: default&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#1f2328"&gt;Status: running&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#1f2328"&gt;BuildKit version: v0.22.0&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#1f2328"&gt;Platforms: linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/386&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#1f2328"&gt;Labels:&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#1f2328"&gt; org.mobyproject.buildkit.worker.moby.host-gateway-ip: 172.17.0.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#1f2328"&gt;...&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;可以看到 Platforms 里是没有 loong64 的。因此 build 会失败。对这个问题的解决方案，是 docker 将会跑一个 qemu 虚拟机来运行对应平台上的 build。这个 qemu 通常的注入的方式是跑一个容器。龙芯的在这里：&lt;/p&gt;</description></item></channel></rss>