Keep channels sync across multiple users

Let’s say we have tree users each one with a copy of nix-channels. Since each user can use the command nix-channel each user could potentially change their main repo nixos to something else like unstable, but how do you ensure that every user has the same nixos channel as root?

├── Alice
│   └── .nix-channels
├── John
│   └── .nix-channels
└── Rob
    └── .nix-channels

How do you guys keep sync between root and your user without the hassle of running sudo nix-channel --update && nix-channel --update?

We don’t care. We just let the users use their channels. They might have a reason for not updating, or for using a totally different channel.

oh right, but lets say i want to keep sync between my user and root, is there any option for configuration.nix that would enable symlinks between these files?

The easiest option is to not add a nixpkgs channel then.

Nixos usually adds nixpkgs through the NIX_PATH and makes it point to where roots nixos channel lives.

1 Like