Closed kachick closed 1 month ago
systemd-hwdb-update.service ใฎ ConditionNeedsUpdate ใใณใกใณใใขใฆใใใใจๅ่ตทๅใใใใณใซ่ชๅ็ใซๆดๆฐใใใพใ:
services.systemd-sysusers = {
# Enable switch-to-configuration to restart the service.
unitConfig.ConditionNeedsUpdate = [ "" ];
https://github.com/NixOS/nixpkgs/blob/9133b9f5554437083a6618581eeae88c53593b0d/nixos/doc/manual/release-notes/rl-2305.section.md?plain=1#L268 https://github.com/systemd/systemd/pull/25714 https://github.com/NixOS/nixpkgs/blob/9133b9f5554437083a6618581eeae88c53593b0d/nixos/modules/services/hardware/udev.nix#L158
hwdbBin = pkgs.runCommand "hwdb.bin"
{ preferLocalBuild = true;
allowSubstitutes = false;
packages = lib.unique (map toString ([udev] ++ cfg.packages));
}
''
mkdir -p etc/udev/hwdb.d
for i in $packages; do
echo "Adding hwdb files for package $i"
for j in $i/{etc,lib}/udev/hwdb.d/*; do
ln -s $j etc/udev/hwdb.d/$(basename $j)
done
done
echo "Generating hwdb database..."
# hwdb --update doesn't return error code even on errors!
res="$(${pkgs.buildPackages.systemd}/bin/systemd-hwdb --root=$(pwd) update 2>&1)"
echo "$res"
[ -z "$(echo "$res" | egrep '^Error')" ]
mv etc/udev/hwdb.bin $out
'';
dotfiles main(0be7fe5) direnv loaded/allowed via ๐น v1.22.6 1m26s via โ๏ธ impure (nix-shell-env) zsh
> lat /etc/udev
0755 - 10-02 03:33 /etc/udev
0777 - 10-02 03:33 โโโ rules.d -> /etc/static/udev/rules.d
0755 - 10-02 03:33 โโโ hwdb.d
0777 - 10-02 03:33 โ โโโ 98-keyboards.hwdb -> /etc/static/udev/hwdb.d/98-keyboards.hwdb
0777 - 10-02 03:33 โ โโโ 99-local.hwdb -> /etc/static/udev/hwdb.d/99-local.hwdb
0777 - 10-02 03:33 โโโ hwdb.bin -> /etc/static/udev/hwdb.bin
dotfiles main(0be7fe5) direnv loaded/allowed via ๐น v1.22.6 via โ๏ธ impure (nix-shell-env) zsh
> sudo systemd-hwdb update && sudo udevadm trigger
dotfiles main(0be7fe5) direnv loaded/allowed via ๐น v1.22.6 via โ๏ธ impure (nix-shell-env) zsh
> lat /etc/udev
0755 - 10-02 03:35 /etc/udev
0777 - 10-02 03:33 โโโ rules.d -> /etc/static/udev/rules.d
0755 - 10-02 03:33 โโโ hwdb.d
0777 - 10-02 03:33 โ โโโ 98-keyboards.hwdb -> /etc/static/udev/hwdb.d/98-keyboards.hwdb
0777 - 10-02 03:33 โ โโโ 99-local.hwdb -> /etc/static/udev/hwdb.d/99-local.hwdb
0444 13M 10-02 03:35 โโโ hwdb.bin
systemd-hwdb update
is actually replacing the symlink with binary.
The generated symlink by NixOS is not correct?
Once applied with sudo systemd-hwdb update && sudo udevadm trigger
and sudo reboot now
. the hwdb.bin will back to symlink. However in the state, it continue to work even thorough reboot again. So just adding the step after nixos-rebuild switch
is enough for workaround. :thinking:
This problem looks still exists...
sudo reboot now. the hwdb.bin will back to symlink. However in the state, it continue to work even thorough reboot again.
Looks wrong
https://github.com/kachick/dotfiles/issues/784 https://github.com/kachick/dotfiles/pull/786
:cry: