Maintenance#
Building#
System Configurations#
All of the hosts are available as packages using the .#system-
nom build .#system-octopi
Deploying#
Using deploy-rs
- add the host as normal
- add the host and profiles to the top level
deploy.nodesset - run
deployordeploy .#<host> -s --remote-build
Manual Deployment#
If you are on the remote host, all you need to do is run:
git clone http://voile:8418/tsunaminoai/nix-flake-final.git
cd nix-flake-final
nix develop
rebuild-system
If on the deployment server:
nh os build -H <host> .# -o result
nix copy --to ssh://<user>@<host> ./result
ssh <user>@<host> 'sudo /nix/store/<hash>/bin/switch-to-configuration switch'
See also NixOS for more information on building and deploying NixOS configurations.
Nix storage#
Currently, this is a local binary store that is service from Ereshkigal and is used for all builds and deployments. It is a Nix binary cache that is available to all hosts.
It may be worth converting this to an S3 bucket on voile1.
Development Shell#
Currently, the development shell is set up to use the nix develop command. This can be used to enter a development environment with all of the necessary dependencies and tools installed. If direnv is installed, it will automatically load the environment when you enter the directory.
Run menu to see the available commands in the development shell.
Useful Commands provided by the Shell#
rebuild-system- rebuild and switch the system configuration on any localhost regardless of system typehome-switch- switch the home-manager configuration for the current userbuild-docs- build this documentation sitedocs-serve- build and serve this documentation site locallystore-fix- fix the Nix store permissions and ownershipclean-nix- clean the Nix store and remove old generationsclean-home- clean the home-manager store and remove old generationsupdate-flake- update the flake inputs and lock fileformat- format the Nix code usingalejandravulscan- Runs a vunerability scan using vulnxscansbom <system>- Generats a Software Bill of Materials for a system configuration using sbomnix (use--buildtimefor build time dependencies that dont require a build of the system closure)
Other Useful Commands available in the Shell#
nh os switch .#- switch the system configuration for the current hostnh os build -H <host> .#- build the system configuration for the specified hostnh home switch .#- switch the home-manager configuration for the current usernh home build -c user@host .#- build the home-manager configuration for the specified user and hostnix run github:tiiuae/sbomnix#sbomnix ./result -- --buildtime- generate a Software Bill of Materials for the system closure in theresultdirectory, including build time dependenciesnix run github:tiiuae/sbomnix#nixgraph -- --depth=3 ./result- generate a graph of the closure dependencies using nixgraphnix run github:tiiuae/sbomnix#nix_outdated -- ./result- check for outdated packages in the system closure using nix_outdatednix run github:tiiuae/sbomnix#provenance (nixpkgs#hello or ./result) --recursive -out ./provenance.json- generate a provenance file for a package using sbomnix