mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
feat: overhauled template system (WIP)
This commit is contained in:
parent
442b7b2e0e
commit
11eb077113
14 changed files with 330 additions and 125 deletions
|
|
@ -21,41 +21,8 @@
|
|||
ts2t
|
||||
vershell
|
||||
eontimer
|
||||
project
|
||||
|
||||
swarsel-bootstrap
|
||||
|
||||
(pkgs.writeScriptBin "project" ''
|
||||
#! ${pkgs.bash}/bin/bash
|
||||
if [ "$1" == "rust" ]; then
|
||||
cp ~/.dotfiles/templates/rust_flake.nix ./flake.nix
|
||||
cp ~/.dotfiles/templates/toolchain.toml .
|
||||
elif [ "$1" == "cpp" ]; then
|
||||
cp ~/.dotfiles/templates/cpp_flake.nix ./flake.nix
|
||||
elif [ "$1" == "python" ]; then
|
||||
cp ~/.dotfiles/templates/py_flake.nix ./flake.nix
|
||||
elif [ "$1" == "cuda" ]; then
|
||||
cp ~/.dotfiles/templates/cu_flake.nix ./flake.nix
|
||||
elif [ "$1" == "other" ]; then
|
||||
cp ~/.dotfiles/templates/other_flake.nix ./flake.nix
|
||||
elif [ "$1" == "latex" ]; then
|
||||
if [ "$2" == "" ]; then
|
||||
echo "No filename specified, usage: 'project latex <NAME>'"
|
||||
exit 0
|
||||
fi
|
||||
cp ~/.dotfiles/templates/tex_standard.tex ./"$2".tex
|
||||
exit 0
|
||||
else
|
||||
echo "No valid argument given. Valid arguments are rust cpp python, cuda"
|
||||
exit 0
|
||||
fi
|
||||
echo "use flake" >> .envrc
|
||||
direnv allow
|
||||
'')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ _:
|
|||
{
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
silent = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue