add home activation script

This commit is contained in:
Noah Masur 2022-05-30 16:07:43 -04:00
parent 60fe4caed4
commit 3656ed7e8f
2 changed files with 20 additions and 1 deletions

View File

@ -5,7 +5,7 @@
home-manager.users.${config.user} = {
home.packages = with pkgs; [
gnome.nautilus
gnome.sushi # Quick preview
gnome.sushi # Quick preview with spacebar
];
};
};

View File

@ -0,0 +1,19 @@
{ config, pkgs, lib, ... }: {
home-manager.users.${config.user} = {
home.activation = {
# Always clone dotfiles repository if it doesn't exist
cloneDotfiles = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
if [ ! -d "${config.dotfilesPath}" ]; then
$DRY_RUN_CMD mkdir --parents $VERBOSE_ARG $(dirname ${config.dotfilesPath})
$DRY_RUN_CMD ${pkgs.git}/bin/git clone https://github.com/nmasur/dotfiles ${config.dotfilesPath}
fi
'';
};
};
}