infra/nix/home-manager/profiles/nix-channels.nix

29 lines
699 B
Nix
Raw Normal View History

{ pkgs
, config
, ...
}:
let
in {
home.file.".nix-channels".text = ''
'';
2018-11-04 14:53:10 +01:00
home.activation.removeExistingNixChannels = config.lib.dag.entryBefore ["checkLinkTargets"] ''
$DRY_RUN_CMD ${pkgs.writeScript "activation-script" ''
set -ex
if test -f $HOME/.nix-channels; then
echo Uninstalling available channels...
2021-12-24 15:07:44 +01:00
if test -f $HOME/.nix-channel; then
while read url channel; do
nix-channel --remove $channel
done < $HOME/.nix-channel
fi
echo Moving existing file away...
touch $HOME/.nix-channels.dummy
mv --backup=numbered $HOME/.nix-channels.dummy $HOME/.nix-channels
rm $HOME/.nix-channels
fi
''};
'';
}