mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2026-02-20 17:07:51 +01:00
Compare commits
4 Commits
5794b27b58
...
46d7220479
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46d7220479 | ||
|
|
cd6f35a42d | ||
|
|
643dcb091f | ||
|
|
06d6a08938 |
28
README.md
28
README.md
@@ -4,7 +4,33 @@ This repository contains the NixOS configurations for Programvareverkstedet's se
|
|||||||
In addition to machine configurations, it also contains a bunch of shared modules, packages, and
|
In addition to machine configurations, it also contains a bunch of shared modules, packages, and
|
||||||
more.
|
more.
|
||||||
|
|
||||||
## Machines
|
> [!WARNING]
|
||||||
|
> Please read [Development - working on the PVV machines](./docs/development.md) before making
|
||||||
|
> any changes, and [Secret management and `sops-nix`](./docs/secret-management.md) before adding
|
||||||
|
> any credentials such as passwords, API tokens, etc. to the configuration.
|
||||||
|
|
||||||
|
## Deploying to machines
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
> Be careful to think about state when testing changes against the machines. Sometimes, a certain change
|
||||||
|
> can lead to irreversible changes to the data stored on the machine. An example would be a set of database
|
||||||
|
> migrations applied when testing a newer version of a service. Unless that service also comes with downwards
|
||||||
|
> migrations, you can not go back to the previous version without losing data.
|
||||||
|
|
||||||
|
To deploy the changes to a machine, you should first SSH into the machine, and clone the pvv-nixos-config
|
||||||
|
repository unless you have already done so. After that, checkout the branch you want to deploy from, and rebuild:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Run this while in the pvv-nixos-config directory
|
||||||
|
sudo nixos-rebuild switch --update-input nixpkgs --update-input nixpkgs-unstable --no-write-lock-file --refresh --flake .# --upgrade
|
||||||
|
```
|
||||||
|
|
||||||
|
This will rebuild the NixOS system on the current branch and switch the system configuration to reflect the new changes.
|
||||||
|
|
||||||
|
Note that unless you eventually merge the current changes into `main`, the machine will rebuild itself automatically and
|
||||||
|
revert the changes on the next nightly rebuild (tends to happen when everybody is asleep).
|
||||||
|
|
||||||
|
## Machine overview
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
|----------------------------|----------|-----------------------------------------------------------|
|
|----------------------------|----------|-----------------------------------------------------------|
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ in
|
|||||||
enable = true;
|
enable = true;
|
||||||
flake = "git+https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git";
|
flake = "git+https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git";
|
||||||
flags = [
|
flags = [
|
||||||
|
"-L"
|
||||||
|
|
||||||
"--refresh"
|
"--refresh"
|
||||||
"--no-write-lock-file"
|
"--no-write-lock-file"
|
||||||
# --update-input is deprecated since nix 2.22, and removed in lix 2.90
|
# --update-input is deprecated since nix 2.22, and removed in lix 2.90
|
||||||
|
|||||||
@@ -156,27 +156,6 @@ nix build .#
|
|||||||
> built some of the machines recently. Be prepared to wait for up to an hour to build all machines from scratch
|
> built some of the machines recently. Be prepared to wait for up to an hour to build all machines from scratch
|
||||||
> if this is the first time.
|
> if this is the first time.
|
||||||
|
|
||||||
### Deploying to machines
|
|
||||||
|
|
||||||
> [!WARNING]
|
|
||||||
> Be careful to think about state when testing changes against the machines. Sometimes, a certain change
|
|
||||||
> can lead to irreversible changes to the data stored on the machine. An example would be a set of database
|
|
||||||
> migrations applied when testing a newer version of a service. Unless that service also comes with downwards
|
|
||||||
> migrations, you can not go back to the previous version without losing data.
|
|
||||||
|
|
||||||
To deploy the changes to a machine, you should first SSH into the machine, and clone the pvv-nixos-config
|
|
||||||
repository unless you have already done so. After that, checkout the branch you want to deploy from, and rebuild:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Run this while in the pvv-nixos-config directory
|
|
||||||
sudo nixos-rebuild switch --update-input nixpkgs --update-input nixpkgs-unstable --no-write-lock-file --refresh --flake .# --upgrade
|
|
||||||
```
|
|
||||||
|
|
||||||
This will rebuild the NixOS system on the current branch and switch the system configuration to reflect the new changes.
|
|
||||||
|
|
||||||
Note that unless you eventually merge the current changes into `main`, the machine will rebuild itself automatically and
|
|
||||||
revert the changes on the next nightly rebuild (tends to happen when everybody is asleep).
|
|
||||||
|
|
||||||
### Forcefully reset to `main`
|
### Forcefully reset to `main`
|
||||||
|
|
||||||
If you ever want to reset a machine to the `main` branch, you can do so by running:
|
If you ever want to reset a machine to the `main` branch, you can do so by running:
|
||||||
|
|||||||
8
flake.lock
generated
8
flake.lock
generated
@@ -387,11 +387,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1767906725,
|
"lastModified": 1768301954,
|
||||||
"narHash": "sha256-AZpNzcnbl855mqemSrWbYl2mEgngC2lmiI6yiszEgQw=",
|
"narHash": "sha256-qRmrsx0k6Hc0BLM0I/f3YnTg19Sofjk2l1Kp/0Xfhc8=",
|
||||||
"ref": "main",
|
"ref": "main",
|
||||||
"rev": "65118b6abebd339e071c38f00a23b92dbbb72b38",
|
"rev": "c997ad4b47993dfd2368c3bbd07a0f71d55e3f5a",
|
||||||
"revCount": 537,
|
"revCount": 569,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.pvv.ntnu.no/Projects/nettsiden.git"
|
"url": "https://git.pvv.ntnu.no/Projects/nettsiden.git"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -35,6 +35,12 @@
|
|||||||
"color": "#ed1111",
|
"color": "#ed1111",
|
||||||
"description": "Report an oopsie"
|
"description": "Report an oopsie"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "developer experience",
|
||||||
|
"exclusive": false,
|
||||||
|
"color": "#eb6420",
|
||||||
|
"description": "Think about the developers"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "disputed",
|
"name": "disputed",
|
||||||
"exclusive": false,
|
"exclusive": false,
|
||||||
|
|||||||
Reference in New Issue
Block a user