nix: add channel configuration and rework update process

This commit is contained in:
steveej 2018-11-03 11:45:40 +01:00
parent 239c2c9c44
commit dd4cd9aaf4
14 changed files with 137 additions and 51 deletions

View file

@ -0,0 +1,34 @@
{ pkgs
, config
, ...
}:
let
in {
home.file.".nix-channels".text = ''
https://nixos.org/channels/nixos-18.09 nixos
https://nixos.org/channels/nixos-unstable nixos-unstable
'';
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 Moving existing file away...
touch $HOME/.nix-channels.dummy
mv --backup=numbered $HOME/.nix-channels.dummy $HOME/.nix-channels
rm $HOME/.nix-channels
fi
''};
'';
nixpkgs.config = {
packageOverrides = pkgs: with pkgs; {
homeshick = builtins.fetchGit {
url = "https://github.com/andsens/homeshick.git";
ref = "master";
};
};
};
}