Software. Dotfiles. System configuration files. Secrets like private keys.
All of these are required when setting up a computer.
What’s the problem with doing it manually every time?
- It is easy to forget an essential piece of setup.
- Its hard to remember how exactly you set up some tool years ago.
- Personal scripts always seem to break when you need them most, often because of setup issues/changes.
Having a declarative, automated setup gives you confidence to automate more of your work. It gives you a firm foundation to build upon.
Currently, this tool is heavily work-in-progress, but the eventual goal is:
- a static(ish) executable precompiled for relevant
systems, that is downloadable to a new workstation for initial setup
- Linux executables will be fully static.
- MacOS will have everything static besides the required system libraries.
- Tool is written in haskell, though that should not matter to a potential user.
- has various “properties”, expects a yaml file that declares the expected workstation configuration.
Here is an example of a simple config file. It shows roughly how I have my system set up currently
workstations:
- workstationName: "aeglos"
properties:
- type: GitHomeDir
params:
gitDir: .git-dir
remoteUrl: "git@github.com:joelmccracken/dotfiles.git"
branch: master
- type: NixDaemon
params:
interactive: False
nixConf: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
substituters = https://cache.nixos.org https://cache.iog.io
experimental-features = nix-command flakes
trusted-users = root joelmccracken runner
build-users-group = nixbld
- type: HomeManager
params:
dir: "~/.config/funstation/nix"
- type: HomebrewBundle
params:
brewfile: "~/.config/funstation/Brewfile"
- type: BitwardenSecrets
params:
syncIntervalDays: 7- download the appropriate executable from releases for your system.
- create your `config.yaml`, or download your preexisting file.
on your system, run the bootstrap:
fun --config config.yaml --workstation $YOUR_SYSTEM_NAME bootstraprun with
cabal build && cabal run -- fun --config ./config.yaml --workstation glamdring bootstraprun main test suite with
cabal testto run the “scratch” suite:
cabal test -f scratch funstation-scratchbuild the nix package (e.g. build the version thats statically linked)
nix build # output will be at `result/bin/fun`
test the build in a VM (assumes setup handled, TODO transfer setup process from notes.org)
bash test/vm/run-in-vm.shcan build possibly with other cabal tooling, not how I normally do it:
cabal build funstation-test --allow-newer