Wie Sie sehen, sehen sie nix! https://docs.hacc.space
Find a file
stuebinm b47b79dd02 flake.lock: Update
Flake lock file updates:

• Updated input 'nixos-mailserver':
    'gitlab:simple-nixos-mailserver/nixos-mailserver/c43d8c4a3ce84a7bebd110b06e69365484db6208' (2024-12-16)
  → 'gitlab:simple-nixos-mailserver/nixos-mailserver/63209b1def2c9fc891ad271f474a3464a5833294' (2024-12-22)
• Removed input 'nixos-mailserver/nixpkgs-24_05'
• Added input 'nixos-mailserver/nixpkgs-24_11':
    'github:NixOS/nixpkgs/314e12ba369ccdb9b352a4db26ff419f7c49fa84' (2024-12-13)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/eb919d9300b6a18f8583f58aef16db458fbd7bec' (2024-12-15)
  → 'github:NixOS/nixpkgs/d28f9301c35e66751872254b8029f31fa9e0da20' (2024-12-23)
• Updated input 'nixpkgs-unstable':
    'github:NixOS/nixpkgs/66cdf593c0041cf1efc9b2889d80c9a5c497b284' (2024-12-16)
  → 'github:NixOS/nixpkgs/fc9c33366b98237cc759cdd90ef6058f5a1cb9dd' (2024-12-23)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/2d73fc6ac4eba4b9a83d3cb8275096fbb7ab4004' (2024-12-12)
  → 'github:Mic92/sops-nix/ed091321f4dd88afc28b5b4456e0a15bd8374b4d' (2024-12-18)
2024-12-23 16:45:33 +01:00
common pkgs/scripts: uffd-unused-accounts-notification.scm 2024-10-25 18:49:04 +02:00
docs meta: new structure 2024-01-11 23:49:26 +01:00
modules NixOS 24.11 2024-12-04 00:34:55 +01:00
parsons tracktrain: add a delay so postgres has time to start 2024-12-09 19:05:21 +01:00
pkgs pkgs/forgejo: remove unstable override 2024-12-05 22:53:29 +01:00
websites NixOS 24.11 2024-12-04 00:34:55 +01:00
.gitignore add deploy-rs gc roots to .gitignore 2022-11-19 15:18:32 +01:00
.rgignore add a .rgignore 2024-01-11 21:30:22 +01:00
.sops.yaml rotate octycs's ssh key 2023-05-04 00:40:44 +02:00
flake.lock flake.lock: Update 2024-12-23 16:45:33 +01:00
flake.nix flake: remove old nextcloud permittedInsecurePackages 2024-12-05 22:54:12 +01:00
LICENSE add a LICENSE-file 2022-10-06 19:31:59 +02:00
README.md meta: new structure 2024-01-11 23:49:26 +01:00
secrets.yaml Revert "s4f-conference: another mattermost" 2024-07-26 15:06:04 +02:00

hacc nixfiles

Welcome to the hacc nixfiles (haccfiles). This is how we configure (most of) our infrastructure.

General layout

  • flake.nix: Entrypoint & dependencies
  • modules/: home-grown modules for hacc-specific services
  • pkgs/: packages we need which aren't in nixpkgs
  • websites/: static websites hosted by us
  • common/: meta-level config, reusable across machines
  • parsons/: our sole server, its config & the services it runs

Right now, we only have a single host. We might add more again in the future.

Working with this repo

You will need a flake-enabled nix installation, and have your ssh config set up so that ssh parsons will connect to parsons.hacc.space.

Deploying remotely

It's recommended to use deploy_rs:

deploy .#parsons -k [--dry-activate]

Alternatively, using just nixos-rebuild:

nixos-rebuild --flake .#parsons --target-host parsons \
  --use-remote-sudo --use-substitutes [test|switch|dry-activate]

Re-deploying on parsons itself

Simply do:

nixos-rebuild --flake .#parsons [test|switch|dry-activate]

Working on websites

Websites are exposed as flake outputs: if you're working on a website & want to check it in a browser, do e.g.

nix run .#\"muc.hacc.earth\"

to start a local http server (note that some of our websites need a directory to be built in; these use /tmp/hacc-website).

To add a new website, add a new subdirectory to websites; nix will generate a vhost config based on that directory's name. Add a default.nix in your directory describing how to build the website, and give its derivation a watch attribute to make the nix run setup work.

I don't want to build this long dependency / want a cached version!

If it's still available on parsons from a previous deploy, do:

nix copy --from ssh://parsons /nix/store/...

Note: don't just copy the .drv file (which Nix complains about if it can't build something), that's just the description of how to build it! If you don't know the actual outpath, look in the .drv file (should start with Derive([("out","[the path you want]"...)

committing to haccfiles

  • Things on main should always reflect the config that's actually deployed on parsons, except during testing / debugging sessions
  • split up commits, every commit is one atomic change
  • follow the commit format: "place: $change"
    • place: e.g. modules/$module, services/$service ...
    • change: describe your change. Please wrap your lines sensibly (or configure your editor to do this for you)
  • Exception: autogenerated messages (merge commits, reverts, etc)
  • don't overuse merge commits, try to rebase things if possible with reasonable effort