Primary Disciplina deployment specification.
To set up this repo, enter nix-shell
and run:
git crypt unlock
cat .gitconfig >> .git/config
nix-darwin profile for macOS builder. Runs Buildkite to build macOS apps on CI for QA team.
Darwin builder is the hardest of all three to provision because there's no NixOps support and nix-darwin provides relatively little control when compared to NixOS.
-
Sign up for MacStadium and rent a server.
-
Copy
keys/production/buildkite-token
to the newly provisioned server:
scp keys/production/buildkite-token administrator@1.2.3.4:~
- SSH to the server (default password is in the MacStadium ticket):
ssh administrator@1.2.3.4
-
Activate passwordless
sudo
: https://apple.stackexchange.com/a/333055 -
Install Nix:
curl https://nixos.org/nix/install | sh
- Install nix-darwin:
nix-build https://github.com/LnL7/nix-darwin/archive/master.tar.gz -A installer
result/bin/darwin-installer
- Set up our Nix channels:
nix-channel --add https://github.com/serokell/nixpkgs/archive/master.tar.gz nixpkgs
nix-channel --add https://github.com/serokell/nix-darwin/archive/master.tar.gz darwin
nix-channel --add https://github.com/DisciplinaOU/disciplina-nixops/archive/master.tar.gz disciplina-nixops
nix-channel --update
- Update
~/.nixpkgs/darwin-configuration.nix
to the effect of:
{
imports = [
<disciplina-nixops/deployments/darwin-builder.nix>
];
# sysctl -n hw.ncpu
nix.buildCores = 4;
nix.maxJobs = 4;
system.stateVersion = 3;
}
- Rebuild:
darwin-rebuild switch
- Update
state/darwin-builder.ssh
(in this repo) with the new IP.
Singleton entity that is used to provision clusters in one-to-many relationship. Runs Buildkite to CD clusters on each GitHub push, and to build Flatpak bundles, LaTeX documents and HTML documentation as part of CI pipeline.
nix-shell --argstr env production --run 'nixops deploy -d deployer -s state/deployer.nixops'
Actual Disciplina cluster. WIP.
If you want to create a personal staging cluster, enter nix-shell
and run:
nixops create deployments/cluster.nix -d disciplina
nixops set-args --argstr domain yourname.disciplina.site -d disciplina
nixops deploy -d disciplina
Subsequent deploys should only run the last command. When you are done with your cluster and want to free up resources, run:
nixops destroy -d disciplina
If you want to deploy production cluster, run:
nix-shell --argstr env production --run 'nixops deploy -d cluster -s state/cluster.nixops'