Setting Up A Repo In Under 5 Minutes As Software Engineers With Nix
Again: What should setting up a new repo look like?
It should be something like this:
- ‘Create this kind of project’
- Initialize the git repo
- Create the first commit
- Create the repo upstream
origin - Then, push to
origin, and setoriginas upstream.
Okay. Let’s say I want to create a new static website project. This is my workflow:
> md new-website> nft my#pollen-template> gi> gam "Initial commit"> ghi new-website> gpoCan’t understand anything? Well, all of them are aliases/shell functions/abbreviations. This is what I typed:
> mkdir new-website && cd new-website> nix flake init --template github:haglobah/flakes#pollen-template> git init> git add . && git commit --message "Initial commit"> gh repo create new-website --private --source=. --remote=origin> git push --set-upstream originAnd of course, it already brings its own devshell.
How do you set up a new project? And do you have any suggestions for a better workflow? Let me hear in the comments!
Update (01/2026):
In the meantime, I’ve refined my aliases.
What I’m now thinking of when creating a repo is this:
- ‘Create this kind of project’
- ‘Make this version controlled’
- ‘Make the devshell work automatically’
- ‘Change the
flake.nixto my liking’ - ‘Create this repo on Github’
Which makes it those commands
> np new-project devshell just> gim> ud> # edit flake.nix> ghoAnd those expand to:
> nix run github:haglobah/templater -Lv -- --to new-project devshell just> git init && git add . && git commit --message "Initial commit"> echo "use flake . -Lv" >> .envrc && direnv allow> # edit flake.nix> gh repo create new-project --private --source=. --remote=origin && git push --set-upstream origin mainCode for the abbreviations here: fish.nix
A word of warning:
Do not use the templater script! It’s a the equivalent of a sharp knife without a handle while not being properly maintained.
It’s only for inspiration, nothing else.