Ubuntu 26.04 LTS ではデフォルトで uutils-coreutils と sudo-rs が採用されています[1]。これらはそれぞれ coreutils と sudo の Rust 実装で、メモリ安全性の向上が期待できます。今のところ NixOS がこのデフォルトに追従するという話は寡聞にして知りませんが、手元の設定を変えてこれらを使うようにすることは簡単にできるのでやってみます。ついでに、次の Ubuntu のリリースから採用されそうな ntpd-rs も使ってみます[2]。
#uutils-coreutils
environment.systemPackages に uutils-coreutils-noprefix を追加すると uutils-coreutils が使えるようになります[3]:
$ ls --version
ls (uutils coreutils) 0.8.0
ただし Nix Flake などを使って環境を固定しているところでは(当然)GNU coreutils が変わらず使用され続けます。特に nix develop を実行して入る devShells の環境ではデフォルトで GNU coreutils が使われます:
$ nix flake init
wrote: "/home/anqou/workspace/test-nix-flake/flake.nix"
$ nix develop
warning: creating lock file "/home/anqou/workspace/test-nix-flake/flake.lock":
• Added input 'nixpkgs':
'github:nixos/nixpkgs/549bd84d6279f9852cae6225e372cc67fb91a4c1?narHash=sha256-hGdgeU2Nk87RAuZyYjyDjFL6LK7dAZN5RE9%2BhrDTkDU%3D' (2026-05-05)
[anqou@anise:~/workspace/test-nix-flake]$ ls --version
ls (GNU coreutils) 9.10
Packaged by https://nixos.org
Copyright (C) 2026 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Richard M. Stallman and David MacKenzie.
[anqou@anise:~/workspace/test-nix-flake]$
なお NixOS Wiki の uutils の項を見ると system.replaceDependencies を使ってシステム全体で切り替える方法が載っていますが、一方で
Warning: as of February 2026 this seems to break nixos-rebuild, as uutils mv uses an interactive prompt where coreutils don’t
とも書かれているので、この方法は使わないほうが良さそうです。
#sudo-rs
NixOS Options に sudo-rs のサポートがあるので、これを使います:
security.sudo-rs.enable = true;
$ sudo --version
sudo-rs 0.2.13
sudo-rs のデフォルトではパスワードを入力すると * がフィードバックとして表示されます。従来の sudo と同様の挙動にするためには以下のように Defaults !pwfeedback を設定します(参考):
security.sudo-rs = {
enable = true;
extraConfig = "Defaults !pwfeedback";
};
#ntpd-rs
こちらも NixOS Options のサポートがあるのでこれを使います:
services.ntpd-rs.enable = true;
$ ntp-ctl status
Synchronization status:
Dispersion: 0.017432s, Delay: 0.012688s
Stratum: 3
Sources:
0.nixos.pool.ntp.org:123/103.131.151.30:123 (1): +0.001779±0.000531(±0.013423)s
poll interval: 512s, missing polls: 0
root dispersion: 0.014099s, root delay:0.003983s
... snip ...
3.nixos.pool.ntp.org:123/129.250.35.251:123 (16): +0.001097±0.001051(±0.015411)s
poll interval: 16s, missing polls: 0
root dispersion: 0.028946s, root delay:0.097778s
Servers: