diff --git a/home/home.nix b/home/home.nix index b5dc7e5..1e5760f 100644 --- a/home/home.nix +++ b/home/home.nix @@ -30,6 +30,7 @@ in { ./direnv.nix ./git.nix ./ssh.nix + ./templates.nix ./vim.nix ./xonsh.nix ] ++ guiImports; diff --git a/home/templates.nix b/home/templates.nix new file mode 100644 index 0000000..7f6ccb8 --- /dev/null +++ b/home/templates.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: + +{ + home.packages = [ + pkgs.cookiecutter + ]; +} diff --git a/home/xonsh.nix b/home/xonsh.nix index 2c8225e..de98877 100644 --- a/home/xonsh.nix +++ b/home/xonsh.nix @@ -109,6 +109,14 @@ def _newdock(args): def _unknown_host(args): sed -i -e @(args[0])d ~/.ssh/known_hosts +def _bake(args): + from pathlib import Path + templates = Path("~/.copier-templates/").expanduser() + if not templates.exists(): + git clone src:greg/copier-templates.git ~/.copier-templates + copier copy @(str(templates / args[0])) . + +aliases['bake'] = _bake aliases['rebuild'] = _rebuild aliases['yaml2json'] = _yaml2json aliases['py2env'] = _py2env