英文:
Can't run docker without sudo on NixOS
问题
我按照这个链接的说明:https://nixos.wiki/wiki/Docker,在我的configuration.nix文件中添加了以下内容:
users.users.<myUsername> = { # 我的实际用户名
isNormalUser = true;
description = "<myUsername>";
extraGroups = [ "networkmanager" "wheel" "kvm" "libvirtd" "docker"];
packages = with pkgs; [];
};
virtualisation.docker.enable = true;
并且在/etc/group文件中添加了:
docker:x:131:<myUsername>
我已经登入和登出,但每次仍然需要键入sudo?我对Nix和Linux都很陌生,不知道问题出在哪里。感谢任何帮助!
英文:
I followed this: https://nixos.wiki/wiki/Docker, and in my configuration.nix i have
users.users.<myUsername> = { #my actual username
isNormalUser = true;
description = "<myUsername>";
extraGroups = [ "networkmanager" "wheel" "kvm" "libvirtd" "docker"];
packages = with pkgs; [];
};
virtualisation.docker.enable = true;
and in /etc/group
docker:x:131:<myUsername>
I logged in and out but I still need to type sudo every time? I'm very new to nix and new-ish to linux and I have no idea what could be wrong. Any help is appreciated!
答案1
得分: 1
登录然后退出不足以解决问题。重新启动有效。
英文:
Logging in and back out was not enough. Restarting worked.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论