mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2026-01-07 07:58:25 +01:00
Compare commits
15 Commits
b90a983de0
...
ad61336a20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad61336a20 | ||
|
|
197433a4c3 | ||
|
|
58be01e620 | ||
|
|
0f72ea9241 | ||
|
|
67445dd9d4 | ||
|
|
101d40f62f | ||
|
|
16891ff521 | ||
|
|
1430af8dfd | ||
|
|
9491a5d200 | ||
|
|
33b7af4e62 | ||
|
|
ba36db33b8 | ||
|
|
5158b39ec8 | ||
|
|
48aa9c0e7e | ||
|
|
34c5e58580 | ||
|
|
8b10cac63a |
61
README.MD
61
README.MD
@@ -1,61 +0,0 @@
|
|||||||
# PVV NixOS configs
|
|
||||||
|
|
||||||
## Hvordan endre på ting
|
|
||||||
|
|
||||||
Før du endrer på ting husk å ikke putte ting som skal være hemmelig uten å først lese seksjonen for hemmeligheter!
|
|
||||||
|
|
||||||
Etter å ha klonet prosjektet ned og gjort endringer kan du evaluere configene med:
|
|
||||||
|
|
||||||
`nix flake check --keep-going`
|
|
||||||
|
|
||||||
før du bygger en maskin med:
|
|
||||||
|
|
||||||
`nix build .#<maskinnavn>`
|
|
||||||
|
|
||||||
hvis du vil være ekstra sikker på at alt bygger så kan du kjøre:
|
|
||||||
|
|
||||||
`nix build .` for å bygge alle de viktige maskinene.
|
|
||||||
|
|
||||||
NB: Dette kan ta opp til 30 minutter avhengig av hva som ligger i caches
|
|
||||||
|
|
||||||
Husk å hvertfall stage nye filer om du har laget dem!
|
|
||||||
|
|
||||||
Om alt bygger fint commit det og push til git repoet.
|
|
||||||
Det er sikkert lurt å lage en PR først om du ikke er vandt til nix enda.
|
|
||||||
|
|
||||||
Innen 24h skal alle systemene hente ned den nye konfigurasjonen og deploye den.
|
|
||||||
|
|
||||||
Du kan tvinge en maskin til å oppdatere seg før dette ved å kjøre:
|
|
||||||
`nixos-rebuild switch --update-input nixpkgs --update-input nixpkgs-unstable --no-write-lock-file --refresh --upgrade --flake git+https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git`
|
|
||||||
|
|
||||||
som root på maskinen.
|
|
||||||
|
|
||||||
Hvis du ikke har lyst til å oppdatere alle pakkene (og kanskje måtte vente en stund!) kan du kjøre
|
|
||||||
|
|
||||||
`nixos-rebuild switch --override-input nixpkgs nixpkgs --override-input nixpkgs-unstable nixpkgs-unstable --flake git+https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git`
|
|
||||||
|
|
||||||
## Seksjonen for hemmeligheter
|
|
||||||
|
|
||||||
For at hemmeligheter ikke skal deles med hele verden i git - eller å være world
|
|
||||||
readable i nix-storen, bruker vi [sops-nix](https://github.com/Mic92/sops-nix)
|
|
||||||
|
|
||||||
For å legge til secrets kan du kjøre f.eks. `sops secrets/jokum/jokum.yaml`
|
|
||||||
Dette vil dekryptere filen og gi deg en text-editor du kan bruke for endre hemmelighetene.
|
|
||||||
|
|
||||||
Et nix shell med dette verktøyet inkludert ligger i flaket og shell.nix og kan aktiveres med:
|
|
||||||
|
|
||||||
`nix-shell` eller `nix develop`. Vi anbefaler det siste.
|
|
||||||
I tilegg kan du sette opp [direnv](https://direnv.net/) slik at dette skjer automatisk
|
|
||||||
|
|
||||||
for å få tilgang til å lese/skrive hemmeligheter må du spørre noen/noe som har tilgang til hemmelighetene
|
|
||||||
om å legge til age eller pgp nøkkelen din i [`.sops.yaml`](https://git.pvv.ntnu.no/Drift/pvv-nixos-config/src/main/.sops.yaml)
|
|
||||||
|
|
||||||
Denne kan du generere fra ssh-nøkkelene dine eller lage en egen nøkkel.
|
|
||||||
|
|
||||||
### Legge til flere keys
|
|
||||||
|
|
||||||
Gjør det som gir mening i .sops.yml
|
|
||||||
|
|
||||||
Etter det kjør `sops updatekeys secrets/host/file.yml`
|
|
||||||
|
|
||||||
MERK at det ikke er `sops -r` som BARE roterer nøkklene for de som allerede er i secretfila
|
|
||||||
36
README.md
Normal file
36
README.md
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
# PVV NixOS config
|
||||||
|
|
||||||
|
This repository contains the NixOS configurations for Programvareverkstedet's server closet.
|
||||||
|
In addition to machine configurations, it also contains a bunch of shared modules, packages, and
|
||||||
|
more.
|
||||||
|
|
||||||
|
## Machines
|
||||||
|
|
||||||
|
| Name | Type | Description |
|
||||||
|
|----------------------------|----------|-----------------------------------------------------------|
|
||||||
|
| [bekkalokk][bek] | Physical | Our main web host, webmail, wiki, idp, minecraft map, ... |
|
||||||
|
| [bicep][bic] | Virtual | Database host, matrix, git mirrors, ... |
|
||||||
|
| bikkje | Virtual | Experimental login box |
|
||||||
|
| [brzeczyszczykiewicz][brz] | Physical | Shared music player |
|
||||||
|
| [georg][geo] | Physical | Shared music player |
|
||||||
|
| [ildkule][ild] | Virtual | Logging and monitoring host, prometheus, grafana, ... |
|
||||||
|
| [kommode][kom] | Virtual | Gitea + Gitea pages |
|
||||||
|
| [lupine][lup] | Physical | Gitea CI/CD runners |
|
||||||
|
| shark | Virtual | Test host for authentication, absolutely horrendous |
|
||||||
|
| [wenche][wen] | Virtual | Nix-builders, general purpose compute |
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
- [Development - working on the PVV machines](./docs/development.md)
|
||||||
|
- [Miscellaneous development notes](./docs/development-misc.md)
|
||||||
|
- [User management](./docs/users.md)
|
||||||
|
- [Secret management and `sops-nix`](./docs/secret-management.md)
|
||||||
|
|
||||||
|
[bek]: https://wiki.pvv.ntnu.no/wiki/Maskiner/bekkalokk
|
||||||
|
[bic]: https://wiki.pvv.ntnu.no/wiki/Maskiner/bicep
|
||||||
|
[brz]: https://wiki.pvv.ntnu.no/wiki/Maskiner/brzęczyszczykiewicz
|
||||||
|
[geo]: https://wiki.pvv.ntnu.no/wiki/Maskiner/georg
|
||||||
|
[ild]: https://wiki.pvv.ntnu.no/wiki/Maskiner/ildkule
|
||||||
|
[kom]: https://wiki.pvv.ntnu.no/wiki/Maskiner/kommode
|
||||||
|
[lup]: https://wiki.pvv.ntnu.no/wiki/Maskiner/lupine
|
||||||
|
[wen]: https://wiki.pvv.ntnu.no/wiki/Maskiner/wenche
|
||||||
@@ -25,6 +25,9 @@
|
|||||||
./services/nginx.nix
|
./services/nginx.nix
|
||||||
./services/openssh.nix
|
./services/openssh.nix
|
||||||
./services/postfix.nix
|
./services/postfix.nix
|
||||||
|
./services/prometheus-node-exporter.nix
|
||||||
|
./services/prometheus-systemd-exporter.nix
|
||||||
|
./services/promtail.nix
|
||||||
./services/smartd.nix
|
./services/smartd.nix
|
||||||
./services/thermald.nix
|
./services/thermald.nix
|
||||||
./services/userborn.nix
|
./services/userborn.nix
|
||||||
|
|||||||
23
base/services/prometheus-node-exporter.nix
Normal file
23
base/services/prometheus-node-exporter.nix
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{ config, lib, values, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.services.prometheus.exporters.node;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
services.prometheus.exporters.node = {
|
||||||
|
enable = lib.mkDefault true;
|
||||||
|
port = 9100;
|
||||||
|
enabledCollectors = [ "systemd" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.prometheus-node-exporter.serviceConfig = lib.mkIf cfg.enable {
|
||||||
|
IPAddressDeny = "any";
|
||||||
|
IPAddressAllow = [
|
||||||
|
"127.0.0.1"
|
||||||
|
"::1"
|
||||||
|
values.hosts.ildkule.ipv4
|
||||||
|
values.hosts.ildkule.ipv6
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.firewall.allowedTCPPorts = lib.mkIf cfg.enable [ cfg.port ];
|
||||||
|
}
|
||||||
26
base/services/prometheus-systemd-exporter.nix
Normal file
26
base/services/prometheus-systemd-exporter.nix
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{ config, lib, values, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.services.prometheus.exporters.systemd;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
services.prometheus.exporters.systemd = {
|
||||||
|
enable = lib.mkDefault true;
|
||||||
|
port = 9101;
|
||||||
|
extraFlags = [
|
||||||
|
"--systemd.collector.enable-restart-count"
|
||||||
|
"--systemd.collector.enable-ip-accounting"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.prometheus-systemd-exporter.serviceConfig = {
|
||||||
|
IPAddressDeny = "any";
|
||||||
|
IPAddressAllow = [
|
||||||
|
"127.0.0.1"
|
||||||
|
"::1"
|
||||||
|
values.hosts.ildkule.ipv4
|
||||||
|
values.hosts.ildkule.ipv6
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.firewall.allowedTCPPorts = lib.mkIf cfg.enable [ cfg.port ];
|
||||||
|
}
|
||||||
38
base/services/promtail.nix
Normal file
38
base/services/promtail.nix
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
{ config, lib, values, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.services.prometheus.exporters.node;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
services.promtail = {
|
||||||
|
enable = lib.mkDefault true;
|
||||||
|
configuration = {
|
||||||
|
server = {
|
||||||
|
http_listen_port = 28183;
|
||||||
|
grpc_listen_port = 0;
|
||||||
|
};
|
||||||
|
clients = [{
|
||||||
|
url = "http://ildkule.pvv.ntnu.no:3100/loki/api/v1/push";
|
||||||
|
}];
|
||||||
|
scrape_configs = [{
|
||||||
|
job_name = "systemd-journal";
|
||||||
|
journal = {
|
||||||
|
max_age = "12h";
|
||||||
|
labels = {
|
||||||
|
job = "systemd-journal";
|
||||||
|
host = config.networking.hostName;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
relabel_configs = [
|
||||||
|
{
|
||||||
|
source_labels = [ "__journal__systemd_unit" ];
|
||||||
|
target_label = "unit";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
source_labels = [ "__journal_priority_keyword" ];
|
||||||
|
target_label = "level";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
103
docs/development-misc.md
Normal file
103
docs/development-misc.md
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
# Miscellaneous development notes
|
||||||
|
|
||||||
|
This document contains a bunch of information that is not particularly specific to the pvv nixos config,
|
||||||
|
but concerns technologies we use often or gotchas to be aware of when working with NixOS. A lot of the information
|
||||||
|
here is already public information spread around the internet, but we've collected some of the items we use often
|
||||||
|
here.
|
||||||
|
|
||||||
|
## The firewall
|
||||||
|
|
||||||
|
`networking.firewall` is a NixOS module that configures `iptables` rules on the machine. It is enabled by default on
|
||||||
|
all of our machines, and it can be easy to forget about it when setting up new services, especially when we are the
|
||||||
|
ones creating the NixOS module.
|
||||||
|
|
||||||
|
When setting up a new service that listens on a TCP or UDP port, make sure to add the appropriate ports to either
|
||||||
|
`networking.firewall.allowedTCPPorts` or `networking.firewall.allowedUDPPorts`.
|
||||||
|
|
||||||
|
You can list out the current firewall rules by running `sudo iptables -L -n -v` on the machine.
|
||||||
|
|
||||||
|
## Finding stuff
|
||||||
|
|
||||||
|
Finding stuff, both underlying implementation and usage is absolutely crucial when working on nix.
|
||||||
|
Oftentimes, the documentation will be outdated, lacking or just plain out wrong. These are some of
|
||||||
|
the techniques we have found to be quite good when working with nix.
|
||||||
|
|
||||||
|
### [ripgrep](https://github.com/BurntSushi/ripgrep)
|
||||||
|
|
||||||
|
ripgrep (or `rg` for short) is a tool that lets you recursively grep for regex patters in a directory.
|
||||||
|
|
||||||
|
It is great for finding references to configuration, and where and how certain things are used. It is
|
||||||
|
especially great when working with [nixpkgs](https://github.com/NixOS/nixpkgs), which is quite large.
|
||||||
|
|
||||||
|
### GitHub Search
|
||||||
|
|
||||||
|
When trying to set up a new service or reconfigure something, it is very common that someone has done it
|
||||||
|
before you, but it has never been documented anywhere. A lot of Nix code exists on GitHub, and you can
|
||||||
|
easily query it by using the `lang:nix` filter in the search bar.
|
||||||
|
|
||||||
|
For example: https://github.com/search?q=lang%3Anix+dibbler&type=code
|
||||||
|
|
||||||
|
## rsync
|
||||||
|
|
||||||
|
`rsync` is a tool for synchronizing files between machines. It is very useful when transferring large
|
||||||
|
amounts of data from a to b. We use it for multiple things, often when data is produced or stored on
|
||||||
|
one machine, and we want to process or convert it on another. For example, we use it to transfer gitea
|
||||||
|
artifacts, to transfer gallery pictures, to transfer minecraft world data for map rendering, and more.
|
||||||
|
|
||||||
|
Along with `rsync`, we often use a lesser known tool called `rrsync`, which you can use inside an ssh
|
||||||
|
configuration (`authorized_keys` file) to restrict what paths a user can access when connecting over ssh.
|
||||||
|
This is useful both as a security measure, but also to avoid accidental overwrites of files outside the intended
|
||||||
|
path. `rrsync` will use chroot to restrict what paths the user can access, as well as refuse to run arbitrary commands.
|
||||||
|
|
||||||
|
## `nix repl`
|
||||||
|
|
||||||
|
`nix repl` is an interactive REPL for the Nix language. It is very useful for experimenting with Nix code,
|
||||||
|
and testing out small snippets of code to make sure it behaves as expected. You can also use it to explore
|
||||||
|
NixOS machine configurations, to interactively see that the configuration evaluates to what you expect.
|
||||||
|
|
||||||
|
```
|
||||||
|
# While in the pvv-nixos-config directory
|
||||||
|
nix repl .
|
||||||
|
|
||||||
|
# Upon writing out the config path and clickin [Tab], you will get autocompletion suggestions:
|
||||||
|
nix-repl> nixosConfigurations.bekkalokk.config.services.nginx.virtualHosts.
|
||||||
|
nixosConfigurations.bekkalokk.config.services.nginx.virtualHosts._
|
||||||
|
nixosConfigurations.bekkalokk.config.services.nginx.virtualHosts.bekkalokk.pvv.ntnu.no-nixos-metrics
|
||||||
|
nixosConfigurations.bekkalokk.config.services.nginx.virtualHosts.idp.pvv.ntnu.no
|
||||||
|
nixosConfigurations.bekkalokk.config.services.nginx.virtualHosts.minecraft.pvv.ntnu.no
|
||||||
|
nixosConfigurations.bekkalokk.config.services.nginx.virtualHosts.pvv.ntnu.no
|
||||||
|
nixosConfigurations.bekkalokk.config.services.nginx.virtualHosts.pvv.org
|
||||||
|
nixosConfigurations.bekkalokk.config.services.nginx.virtualHosts.pw.pvv.ntnu.no
|
||||||
|
nixosConfigurations.bekkalokk.config.services.nginx.virtualHosts.roundcubeplaceholder.example.com
|
||||||
|
nixosConfigurations.bekkalokk.config.services.nginx.virtualHosts.snappymail.pvv.ntnu.no
|
||||||
|
nixosConfigurations.bekkalokk.config.services.nginx.virtualHosts.webmail.pvv.ntnu.no
|
||||||
|
nixosConfigurations.bekkalokk.config.services.nginx.virtualHosts.wiki.pvv.ntnu.no
|
||||||
|
nixosConfigurations.bekkalokk.config.services.nginx.virtualHosts.www.pvv.ntnu.no
|
||||||
|
nixosConfigurations.bekkalokk.config.services.nginx.virtualHosts.www.pvv.org
|
||||||
|
```
|
||||||
|
|
||||||
|
## `nix why-depends`
|
||||||
|
|
||||||
|
If you ever wonder why a certain package is being used as a dependency of another package,
|
||||||
|
or another machine, you can use `nix why-depends` to find the dependency path from one package to another.
|
||||||
|
This is often useful after updating nixpkgs and finding an error saying that a certain package is insecure,
|
||||||
|
broken or whatnot. You can do something like the following
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Why does bekkalokk depend on openssl?
|
||||||
|
nix why-depends .#nixosConfigurations.bekkalokk.config.system.build.toplevel .#nixosConfigurations.bekkalokk.pkgs.openssl
|
||||||
|
|
||||||
|
# Why does bekkalokk's minecraft-server depend on zlib? (this is not real)
|
||||||
|
nix why-depends .#nixosConfigurations.bekkalokk.pkgs.minecraft-server .#nixosConfigurations.bekkalokk.pkgs.zlib
|
||||||
|
```
|
||||||
|
|
||||||
|
## php-fpm
|
||||||
|
|
||||||
|
php-fpm (FastCGI Process Manager) is a PHP implementation that is designed for speed and production use. We host a bunch
|
||||||
|
of different PHP applications (including our own website), and so we use php-fpm quite a bit. php-fpm typically exposes a
|
||||||
|
unix socket that nginx will connect to, and php-fpm will then render php upon web requests forwarded from nginx and return
|
||||||
|
it.
|
||||||
|
|
||||||
|
php-fpm has a tendency to be a bit hard to debug. It is not always very willing to spit out error messages and logs, and so
|
||||||
|
it can be a bit hard to figure out what's up when something goes wrong. You should see some of the commented stuff laying around
|
||||||
|
in the website code on bekkalokk for examples of how to configure php-fpm for better logging and error reporting.
|
||||||
190
docs/development.md
Normal file
190
docs/development.md
Normal file
@@ -0,0 +1,190 @@
|
|||||||
|
# Development - working on the PVV machines
|
||||||
|
|
||||||
|
This document outlines the process of editing our NixOS configurations, and testing and deploying said changes
|
||||||
|
to the machines. Most of the information written here is specific to the PVV NixOS configuration, and the topics
|
||||||
|
will not really cover the nix code itself in detail. You can find some more resources for that by either following
|
||||||
|
the links from the *Upstream documentation* section below, or in [Miscellaneous development notes](./development-misc.md).
|
||||||
|
|
||||||
|
## Editing nix files
|
||||||
|
|
||||||
|
> [!WARN]
|
||||||
|
> Before editing any nix files, make sure to read [Secret management and `sops-nix`](./secret-management.md)!
|
||||||
|
> We do not want to add any secrets in plaintext to the nix files, and certainly not commit and publish
|
||||||
|
> them into the common public.
|
||||||
|
|
||||||
|
The files are plaintext code, written in the [`Nix` language](https://nix.dev/manual/nix/stable/language/).
|
||||||
|
|
||||||
|
Below is a list of important files and directories, and a description of what they contain.
|
||||||
|
|
||||||
|
### `flake.nix`
|
||||||
|
|
||||||
|
The `flake.nix` file is a [nix flake](https://wiki.nixos.org/wiki/Flakes) and makes up the entrypoint of the
|
||||||
|
entire configuration. It declares what inputs are used (similar to dependencies), as well as what outputs the
|
||||||
|
flake exposes. In our case, the most important outputs are the `nixosConfigurations` (our machine configs), but
|
||||||
|
we also expose custom modules, packages, devshells, and more. You can run `nix flake show` to get an overview of
|
||||||
|
the outputs (however you will need to [enable the `nix-flakes` experimental option](https://wiki.nixos.org/wiki/Flakes#Setup)).
|
||||||
|
|
||||||
|
You will find that a lot of the flake inputs are the different PVV projects that we develop, imported to be hosted
|
||||||
|
on the NixOS machines. This makes it easy to deploy changes to these projects, as we can just update the flake input
|
||||||
|
to point to a new commit or version, and then rebuild the machines.
|
||||||
|
|
||||||
|
A NixOS configuration is usually made with the `nixpkgs.lib.nixosSystem` function, however we have a few custom wrapper
|
||||||
|
functions named `nixosConfig` and `stableNixosConfig` that abstracts away some common configuration we want on all our machines.
|
||||||
|
|
||||||
|
### `values.nix`
|
||||||
|
|
||||||
|
`values.nix` is a somewhat rare pattern in NixOS configurations around the internet. It contains a bunch of constant values
|
||||||
|
that we use throughout the configuration, such as IP addresses, DNS names, paths and more. This not only makes it easier to
|
||||||
|
change the values should we need to, but it also makes the configuration more readable. Instead of caring what exact IP any
|
||||||
|
machine has, you can write `values.machines.name.ipv4` and abstract the details away.
|
||||||
|
|
||||||
|
### `base`
|
||||||
|
|
||||||
|
The `base` directory contains a bunch of NixOS configuration that is common for all or most machines. Some of the config
|
||||||
|
you will find here sets defaults for certain services without enabling them, so that when they are enabled in a machine config,
|
||||||
|
we don't need to repeat the same defaults over again. Other parts actually enable certain services that we want on all machines,
|
||||||
|
such as `openssh` or the auto upgrade timer.
|
||||||
|
|
||||||
|
### Vendoring `modules` and `packages`
|
||||||
|
|
||||||
|
Sometimes, we either find that the packages or modules provided by `nixpkgs` is not sufficient for us,
|
||||||
|
or that they are bugged in some way that can not be easily overrided. There are also cases where the
|
||||||
|
modules or packages does not exist. In these cases, we tend to either copy and modify the modules and
|
||||||
|
packages from nixpkgs, or create our own. These modules and packages end up in the top-level `modules`
|
||||||
|
and `packages` directories. They are usually exposed in `flake.nix` as flake outputs `nixosModules.<name>`
|
||||||
|
and `packages.<platform>.<name>`, and they are usually also added to the machines that need them in the flake.
|
||||||
|
|
||||||
|
In order to override or add an extra package, the easiest way is to use an [`overlay`](https://wiki.nixos.org/wiki/Overlays).
|
||||||
|
This makes it so that the package from `pkgs.<name>` now refers to the modified variant of the package.
|
||||||
|
|
||||||
|
In order to add a module, you can just register it in the modules of the nixos machine.
|
||||||
|
In order to override a module, you also have to use `disabledModules = [ "<path-relative-to-nixpkgs/modules>" ];`.
|
||||||
|
Use `rg` to find examples of the latter.
|
||||||
|
|
||||||
|
Do note that if you believe a new module to be of high enough quality, or the change you are making to be
|
||||||
|
relevant for every nix user, you should strongly consider also creating a PR towards nixpkgs. However,
|
||||||
|
getting changes made there has a bit higher threshold and takes more time than making changes in the PVV config,
|
||||||
|
so feel free to make the changes here first. We can always remove the changes again once the upstreaming is finished.
|
||||||
|
|
||||||
|
### `users`, `secrets` and `keys`
|
||||||
|
|
||||||
|
For `users`, see [User management](./users.md)
|
||||||
|
|
||||||
|
For `secrets` and `keys`, see [Secret management and `sops-nix`](./secret-management.md)
|
||||||
|
|
||||||
|
### Collaboration
|
||||||
|
|
||||||
|
We use our gitea to collaborate on changes to the nix configuration. Every PVV maintenance member should have
|
||||||
|
access to the repository. The usual workflow is that we create a branch for the change we want to make, do a bunch
|
||||||
|
of commits and changes, and then open a merge request for review (or just rebase on master if you know what you are doing).
|
||||||
|
|
||||||
|
### Upstream documentation
|
||||||
|
|
||||||
|
Here are different sources of documentation and stuff that you might find useful while
|
||||||
|
writing, editing and debugging nix code.
|
||||||
|
|
||||||
|
- [nixpkgs repository](https://github.com/NixOS/nixpkgs)
|
||||||
|
|
||||||
|
This is particularly useful to read the source code, as well as upstreaming pieces of code that we think
|
||||||
|
everyone would want
|
||||||
|
|
||||||
|
- [NixOS search](https://search.nixos.org/)
|
||||||
|
|
||||||
|
This is useful for searching for both packages and NixOS options.
|
||||||
|
|
||||||
|
- [nixpkgs documentation](https://nixos.org/manual/nixpkgs/stable/)
|
||||||
|
- [NixOS documentation](https://nixos.org/manual/nixos/stable/)
|
||||||
|
- [nix (the tool) documentation](https://nix.dev/manual/nix/stable/)
|
||||||
|
|
||||||
|
All of the three above make up the official documentation with all technical
|
||||||
|
details about the different pieces that makes up NixOS.
|
||||||
|
|
||||||
|
- [The official NixOS wiki](https://wiki.nixos.org)
|
||||||
|
|
||||||
|
User-contributed guides, tips and tricks, and whatever else.
|
||||||
|
|
||||||
|
- [nix.dev](https://nix.dev)
|
||||||
|
|
||||||
|
Additional stuff
|
||||||
|
|
||||||
|
- [Noogle](https://noogle.dev)
|
||||||
|
|
||||||
|
This is useful when looking for nix functions and packaging helpers.
|
||||||
|
|
||||||
|
## Testing and deploying changes
|
||||||
|
|
||||||
|
After editing the nix files on a certain branch, you will want to test and deploy the changes to the machines.
|
||||||
|
Unfortunately, we don't really have a good setup for testing for runtime correctness locally, but we can at least
|
||||||
|
make sure that the code evaluates and builds correctly before deploying.
|
||||||
|
|
||||||
|
To just check that the code evaluates without errors, you can run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nix flake check
|
||||||
|
# Or if you want to keep getting all errors before it quits:
|
||||||
|
nix flake check --keep-going
|
||||||
|
```
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> If you are making changes that involves creating new nix files, remember to `git add` those files before running
|
||||||
|
> any nix commands. Nix refuses to acknowledge files that are not either commited or at least staged. It will spit
|
||||||
|
> out an error message about not finding the file in question.
|
||||||
|
|
||||||
|
### Building machine configurations
|
||||||
|
|
||||||
|
To build any specific machine configuration and look at the output, you can run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nix build .#nixosConfigurations.<machine-name>.config.system.build.toplevel
|
||||||
|
# or just
|
||||||
|
nix build .#<machine-name>
|
||||||
|
```
|
||||||
|
|
||||||
|
This will create a symlink name `./result` to a directory containing the built NixOS system. It is oftentimes
|
||||||
|
the case that config files for certain services only end up in the nix store without being put into `/etc`. If you wish
|
||||||
|
to read those files, you can often find them by looking at the systemd unit files in `./result/etc/systemd/system/`.
|
||||||
|
(if you are using vim, `gf` or go-to-file while the cursor is over a file path is a useful trick while doing this).
|
||||||
|
|
||||||
|
If you have edited something that affects multiple machines, you can also build all important machines at once by running:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nix build .#
|
||||||
|
```
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> Building all machines at once can take a long time, depending on what has changed and whether you have already
|
||||||
|
> 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.
|
||||||
|
|
||||||
|
### Deploying to machines
|
||||||
|
|
||||||
|
> [!WARN]
|
||||||
|
> 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`
|
||||||
|
|
||||||
|
If you ever want to reset a machine to the `main` branch, you can do so by running:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nixos-rebuild switch --update-input nixpkgs --update-input nixpkgs-unstable --no-write-lock-file --refresh --upgrade --flake git+https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
|
||||||
|
```
|
||||||
|
|
||||||
|
This will ignore the current branch and just pull the latest `main` from the git repository directly from gitea.
|
||||||
|
You can also use this command if there are updates on the `main` branch that you want to deploy to the machine without
|
||||||
|
waiting for the nightly rebuild.
|
||||||
160
docs/secret-management.md
Normal file
160
docs/secret-management.md
Normal file
@@ -0,0 +1,160 @@
|
|||||||
|
# Secret management and `sops-nix`
|
||||||
|
|
||||||
|
Nix config is love, nix config is life, and publishing said config to the
|
||||||
|
internet is not only a good deed and kinda cool, but also encourages properly
|
||||||
|
secured configuration as opposed to [security through obscurity](https://en.wikipedia.org/wiki/Security_through_obscurity).
|
||||||
|
That being said, there are some details of the config that we really shouldn't
|
||||||
|
share with the general public. In particular, there are so-called *secrets*, that is
|
||||||
|
API keys, passwords, tokens, cookie secrets, salts, peppers and jalapenos that we'd
|
||||||
|
rather keep to ourselves. However, it is not entirely trivial to do so in the NixOS config.
|
||||||
|
For one, we'd have to keep these secrets out of the public git repo somehow, and secondly
|
||||||
|
everything that is configured via nix ends up as world readable files (i.e. any user on the
|
||||||
|
system can read the file) in `/nix/store`.
|
||||||
|
|
||||||
|
In order to solve this, we use a NixOS module called [`sops-nix`](https://github.com/Mic92/sops-nix)
|
||||||
|
which uses a technology called [`sops`](https://github.com/getsops/sops) behind the scenes.
|
||||||
|
The idea is simple: we encrypt these secrets with a bunch of different keys and store the
|
||||||
|
encrypted files in the git repo. First of all, we encrypt the secrets a bunch of time with
|
||||||
|
PVV maintenance member's keys, so that we can decrypt and edit the contents. Secondly, we
|
||||||
|
encrypt the secrets with the [host keys]() of the NixOS machines, so that they can decrypt
|
||||||
|
the secrets. The secrets will be decrypted and stored in a well-known location (usually `/run/secrets`)
|
||||||
|
so that they do not end up in the nix store, and are not world readable.
|
||||||
|
|
||||||
|
This way, we can both keep the secrets in the git repository and let multiple people edit them,
|
||||||
|
but also ensure that they don't end up in the wrong hands.
|
||||||
|
|
||||||
|
## Adding a new machine
|
||||||
|
|
||||||
|
In order to add a new machine to the nix-sops setup, you should do the following:
|
||||||
|
|
||||||
|
```console
|
||||||
|
# Create host keys (if they don't already exist)
|
||||||
|
ssh-keygen -A -b 4096
|
||||||
|
|
||||||
|
# Derive an age-key from the public host key
|
||||||
|
nix-shell -p ssh-to-age --run 'cat /etc/ssh/ssh_host_ed25519_key.pub | ssh-to-age'
|
||||||
|
|
||||||
|
# Register the age key in .sops.yaml
|
||||||
|
vim .sops.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
The contents of `.sops.yaml` should look like this:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
keys:
|
||||||
|
# Users
|
||||||
|
...
|
||||||
|
|
||||||
|
# Hosts
|
||||||
|
...
|
||||||
|
- &host_<machine_name> <public_age_key>
|
||||||
|
|
||||||
|
creation_rules:
|
||||||
|
...
|
||||||
|
|
||||||
|
- path_regex: secrets/<machine_name>/[^/]+\.yaml$
|
||||||
|
key_groups:
|
||||||
|
- age:
|
||||||
|
- *host_<machine_name>
|
||||||
|
- ... user keys
|
||||||
|
- pgp:
|
||||||
|
- ... user keys
|
||||||
|
```
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> Take care that all the keys in the `age` and `pgp` sections are prefixed
|
||||||
|
> with a `-`, or else sops might try to encrypt the secrets in a way where
|
||||||
|
> you need both keys present to decrypt the content. Also, it tends to throw
|
||||||
|
> interesting errors when it fails to do so.
|
||||||
|
|
||||||
|
```console
|
||||||
|
# While cd-ed into the repository, run this to get a shell with the `sops` tool present
|
||||||
|
nix-shell
|
||||||
|
```
|
||||||
|
|
||||||
|
Now you should also be able to edit secrets for this machine by running:
|
||||||
|
|
||||||
|
```
|
||||||
|
sops secrets/<machine_name>/<machine_name>.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
## Adding a user
|
||||||
|
|
||||||
|
Adding a user is quite similar to adding a new machine.
|
||||||
|
This guide assumes you have already set up SSH keys.
|
||||||
|
|
||||||
|
```
|
||||||
|
# Derive an age-key from your key
|
||||||
|
# (edit the path to the key if it is named something else)
|
||||||
|
nix-shell -p ssh-to-age --run 'cat ~/.ssh/id_ed25519.pub | ssh-to-age'
|
||||||
|
|
||||||
|
# Register the age key in .sops.yaml
|
||||||
|
vim .sops.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
The contents of `.sops.yaml` should look like this:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
keys:
|
||||||
|
# Users
|
||||||
|
...
|
||||||
|
- &user_<user_name> <public_age_key>
|
||||||
|
|
||||||
|
# Hosts
|
||||||
|
...
|
||||||
|
|
||||||
|
creation_rules:
|
||||||
|
...
|
||||||
|
|
||||||
|
# Do this for all the machines you are planning to edit
|
||||||
|
# (or just do it for all machines)
|
||||||
|
- path_regex: secrets/<machine_name>/[^/]+\.yaml$
|
||||||
|
key_groups:
|
||||||
|
- age:
|
||||||
|
- *host_<machine_name>
|
||||||
|
- ... user keys
|
||||||
|
- *host_<user_name>
|
||||||
|
- pgp:
|
||||||
|
- ... user keys
|
||||||
|
```
|
||||||
|
|
||||||
|
Now that sops is properly configured to recognize the key, you need someone
|
||||||
|
who already has access to decrypt all the secrets and re-encrypt them with your
|
||||||
|
key. At this point, you should probably [open a PR](https://docs.gitea.com/usage/issues-prs/pull-request)
|
||||||
|
and ask someone in PVV maintenance if they can checkout the PR branch, run the following
|
||||||
|
command and push the diff back into the PR (and maybe even ask them to merge if you're feeling
|
||||||
|
particularly needy).
|
||||||
|
|
||||||
|
```console
|
||||||
|
sops updatekeys secrets/*/*.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
## Updating keys
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> At some point, we found this flag called `sops -r` that seemed to be described to do what
|
||||||
|
> `sops updatekeys` does, do not be fooled. This only rotates the "inner key" for those who
|
||||||
|
> already have the secrets encrypted with their key.
|
||||||
|
|
||||||
|
Updating keys is done with this command:
|
||||||
|
|
||||||
|
```console
|
||||||
|
sops updatekeys secrets/*/*.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
However, there is a small catch. [oysteikt](https://git.pvv.ntnu.no/oysteikt) has kinda been
|
||||||
|
getting gray hairs lately, and refuses to use modern technology - he is still stuck using GPG.
|
||||||
|
This means that to be able to re-encrypt the sops secrets, you will need to have a gpg keychain
|
||||||
|
with his latest public key available. The key has an expiry date, so if he forgets to update it,
|
||||||
|
you should send him and angry email and tag him a bunch of times in a gitea issue. If the key
|
||||||
|
is up to date, you can do the following:
|
||||||
|
|
||||||
|
```console
|
||||||
|
# Fetch gpg (unless you have it already)
|
||||||
|
nix-shell -p gpg
|
||||||
|
|
||||||
|
# Import oysteikts key to the gpg keychain
|
||||||
|
gpg --import ./keys/oysteikt.pub
|
||||||
|
```
|
||||||
|
|
||||||
|
Now you should be able to run the `sops updatekeys` command again.
|
||||||
50
docs/users.md
Normal file
50
docs/users.md
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
# User management
|
||||||
|
|
||||||
|
Due to some complications with how NixOS creates users compared to how we used to
|
||||||
|
create users with the salt-based setup, the NixOS machine users are created and
|
||||||
|
managed separately. We tend to create users on-demand, whenever someone in PVV
|
||||||
|
maintenance want to work on the NixOS machines.
|
||||||
|
|
||||||
|
## Setting up a new user
|
||||||
|
|
||||||
|
You can find the files for the existing users, and thereby examples of user files
|
||||||
|
in the [`users`](../users) directory. When creating a new file here, you should name it
|
||||||
|
`your-username.nix`, and add *at least* the following contents:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
users.users."<username>" = {
|
||||||
|
isNormalUser = true;
|
||||||
|
extraGroups = [
|
||||||
|
"wheel" # In case you wanna use sudo (you probably do)
|
||||||
|
"nix-builder-users" # Arbitrary access to write to the nix store
|
||||||
|
];
|
||||||
|
|
||||||
|
# Any packages you frequently use to manage servers go here.
|
||||||
|
# Please don't pull gigantonormous packages here unless you
|
||||||
|
# absolutely need them, and remember that any package can be
|
||||||
|
# pulled via nix-shell if you only use it once in a blue moon.
|
||||||
|
packages = with pkgs; [
|
||||||
|
bottom
|
||||||
|
eza
|
||||||
|
];
|
||||||
|
|
||||||
|
# Not strictly needed, but we recommend adding your public SSH
|
||||||
|
# key here. If it is not present, you will have to log into the
|
||||||
|
# machine as 'root' before setting your password for every NixOS
|
||||||
|
# machine you have not logged into yet.
|
||||||
|
openssh.authorizedKeys.keys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIjiQ0wg4lpC7YBMAAHoGmgwqHOBi+EUz5mmCymGlIyT my-key"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The file will be picked up automatically, so creating the file and adding the
|
||||||
|
contents should be enough to get you registered. You should
|
||||||
|
[open a PR](https://docs.gitea.com/usage/issues-prs/pull-request) with the new
|
||||||
|
code so the machines will be rebuilt with your user present.
|
||||||
|
|
||||||
|
See also [Secret Management](./secret-management.md) for how to add your keys to the
|
||||||
|
system that lets us add secrets (API keys, password, etc.) to the NixOS config.
|
||||||
244
flake.lock
generated
244
flake.lock
generated
@@ -1,5 +1,26 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"devshell": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nix-topology",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1728330715,
|
||||||
|
"narHash": "sha256-xRJ2nPOXb//u1jaBnDP56M7v5ldavjbtR6lfGqSvcKg=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "devshell",
|
||||||
|
"rev": "dd6b80932022cea34a019e2bb32f6fa9e494dfef",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "devshell",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"disko": {
|
"disko": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -7,19 +28,54 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1764627417,
|
"lastModified": 1736864502,
|
||||||
"narHash": "sha256-D6xc3Rl8Ab6wucJWdvjNsGYGSxNjQHzRc2EZ6eeQ6l4=",
|
"narHash": "sha256-ItkIZyebGvNH2dK9jVGzJHGPtb6BSWLN8Gmef16NeY0=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "disko",
|
"repo": "disko",
|
||||||
"rev": "5a88a6eceb8fd732b983e72b732f6f4b8269bef3",
|
"rev": "0141aabed359f063de7413f80d906e1d98c0c123",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
|
"ref": "v1.11.0",
|
||||||
"repo": "disko",
|
"repo": "disko",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"flake-compat": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1696426674,
|
||||||
|
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1726560853,
|
||||||
|
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"gergle": {
|
"gergle": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -29,17 +85,40 @@
|
|||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1764868579,
|
"lastModified": 1764868579,
|
||||||
"narHash": "sha256-rfTUOIc0wnC4+19gLVfPbHfXx/ilfuUix6bWY+yaM2U=",
|
"narHash": "sha256-rfTUOIc0wnC4+19gLVfPbHfXx/ilfuUix6bWY+yaM2U=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "main",
|
||||||
"rev": "9c923d1d50daa6a3b28c3214ad2300bfaf6c8fcd",
|
"rev": "9c923d1d50daa6a3b28c3214ad2300bfaf6c8fcd",
|
||||||
"revCount": 22,
|
"revCount": 22,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.pvv.ntnu.no/Grzegorz/gergle.git"
|
"url": "https://git.pvv.ntnu.no/Grzegorz/gergle.git"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
"ref": "main",
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.pvv.ntnu.no/Grzegorz/gergle.git"
|
"url": "https://git.pvv.ntnu.no/Grzegorz/gergle.git"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"gitignore": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nix-topology",
|
||||||
|
"pre-commit-hooks",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1709087332,
|
||||||
|
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"greg-ng": {
|
"greg-ng": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -48,15 +127,16 @@
|
|||||||
"rust-overlay": "rust-overlay"
|
"rust-overlay": "rust-overlay"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1764868843,
|
"lastModified": 1765760377,
|
||||||
"narHash": "sha256-ZXYLXKO+VjAJr2f5zz+7SuKFICfI2eZnmTgS/626YE0=",
|
"narHash": "sha256-2+lgzUjVas9hPSeWn52MwuX+iidMN4RkzkHo4vrGmR8=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "main",
|
||||||
"rev": "c095533c50e80dd18ac48046f1479cf4d83c631c",
|
"rev": "f340dc5b9c9f3b75b7aca41f56f8869b9e28cf8c",
|
||||||
"revCount": 52,
|
"revCount": 58,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.pvv.ntnu.no/Grzegorz/greg-ng.git"
|
"url": "https://git.pvv.ntnu.no/Grzegorz/greg-ng.git"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
"ref": "main",
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.pvv.ntnu.no/Grzegorz/greg-ng.git"
|
"url": "https://git.pvv.ntnu.no/Grzegorz/greg-ng.git"
|
||||||
}
|
}
|
||||||
@@ -70,13 +150,14 @@
|
|||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1764867811,
|
"lastModified": 1764867811,
|
||||||
"narHash": "sha256-UWHiwr8tIcGcVxMLvAdNxDbQ8QuHf3REHboyxvFkYEI=",
|
"narHash": "sha256-UWHiwr8tIcGcVxMLvAdNxDbQ8QuHf3REHboyxvFkYEI=",
|
||||||
"ref": "refs/heads/master",
|
"ref": "master",
|
||||||
"rev": "c9983e947efe047ea9d6f97157a1f90e49d0eab3",
|
"rev": "c9983e947efe047ea9d6f97157a1f90e49d0eab3",
|
||||||
"revCount": 81,
|
"revCount": 81,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.pvv.ntnu.no/Grzegorz/grzegorz-clients.git"
|
"url": "https://git.pvv.ntnu.no/Grzegorz/grzegorz-clients.git"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
"ref": "master",
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.pvv.ntnu.no/Grzegorz/grzegorz-clients.git"
|
"url": "https://git.pvv.ntnu.no/Grzegorz/grzegorz-clients.git"
|
||||||
}
|
}
|
||||||
@@ -106,18 +187,20 @@
|
|||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
],
|
||||||
|
"rust-overlay": "rust-overlay_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1756124334,
|
"lastModified": 1766407405,
|
||||||
"narHash": "sha256-DXFmSpgI8FrqcdqY7wg5l/lpssWjslHq5ufvyp/5k4o=",
|
"narHash": "sha256-UEJ8F8/oG70biWRrGbL5/aB7OXzzvnYs+jxkR07UHvA=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "main",
|
||||||
"rev": "83760b1ebcd9722ddf58a4117d29555da65538ad",
|
"rev": "e719840f72ca1b0cd169562a3a0de69899821de0",
|
||||||
"revCount": 13,
|
"revCount": 16,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.pvv.ntnu.no/Projects/minecraft-heatmap.git"
|
"url": "https://git.pvv.ntnu.no/Projects/minecraft-heatmap.git"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
"ref": "main",
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.pvv.ntnu.no/Projects/minecraft-heatmap.git"
|
"url": "https://git.pvv.ntnu.no/Projects/minecraft-heatmap.git"
|
||||||
}
|
}
|
||||||
@@ -129,15 +212,16 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1765903589,
|
"lastModified": 1765904683,
|
||||||
"narHash": "sha256-JRLmckeM4G2hkH2V3VdfjHrrsWgJ8j7rZDYYjHTkRqA=",
|
"narHash": "sha256-uXM56y5n5GWpCiCNdKlTcCAy2IntgDB21c4gBDU30io=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "main",
|
||||||
"rev": "7c86d342e68506fcd83cb74af3336f99ff522a0a",
|
"rev": "6fae27b1659efb6774cf08a4e36ed29ab0e24105",
|
||||||
"revCount": 24,
|
"revCount": 26,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.pvv.ntnu.no/Projects/minecraft-kartverket.git"
|
"url": "https://git.pvv.ntnu.no/Projects/minecraft-kartverket.git"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
"ref": "main",
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.pvv.ntnu.no/Projects/minecraft-kartverket.git"
|
"url": "https://git.pvv.ntnu.no/Projects/minecraft-kartverket.git"
|
||||||
}
|
}
|
||||||
@@ -151,17 +235,42 @@
|
|||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1743881366,
|
"lastModified": 1743881366,
|
||||||
"narHash": "sha256-ScGA2IHPk9ugf9bqEZnp+YB/OJgrkZblnG/XLEKvJAo=",
|
"narHash": "sha256-ScGA2IHPk9ugf9bqEZnp+YB/OJgrkZblnG/XLEKvJAo=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "main",
|
||||||
"rev": "db2e4becf1b11e5dfd33de12a90a7d089fcf68ec",
|
"rev": "db2e4becf1b11e5dfd33de12a90a7d089fcf68ec",
|
||||||
"revCount": 11,
|
"revCount": 11,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.pvv.ntnu.no/Drift/nix-gitea-themes.git"
|
"url": "https://git.pvv.ntnu.no/Drift/nix-gitea-themes.git"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
"ref": "main",
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.pvv.ntnu.no/Drift/nix-gitea-themes.git"
|
"url": "https://git.pvv.ntnu.no/Drift/nix-gitea-themes.git"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nix-topology": {
|
||||||
|
"inputs": {
|
||||||
|
"devshell": "devshell",
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"pre-commit-hooks": "pre-commit-hooks"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1765969653,
|
||||||
|
"narHash": "sha256-qVpQxyvdByeDfb+d+jhbyNna2Ie+w85iHpt4Qu0rv/E=",
|
||||||
|
"owner": "oddlama",
|
||||||
|
"repo": "nix-topology",
|
||||||
|
"rev": "0ed73e5a1b65eb8ed388d070ebe8dedb9182f466",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "oddlama",
|
||||||
|
"ref": "main",
|
||||||
|
"repo": "nix-topology",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1764806471,
|
"lastModified": 1764806471,
|
||||||
@@ -188,6 +297,33 @@
|
|||||||
"url": "https://nixos.org/channels/nixos-unstable-small/nixexprs.tar.xz"
|
"url": "https://nixos.org/channels/nixos-unstable-small/nixexprs.tar.xz"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"pre-commit-hooks": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat",
|
||||||
|
"gitignore": "gitignore",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nix-topology",
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"nixpkgs-stable": [
|
||||||
|
"nix-topology",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1730797577,
|
||||||
|
"narHash": "sha256-SrID5yVpyUfknUTGWgYkTyvdr9J1LxUym4om3SVGPkg=",
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "pre-commit-hooks.nix",
|
||||||
|
"rev": "1864030ed24a2b8b4e4d386a5eeaf0c5369e50a9",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "pre-commit-hooks.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"pvv-calendar-bot": {
|
"pvv-calendar-bot": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -197,13 +333,14 @@
|
|||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1764869785,
|
"lastModified": 1764869785,
|
||||||
"narHash": "sha256-FGTIpC7gB4lbeL0bfYzn1Ge0PaCpd7VqWBLhJBx0i4A=",
|
"narHash": "sha256-FGTIpC7gB4lbeL0bfYzn1Ge0PaCpd7VqWBLhJBx0i4A=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "main",
|
||||||
"rev": "8ce7fb0b1918bdb3d1489a40d73895693955e8b2",
|
"rev": "8ce7fb0b1918bdb3d1489a40d73895693955e8b2",
|
||||||
"revCount": 23,
|
"revCount": 23,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.pvv.ntnu.no/Projects/calendar-bot.git"
|
"url": "https://git.pvv.ntnu.no/Projects/calendar-bot.git"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
"ref": "main",
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.pvv.ntnu.no/Projects/calendar-bot.git"
|
"url": "https://git.pvv.ntnu.no/Projects/calendar-bot.git"
|
||||||
}
|
}
|
||||||
@@ -215,15 +352,16 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1757332682,
|
"lastModified": 1765978548,
|
||||||
"narHash": "sha256-4p4aVQWs7jHu3xb6TJlGik20lqbUU/Fc0/EHpzoRlO0=",
|
"narHash": "sha256-VDSPpw+/Mgo+JujoW12CRlkTs9o0tX/FEL2AR5kl5+Q=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "main",
|
||||||
"rev": "da1113341ad9881d8d333d1e29790317bd7701e7",
|
"rev": "961f021d27f86b2aedd16290dbf85bdd9d50fd42",
|
||||||
"revCount": 518,
|
"revCount": 532,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.pvv.ntnu.no/Projects/nettsiden.git"
|
"url": "https://git.pvv.ntnu.no/Projects/nettsiden.git"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
"ref": "main",
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.pvv.ntnu.no/Projects/nettsiden.git"
|
"url": "https://git.pvv.ntnu.no/Projects/nettsiden.git"
|
||||||
}
|
}
|
||||||
@@ -238,6 +376,7 @@
|
|||||||
"minecraft-heatmap": "minecraft-heatmap",
|
"minecraft-heatmap": "minecraft-heatmap",
|
||||||
"minecraft-kartverket": "minecraft-kartverket",
|
"minecraft-kartverket": "minecraft-kartverket",
|
||||||
"nix-gitea-themes": "nix-gitea-themes",
|
"nix-gitea-themes": "nix-gitea-themes",
|
||||||
|
"nix-topology": "nix-topology",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||||
"pvv-calendar-bot": "pvv-calendar-bot",
|
"pvv-calendar-bot": "pvv-calendar-bot",
|
||||||
@@ -253,11 +392,32 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1764816035,
|
"lastModified": 1765680428,
|
||||||
"narHash": "sha256-F0IQSmSj4t2ThkbWZooAhkCTO+YpZSd2Pqiv2uoYEHo=",
|
"narHash": "sha256-fyPmRof9SZeI14ChPk5rVPOm7ISiiGkwGCunkhM+eUg=",
|
||||||
"owner": "oxalica",
|
"owner": "oxalica",
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"rev": "74d9abb7c5c030469f90d97a67d127cc5d76c238",
|
"rev": "eb3898d8ef143d4bf0f7f2229105fc51c7731b2f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rust-overlay_2": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"minecraft-heatmap",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1766371695,
|
||||||
|
"narHash": "sha256-W7CX9vy7H2Jj3E8NI4djHyF8iHSxKpb2c/7uNQ/vGFU=",
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"rev": "d81285ba8199b00dc31847258cae3c655b605e8c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -273,18 +433,34 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1764483358,
|
"lastModified": 1766894905,
|
||||||
"narHash": "sha256-EyyvCzXoHrbL467YSsQBTWWg4sR96MH1sPpKoSOelB4=",
|
"narHash": "sha256-pn8AxxfajqyR/Dmr1wnZYdUXHgM3u6z9x0Z1Ijmz2UQ=",
|
||||||
"owner": "Mic92",
|
"owner": "Mic92",
|
||||||
"repo": "sops-nix",
|
"repo": "sops-nix",
|
||||||
"rev": "5aca6ff67264321d47856a2ed183729271107c9c",
|
"rev": "61b39c7b657081c2adc91b75dd3ad8a91d6f07a7",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "Mic92",
|
"owner": "Mic92",
|
||||||
|
"ref": "master",
|
||||||
"repo": "sops-nix",
|
"repo": "sops-nix",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|||||||
75
flake.nix
75
flake.nix
@@ -5,35 +5,38 @@
|
|||||||
nixpkgs.url = "https://nixos.org/channels/nixos-25.11-small/nixexprs.tar.xz";
|
nixpkgs.url = "https://nixos.org/channels/nixos-25.11-small/nixexprs.tar.xz";
|
||||||
nixpkgs-unstable.url = "https://nixos.org/channels/nixos-unstable-small/nixexprs.tar.xz";
|
nixpkgs-unstable.url = "https://nixos.org/channels/nixos-unstable-small/nixexprs.tar.xz";
|
||||||
|
|
||||||
sops-nix.url = "github:Mic92/sops-nix";
|
sops-nix.url = "github:Mic92/sops-nix/master";
|
||||||
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
|
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
disko.url = "github:nix-community/disko";
|
disko.url = "github:nix-community/disko/v1.11.0";
|
||||||
disko.inputs.nixpkgs.follows = "nixpkgs";
|
disko.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
pvv-nettsiden.url = "git+https://git.pvv.ntnu.no/Projects/nettsiden.git";
|
nix-topology.url = "github:oddlama/nix-topology/main";
|
||||||
|
nix-topology.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
|
pvv-nettsiden.url = "git+https://git.pvv.ntnu.no/Projects/nettsiden.git?ref=main";
|
||||||
pvv-nettsiden.inputs.nixpkgs.follows = "nixpkgs";
|
pvv-nettsiden.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
pvv-calendar-bot.url = "git+https://git.pvv.ntnu.no/Projects/calendar-bot.git";
|
pvv-calendar-bot.url = "git+https://git.pvv.ntnu.no/Projects/calendar-bot.git?ref=main";
|
||||||
pvv-calendar-bot.inputs.nixpkgs.follows = "nixpkgs";
|
pvv-calendar-bot.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
matrix-next.url = "github:dali99/nixos-matrix-modules/v0.8.0";
|
matrix-next.url = "github:dali99/nixos-matrix-modules/v0.8.0";
|
||||||
matrix-next.inputs.nixpkgs.follows = "nixpkgs";
|
matrix-next.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
nix-gitea-themes.url = "git+https://git.pvv.ntnu.no/Drift/nix-gitea-themes.git";
|
nix-gitea-themes.url = "git+https://git.pvv.ntnu.no/Drift/nix-gitea-themes.git?ref=main";
|
||||||
nix-gitea-themes.inputs.nixpkgs.follows = "nixpkgs";
|
nix-gitea-themes.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
minecraft-heatmap.url = "git+https://git.pvv.ntnu.no/Projects/minecraft-heatmap.git";
|
minecraft-heatmap.url = "git+https://git.pvv.ntnu.no/Projects/minecraft-heatmap.git?ref=main";
|
||||||
minecraft-heatmap.inputs.nixpkgs.follows = "nixpkgs";
|
minecraft-heatmap.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
greg-ng.url = "git+https://git.pvv.ntnu.no/Grzegorz/greg-ng.git";
|
greg-ng.url = "git+https://git.pvv.ntnu.no/Grzegorz/greg-ng.git?ref=main";
|
||||||
greg-ng.inputs.nixpkgs.follows = "nixpkgs";
|
greg-ng.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
gergle.url = "git+https://git.pvv.ntnu.no/Grzegorz/gergle.git";
|
gergle.url = "git+https://git.pvv.ntnu.no/Grzegorz/gergle.git?ref=main";
|
||||||
gergle.inputs.nixpkgs.follows = "nixpkgs";
|
gergle.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
grzegorz-clients.url = "git+https://git.pvv.ntnu.no/Grzegorz/grzegorz-clients.git";
|
grzegorz-clients.url = "git+https://git.pvv.ntnu.no/Grzegorz/grzegorz-clients.git?ref=master";
|
||||||
grzegorz-clients.inputs.nixpkgs.follows = "nixpkgs";
|
grzegorz-clients.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
minecraft-kartverket.url = "git+https://git.pvv.ntnu.no/Projects/minecraft-kartverket.git";
|
minecraft-kartverket.url = "git+https://git.pvv.ntnu.no/Projects/minecraft-kartverket.git?ref=main";
|
||||||
minecraft-kartverket.inputs.nixpkgs.follows = "nixpkgs";
|
minecraft-kartverket.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -57,6 +60,16 @@
|
|||||||
in {
|
in {
|
||||||
inputs = lib.mapAttrs (_: src: src.outPath) inputs;
|
inputs = lib.mapAttrs (_: src: src.outPath) inputs;
|
||||||
|
|
||||||
|
pkgs = forAllSystems (system:
|
||||||
|
import nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg)
|
||||||
|
[
|
||||||
|
"nvidia-x11"
|
||||||
|
"nvidia-settings"
|
||||||
|
];
|
||||||
|
});
|
||||||
|
|
||||||
nixosConfigurations = let
|
nixosConfigurations = let
|
||||||
unstablePkgs = nixpkgs-unstable.legacyPackages.x86_64-linux;
|
unstablePkgs = nixpkgs-unstable.legacyPackages.x86_64-linux;
|
||||||
|
|
||||||
@@ -230,14 +243,50 @@
|
|||||||
bluemap = pkgs.callPackage ./packages/bluemap.nix { };
|
bluemap = pkgs.callPackage ./packages/bluemap.nix { };
|
||||||
|
|
||||||
out-of-your-element = pkgs.callPackage ./packages/out-of-your-element.nix { };
|
out-of-your-element = pkgs.callPackage ./packages/out-of-your-element.nix { };
|
||||||
} //
|
}
|
||||||
|
//
|
||||||
|
# Mediawiki extensions
|
||||||
(lib.pipe null [
|
(lib.pipe null [
|
||||||
(_: pkgs.callPackage ./packages/mediawiki-extensions { })
|
(_: pkgs.callPackage ./packages/mediawiki-extensions { })
|
||||||
(lib.flip builtins.removeAttrs ["override" "overrideDerivation"])
|
(lib.flip builtins.removeAttrs ["override" "overrideDerivation"])
|
||||||
(lib.mapAttrs' (name: lib.nameValuePair "mediawiki-${name}"))
|
(lib.mapAttrs' (name: lib.nameValuePair "mediawiki-${name}"))
|
||||||
])
|
])
|
||||||
// lib.genAttrs allMachines
|
//
|
||||||
(machine: self.nixosConfigurations.${machine}.config.system.build.toplevel);
|
# Machines
|
||||||
|
lib.genAttrs allMachines
|
||||||
|
(machine: self.nixosConfigurations.${machine}.config.system.build.toplevel)
|
||||||
|
//
|
||||||
|
# Nix-topology
|
||||||
|
(let
|
||||||
|
topology' = import inputs.nix-topology {
|
||||||
|
pkgs = import nixpkgs {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
overlays = [ inputs.nix-topology.overlays.default ];
|
||||||
|
};
|
||||||
|
|
||||||
|
modules = [
|
||||||
|
./topology
|
||||||
|
{
|
||||||
|
nixosConfigurations = lib.mapAttrs (_name: nixosCfg: nixosCfg.extendModules {
|
||||||
|
modules = [
|
||||||
|
inputs.nix-topology.nixosModules.default
|
||||||
|
./topology/service-extractors/greg-ng.nix
|
||||||
|
];
|
||||||
|
}) self.nixosConfigurations;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
topology = topology'.config.output;
|
||||||
|
topology-png = pkgs.runCommand "pvv-config-topology-png" {
|
||||||
|
nativeBuildInputs = [ pkgs.writableTmpDirAsHomeHook ];
|
||||||
|
} ''
|
||||||
|
mkdir -p "$out"
|
||||||
|
for file in '${topology'.config.output}'/*.svg; do
|
||||||
|
${lib.getExe pkgs.imagemagick} -density 300 -background none "$file" "$out"/"$(basename "''${file%.svg}.png")"
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
});
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
../../base
|
../../base
|
||||||
../../misc/metrics-exporters.nix
|
|
||||||
./filesystems.nix
|
./filesystems.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
|
||||||
(fp /base)
|
(fp /base)
|
||||||
(fp /misc/metrics-exporters.nix)
|
|
||||||
|
|
||||||
./services/bluemap.nix
|
./services/bluemap.nix
|
||||||
./services/idp-simplesamlphp
|
./services/idp-simplesamlphp
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
|
||||||
(fp /base)
|
(fp /base)
|
||||||
(fp /misc/metrics-exporters.nix)
|
|
||||||
./services/nginx
|
./services/nginx
|
||||||
|
|
||||||
./services/calendar-bot.nix
|
./services/calendar-bot.nix
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
# Include the results of the hardware scan.
|
# Include the results of the hardware scan.
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
(fp /base)
|
(fp /base)
|
||||||
(fp /misc/metrics-exporters.nix)
|
|
||||||
|
|
||||||
./services/grzegorz.nix
|
./services/grzegorz.nix
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
# Include the results of the hardware scan.
|
# Include the results of the hardware scan.
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
(fp /base)
|
(fp /base)
|
||||||
(fp /misc/metrics-exporters.nix)
|
|
||||||
|
|
||||||
(fp /modules/grzegorz.nix)
|
(fp /modules/grzegorz.nix)
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
# Include the results of the hardware scan.
|
# Include the results of the hardware scan.
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
(fp /base)
|
(fp /base)
|
||||||
(fp /misc/metrics-exporters.nix)
|
|
||||||
|
|
||||||
./services/monitoring
|
./services/monitoring
|
||||||
./services/nginx
|
./services/nginx
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
# Include the results of the hardware scan.
|
# Include the results of the hardware scan.
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
(fp /base)
|
(fp /base)
|
||||||
(fp /misc/metrics-exporters.nix)
|
|
||||||
|
|
||||||
./services/gitea
|
./services/gitea
|
||||||
./services/nginx.nix
|
./services/nginx.nix
|
||||||
@@ -31,4 +30,3 @@
|
|||||||
|
|
||||||
system.stateVersion = "24.11";
|
system.stateVersion = "24.11";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
./hardware-configuration/${lupineName}.nix
|
./hardware-configuration/${lupineName}.nix
|
||||||
|
|
||||||
(fp /base)
|
(fp /base)
|
||||||
(fp /misc/metrics-exporters.nix)
|
|
||||||
|
|
||||||
./services/gitea-runner.nix
|
./services/gitea-runner.nix
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
# Include the results of the hardware scan.
|
# Include the results of the hardware scan.
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
(fp /base)
|
(fp /base)
|
||||||
(fp /misc/metrics-exporters.nix)
|
|
||||||
];
|
];
|
||||||
|
|
||||||
sops.defaultSopsFile = fp /secrets/shark/shark.yaml;
|
sops.defaultSopsFile = fp /secrets/shark/shark.yaml;
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
(fp /base)
|
(fp /base)
|
||||||
(fp /misc/metrics-exporters.nix)
|
|
||||||
|
|
||||||
./services/gitea-runners.nix
|
./services/gitea-runners.nix
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -4,11 +4,16 @@
|
|||||||
# Include the results of the hardware scan.
|
# Include the results of the hardware scan.
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
(fp /base)
|
(fp /base)
|
||||||
(fp /misc/metrics-exporters.nix)
|
|
||||||
|
|
||||||
(fp /misc/builder.nix)
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
nix.settings.trusted-users = [ "@nix-builder-users" ];
|
||||||
|
nix.daemonCPUSchedPolicy = "batch";
|
||||||
|
|
||||||
|
boot.binfmt.emulatedSystems = [
|
||||||
|
"aarch64-linux"
|
||||||
|
"armv7l-linux"
|
||||||
|
];
|
||||||
|
|
||||||
sops.defaultSopsFile = fp /secrets/wenche/wenche.yaml;
|
sops.defaultSopsFile = fp /secrets/wenche/wenche.yaml;
|
||||||
sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
||||||
sops.age.keyFile = "/var/lib/sops-nix/key.txt";
|
sops.age.keyFile = "/var/lib/sops-nix/key.txt";
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
nix.settings.trusted-users = [ "@nix-builder-users" ];
|
|
||||||
nix.daemonCPUSchedPolicy = "batch";
|
|
||||||
|
|
||||||
boot.binfmt.emulatedSystems = [
|
|
||||||
"aarch64-linux"
|
|
||||||
"armv7l-linux"
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
{ config, pkgs, values, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
services.prometheus.exporters.node = {
|
|
||||||
enable = true;
|
|
||||||
port = 9100;
|
|
||||||
enabledCollectors = [ "systemd" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services.prometheus-node-exporter.serviceConfig = {
|
|
||||||
IPAddressDeny = "any";
|
|
||||||
IPAddressAllow = [
|
|
||||||
"127.0.0.1"
|
|
||||||
"::1"
|
|
||||||
values.hosts.ildkule.ipv4
|
|
||||||
values.hosts.ildkule.ipv6
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
services.prometheus.exporters.systemd = {
|
|
||||||
enable = true;
|
|
||||||
port = 9101;
|
|
||||||
extraFlags = [
|
|
||||||
"--systemd.collector.enable-restart-count"
|
|
||||||
"--systemd.collector.enable-ip-accounting"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services.prometheus-systemd-exporter.serviceConfig = {
|
|
||||||
IPAddressDeny = "any";
|
|
||||||
IPAddressAllow = [
|
|
||||||
"127.0.0.1"
|
|
||||||
"::1"
|
|
||||||
values.hosts.ildkule.ipv4
|
|
||||||
values.hosts.ildkule.ipv6
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ 9100 9101 ];
|
|
||||||
|
|
||||||
services.promtail = {
|
|
||||||
enable = true;
|
|
||||||
configuration = {
|
|
||||||
server = {
|
|
||||||
http_listen_port = 28183;
|
|
||||||
grpc_listen_port = 0;
|
|
||||||
};
|
|
||||||
clients = [
|
|
||||||
{
|
|
||||||
url = "http://ildkule.pvv.ntnu.no:3100/loki/api/v1/push";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
scrape_configs = [
|
|
||||||
{
|
|
||||||
job_name = "systemd-journal";
|
|
||||||
journal = {
|
|
||||||
max_age = "12h";
|
|
||||||
labels = {
|
|
||||||
job = "systemd-journal";
|
|
||||||
host = config.networking.hostName;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
relabel_configs = [
|
|
||||||
{
|
|
||||||
source_labels = [ "__journal__systemd_unit" ];
|
|
||||||
target_label = "unit";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
source_labels = [ "__journal_priority_keyword" ];
|
|
||||||
target_label = "level";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
{ pkgs, lib, config, ... }:
|
|
||||||
{
|
|
||||||
environment = {
|
|
||||||
systemPackages = with pkgs; [
|
|
||||||
rust-motd
|
|
||||||
toilet
|
|
||||||
];
|
|
||||||
|
|
||||||
loginShellInit = let
|
|
||||||
motd = "${pkgs.rust-motd}/bin/rust-motd /etc/${config.environment.etc.rustMotdConfig.target}";
|
|
||||||
in ''
|
|
||||||
# Assure stdout is a terminal, so headless programs won't be broken
|
|
||||||
if [ "x''${SSH_TTY}" != "x" ]; then
|
|
||||||
${motd}
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
|
|
||||||
etc.rustMotdConfig = {
|
|
||||||
target = "rust-motd-config.toml";
|
|
||||||
source = let
|
|
||||||
|
|
||||||
cfg = {
|
|
||||||
global = {
|
|
||||||
progress_full_character = "=";
|
|
||||||
progress_empty_character = "=";
|
|
||||||
progress_prefix = "[";
|
|
||||||
progress_suffix = "]";
|
|
||||||
time_format = "%Y-%m-%d %H:%M:%S";
|
|
||||||
};
|
|
||||||
|
|
||||||
banner = {
|
|
||||||
color = "red";
|
|
||||||
command = "hostname | ${pkgs.toilet}/bin/toilet -f mono9";
|
|
||||||
};
|
|
||||||
|
|
||||||
service_status = {
|
|
||||||
Accounts = "accounts-daemon";
|
|
||||||
Cron = "cron";
|
|
||||||
Docker = "docker";
|
|
||||||
Matrix = "matrix-synapse";
|
|
||||||
sshd = "sshd";
|
|
||||||
};
|
|
||||||
|
|
||||||
uptime = {
|
|
||||||
prefix = "Uptime: ";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Not relevant for server
|
|
||||||
# user_service_status = {
|
|
||||||
# Gpg-agent = "gpg-agent";
|
|
||||||
# };
|
|
||||||
|
|
||||||
filesystems = let
|
|
||||||
inherit (lib.attrsets) attrNames listToAttrs nameValuePair;
|
|
||||||
inherit (lib.lists) imap1;
|
|
||||||
inherit (config) fileSystems;
|
|
||||||
|
|
||||||
imap1Attrs' = f: set:
|
|
||||||
listToAttrs (imap1 (i: attr: f i attr set.${attr}) (attrNames set));
|
|
||||||
|
|
||||||
getName = i: v: if (v.label != null) then v.label else "<? ${toString i}>";
|
|
||||||
in
|
|
||||||
imap1Attrs' (i: n: v: nameValuePair (getName i v) n) fileSystems;
|
|
||||||
|
|
||||||
memory = {
|
|
||||||
swap_pos = "beside"; # or "below" or "none"
|
|
||||||
};
|
|
||||||
|
|
||||||
last_login = let
|
|
||||||
inherit (lib.lists) imap1;
|
|
||||||
inherit (lib.attrsets) filterAttrs nameValuePair attrValues listToAttrs;
|
|
||||||
inherit (config.users) users;
|
|
||||||
|
|
||||||
normalUsers = filterAttrs (n: v: v.isNormalUser || n == "root") users;
|
|
||||||
userNPVs = imap1 (index: user: nameValuePair user.name index) (attrValues normalUsers);
|
|
||||||
in listToAttrs userNPVs;
|
|
||||||
|
|
||||||
last_run = {};
|
|
||||||
};
|
|
||||||
|
|
||||||
toml = pkgs.formats.toml {};
|
|
||||||
|
|
||||||
in toml.generate "rust-motd.toml" cfg;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
168
topology/default.nix
Normal file
168
topology/default.nix
Normal file
@@ -0,0 +1,168 @@
|
|||||||
|
{ lib, config, ... }:
|
||||||
|
let
|
||||||
|
inherit
|
||||||
|
(config.lib.topology)
|
||||||
|
mkInternet
|
||||||
|
mkRouter
|
||||||
|
mkSwitch
|
||||||
|
mkDevice
|
||||||
|
mkConnection
|
||||||
|
mkConnectionRev;
|
||||||
|
values = import ../values.nix;
|
||||||
|
in {
|
||||||
|
imports = [
|
||||||
|
./non-nixos-machines.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
### Networks
|
||||||
|
|
||||||
|
networks.pvv = {
|
||||||
|
name = "PVV Network";
|
||||||
|
cidrv4 = values.ipv4-space;
|
||||||
|
cidrv6 = values.ipv6-space;
|
||||||
|
};
|
||||||
|
|
||||||
|
networks.site-vpn = {
|
||||||
|
name = "OpenVPN Site to Site";
|
||||||
|
style = {
|
||||||
|
primaryColor = "#9dd68d";
|
||||||
|
secondaryColor = null;
|
||||||
|
pattern = "dashed";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
networks.ntnu = {
|
||||||
|
name = "NTNU";
|
||||||
|
cidrv4 = values.ntnu.ipv4-space;
|
||||||
|
cidrv6 = values.ntnu.ipv6-space;
|
||||||
|
};
|
||||||
|
|
||||||
|
nodes.internet = mkInternet {
|
||||||
|
connections = mkConnection "ntnu" "wan1";
|
||||||
|
};
|
||||||
|
|
||||||
|
nodes.ntnu = mkRouter "NTNU" {
|
||||||
|
interfaceGroups = [ ["wan1"] ["eth1" "eth2" "eth3"] ];
|
||||||
|
connections.eth1 = mkConnection "ntnu-pvv-router" "wan1";
|
||||||
|
connections.eth2 = mkConnection "ntnu-veggen" "wan1";
|
||||||
|
connections.eth3 = mkConnection "stackit" "*";
|
||||||
|
interfaces.eth1.network = "ntnu";
|
||||||
|
};
|
||||||
|
|
||||||
|
### Brus
|
||||||
|
|
||||||
|
nodes.ntnu-pvv-router = mkRouter "NTNU PVV Gateway" {
|
||||||
|
interfaceGroups = [ ["wan1"] ["eth1"] ];
|
||||||
|
connections.eth1 = mkConnection "brus-switch" "eth1";
|
||||||
|
interfaces.eth1.network = "pvv";
|
||||||
|
};
|
||||||
|
|
||||||
|
nodes.brus-switch = mkSwitch "Brus Switch" {
|
||||||
|
interfaceGroups = [ (lib.genList (i: "eth${toString i}") 16) ];
|
||||||
|
|
||||||
|
connections = let
|
||||||
|
connections' = [
|
||||||
|
(mkConnection "bekkalokk" "enp2s0")
|
||||||
|
# (mkConnection "bicep" "enp6s0f0")
|
||||||
|
(mkConnection "buskerud" "eth1")
|
||||||
|
(mkConnection "knutsen" "eth1")
|
||||||
|
(mkConnection "powerpuff-cluster" "eth1")
|
||||||
|
(mkConnection "lupine-1" "enp0s31f6")
|
||||||
|
(mkConnection "lupine-2" "enp0s31f6")
|
||||||
|
(mkConnection "lupine-3" "enp0s31f6")
|
||||||
|
(mkConnection "lupine-4" "enp0s31f6")
|
||||||
|
(mkConnection "lupine-5" "enp0s31f6")
|
||||||
|
(mkConnection "innovation" "em0")
|
||||||
|
(mkConnection "microbel" "eth0")
|
||||||
|
# (mkConnection "isvegg" "")
|
||||||
|
# (mkConnection "ameno" "")
|
||||||
|
# (mkConnection "sleipner" "")
|
||||||
|
];
|
||||||
|
in builtins.listToAttrs (
|
||||||
|
lib.zipListsWith
|
||||||
|
(a: b: lib.nameValuePair a b)
|
||||||
|
(lib.genList (i: "eth${toString i}") 16)
|
||||||
|
connections'
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
nodes.knutsen = mkRouter "knutsen" {
|
||||||
|
interfaceGroups = [ ["eth1"] ["eth2"] ["vpn1"] ];
|
||||||
|
connections.eth2 = mkConnectionRev "brus-switch" "eth6";
|
||||||
|
# connections.vpn1 = mkConnection "ludvigsen" "vpn1";
|
||||||
|
interfaces.vpn1.network = "site-vpn";
|
||||||
|
interfaces.vpn1.virtual = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
nodes.buskerud = mkDevice "buskerud" {
|
||||||
|
interfaceGroups = [ ["eth1"] ];
|
||||||
|
};
|
||||||
|
|
||||||
|
nodes.shark = {
|
||||||
|
guestType = "proxmox";
|
||||||
|
parent = config.nodes.buskerud.id;
|
||||||
|
};
|
||||||
|
|
||||||
|
### Powerpuff
|
||||||
|
|
||||||
|
nodes.powerpuff-cluster = mkDevice "powerpuff-cluster" {
|
||||||
|
interfaceGroups = [ ["eth1"] ];
|
||||||
|
};
|
||||||
|
|
||||||
|
nodes.kommode = {
|
||||||
|
guestType = "proxmox";
|
||||||
|
parent = config.nodes.powerpuff-cluster.id;
|
||||||
|
};
|
||||||
|
|
||||||
|
nodes.bicep = {
|
||||||
|
guestType = "proxmox";
|
||||||
|
parent = config.nodes.powerpuff-cluster.id;
|
||||||
|
};
|
||||||
|
|
||||||
|
nodes.ustetind = {
|
||||||
|
guestType = "proxmox";
|
||||||
|
parent = config.nodes.powerpuff-cluster.id;
|
||||||
|
};
|
||||||
|
|
||||||
|
### PVV
|
||||||
|
|
||||||
|
nodes.ntnu-veggen = mkRouter "NTNU-Veggen" {
|
||||||
|
interfaceGroups = [ ["wan1"] ["eth1"] ];
|
||||||
|
connections.eth1 = mkConnection "ludvigsen" "eth1";
|
||||||
|
};
|
||||||
|
|
||||||
|
nodes.ludvigsen = mkRouter "ludvigsen" {
|
||||||
|
interfaceGroups = [ ["eth1"] ["eth2"] ["vpn1"] ];
|
||||||
|
connections.eth2 = mkConnection "pvv-switch" "eth1";
|
||||||
|
interfaces.vpn1.network = "site-vpn";
|
||||||
|
interfaces.vpn1.virtual = true;
|
||||||
|
interfaces.eth1.network = "ntnu";
|
||||||
|
interfaces.eth2.network = "pvv";
|
||||||
|
};
|
||||||
|
|
||||||
|
nodes.pvv-switch = mkSwitch "PVV Switch (Terminalrommet)" {
|
||||||
|
interfaceGroups = [ ["eth1" "eth2" "eth3"] ];
|
||||||
|
connections.eth2 = mkConnection "brzeczyszczykiewicz" "eno1";
|
||||||
|
connections.eth3 = mkConnection "georg" "eno1";
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
### Openstack
|
||||||
|
|
||||||
|
nodes.stackit = mkDevice "stackit" {
|
||||||
|
interfaceGroups = [ ["*"] ];
|
||||||
|
};
|
||||||
|
|
||||||
|
nodes.ildkule = {
|
||||||
|
guestType = "openstack";
|
||||||
|
parent = config.nodes.stackit.id;
|
||||||
|
};
|
||||||
|
nodes.wenche = {
|
||||||
|
guestType = "openstack";
|
||||||
|
parent = config.nodes.stackit.id;
|
||||||
|
};
|
||||||
|
nodes.bakke = {
|
||||||
|
guestType = "openstack";
|
||||||
|
parent = config.nodes.stackit.id;
|
||||||
|
};
|
||||||
|
}
|
||||||
BIN
topology/icons/greg-ng.png
Normal file
BIN
topology/icons/greg-ng.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
75
topology/non-nixos-machines.nix
Normal file
75
topology/non-nixos-machines.nix
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
inherit (config.lib.topology) mkDevice;
|
||||||
|
in {
|
||||||
|
nodes.balduzius = mkDevice "balduzius" {
|
||||||
|
guestType = "proxmox";
|
||||||
|
parent = config.nodes.powerpuff-cluster.id;
|
||||||
|
};
|
||||||
|
nodes.tom = mkDevice "tom" {
|
||||||
|
guestType = "proxmox";
|
||||||
|
parent = config.nodes.powerpuff-cluster.id;
|
||||||
|
};
|
||||||
|
nodes.hildring = mkDevice "hildring" {
|
||||||
|
guestType = "proxmox";
|
||||||
|
parent = config.nodes.powerpuff-cluster.id;
|
||||||
|
};
|
||||||
|
nodes.microbel = mkDevice "microbel" {
|
||||||
|
interfaceGroups = [ [ "eth0" ] ];
|
||||||
|
};
|
||||||
|
nodes.innovation = mkDevice "innovation" {
|
||||||
|
hardware.info = "Dell Optiplex 9010";
|
||||||
|
interfaceGroups = [ [ "em0" ] ];
|
||||||
|
interfaces.em0 = {
|
||||||
|
mac = "18:03:73:20:18:d3";
|
||||||
|
addresses = [
|
||||||
|
"129.241.210.214"
|
||||||
|
"2001:700:300:1900::1:56"
|
||||||
|
];
|
||||||
|
gateways = [
|
||||||
|
"129.241.210.129"
|
||||||
|
"2001:700:300:1900::1"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
services = {
|
||||||
|
minecraft = {
|
||||||
|
name = "Minecraft";
|
||||||
|
icon = "services.minecraft";
|
||||||
|
info = "minecraft.pvv.ntnu.no";
|
||||||
|
details.listen.text = "0.0.0.0:25565";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
nodes.principal = mkDevice "principal" {
|
||||||
|
interfaceGroups = [ [ ] ];
|
||||||
|
};
|
||||||
|
nodes.sleipner = mkDevice "sleipner" {
|
||||||
|
interfaceGroups = [ [ "eno0" "enp2s0" ] ];
|
||||||
|
};
|
||||||
|
nodes.isvegg = mkDevice "isvegg" {
|
||||||
|
interfaceGroups = [ [ ] ];
|
||||||
|
};
|
||||||
|
nodes.ameno = mkDevice "ameno" {
|
||||||
|
interfaceGroups = [ [ ] ];
|
||||||
|
};
|
||||||
|
nodes.skrott = mkDevice "skrott" {
|
||||||
|
deviceType = "terminal";
|
||||||
|
interfaceGroups = [ [ ] ];
|
||||||
|
};
|
||||||
|
nodes.torskas = mkDevice "torskas" {
|
||||||
|
deviceType = "terminal";
|
||||||
|
interfaceGroups = [ [ ] ];
|
||||||
|
};
|
||||||
|
nodes.wegonke = mkDevice "wegonke" {
|
||||||
|
deviceType = "terminal";
|
||||||
|
interfaceGroups = [ [ ] ];
|
||||||
|
};
|
||||||
|
nodes.demiurgen = mkDevice "demiurgen" {
|
||||||
|
deviceType = "terminal";
|
||||||
|
interfaceGroups = [ [ ] ];
|
||||||
|
};
|
||||||
|
nodes.sanctuary = mkDevice "sanctuary" {
|
||||||
|
deviceType = "terminal";
|
||||||
|
interfaceGroups = [ [ ] ];
|
||||||
|
};
|
||||||
|
}
|
||||||
11
topology/service-extractors/greg-ng.nix
Normal file
11
topology/service-extractors/greg-ng.nix
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.services.greg-ng or { enable = false; };
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config.topology.self.services.greg-ng = lib.mkIf cfg.enable {
|
||||||
|
name = "Greg-ng";
|
||||||
|
icon = ../icons/greg-ng.png;
|
||||||
|
details.listen = { text = "${cfg.settings.host}:${toString cfg.settings.port}"; };
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user