Add get-notes in home-manager activation script
This commit is contained in:
parent
7440a6662f
commit
82b0838f5c
|
@ -4,6 +4,7 @@
|
|||
./alacritty.nix
|
||||
./zotero.nix
|
||||
./fontconfig.nix
|
||||
./notes.nix
|
||||
];
|
||||
|
||||
# Global packages for desktop environments
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
let
|
||||
user = config.home.username;
|
||||
in
|
||||
{
|
||||
home.activation.get-notes = lib.hm.dag.entryAfter [ "installPackages" ] ''
|
||||
notes_dir=/home/${user}/.local/share/notes
|
||||
remote=git@git.bitlab21.com:sam/notes
|
||||
if [ -d "$notes_dir" ];
|
||||
then
|
||||
cd "$notes_dir"
|
||||
[ ! -d .git ] && PATH="${pkgs.git}/bin:${pkgs.openssh}/bin:$PATH" git clone "$remote" "$notes_dir"
|
||||
else
|
||||
mkdir -p "$notes_dir" && PATH="${pkgs.git}/bin:${pkgs.openssh}/bin:$PATH" git clone "$remote" "$notes_dir"
|
||||
fi
|
||||
exit 0
|
||||
'';
|
||||
}
|
Loading…
Reference in New Issue