Skip to content

joelmccracken/funstation

Repository files navigation

Funstation: a workstation configuration tool

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.

Project Status

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.

Config file example

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

Usage

Initial system setup

downloading

  • download the appropriate executable from releases for your system.
  • create your `config.yaml`, or download your preexisting file.

running

on your system, run the bootstrap:

fun --config config.yaml --workstation $YOUR_SYSTEM_NAME bootstrap

build, test, run

from within a nix develop session

run with

cabal build && cabal run -- fun --config ./config.yaml --workstation glamdring bootstrap

run main test suite with

cabal test

to run the “scratch” suite:

cabal test -f scratch funstation-scratch

outside of a nix develop session

build 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.sh

can build possibly with other cabal tooling, not how I normally do it:

cabal build funstation-test --allow-newer

About

workstation bootstrapping and configuration tool

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors