Update common.nix

This commit is contained in:
ediblerope 2025-12-04 12:34:23 +00:00 committed by GitHub
parent 2ddf7ec35b
commit 8212853402
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -27,7 +27,8 @@ networking.networkmanager.enable = true;
# Shell aliases
environment.shellAliases = {
update = ''
if ! nix-channel --list | grep -q "nixos.*nixos-unstable"; then
CHANNEL=$(sudo nix-channel --list | grep "^nixos " | awk '{print $2}')
if [[ "$CHANNEL" != *"nixos-unstable"* ]]; then
echo "Switching to nixos-unstable channel..."
sudo nix-channel --add https://nixos.org/channels/nixos-unstable nixos
sudo nix-channel --update