mirror of
https://github.com/nmasur/dotfiles
synced 2024-09-20 04:44:45 +00:00
29 lines
739 B
Nix
29 lines
739 B
Nix
{ config, pkgs, lib, ... }: {
|
|
|
|
home-manager.users.${config.user} = {
|
|
|
|
home.activation = {
|
|
|
|
# Always clone dotfiles repository if it doesn't exist
|
|
cloneDotfiles =
|
|
config.home-manager.users.${config.user}.lib.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 ${config.dotfilesRepo} "${config.dotfilesPath}"
|
|
fi
|
|
'';
|
|
|
|
};
|
|
|
|
programs.fish = {
|
|
shellAbbrs = {
|
|
nr = lib.mkIf pkgs.stdenv.isLinux
|
|
"doas nixos-rebuild switch --flake ${config.dotfilesPath}";
|
|
};
|
|
};
|
|
|
|
};
|
|
|
|
}
|