- Nix 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| modules | ||
| servers | ||
| users | ||
| flake.lock | ||
| flake.nix | ||
| README.md | ||
vps-infra
Author: celebrimbor from goonen.org infra team
What this flake contains
- Option for multiple servers
- Multiple modules for specific services
- Multiple user-configs for specific administration rights
Server definition
The different servers (only one yet) are configured in the server directory.
To address one of these in nixos-rebuild use .#server-name.
For example:
nixos-rebuild switch --flake .#nixos-hel1
For building, the server directory has to contain a configuration.nix and a hardware-configuration.nix. Most common options are set in nixos-hel1's configuration.nix.
Multiple modules
Every system-specific module is defined in the modules directory.
Now existing:
Missing:
- Networking in general
- Better config of specific containers???
You can define a module with options.modules inside a nix boiler-plate:
options.modules.nixos.module-example= {
enable = lib.mkEnableOption "module-example";
};
Note
Use
libin boiler-plate:{ pkgs, lib, config, ... }: {}
To define the nix-configuration you want to use, set config = lib.mkIf:
config = lib.mkIf config.modules.nixos.port-forwarding.enable {
#your code here
};
To enable the option you defined, set modules.nixos.<your-module>.enable = true in your configuration.nix.
Important
Insert your module file in
insertsin common.nix.
Multiple users
There is no crazy working user-configuration in general.
Existing users:
- admin user config (only ssh-key)
- root user config (only ssh-key)
- container-service user config (nothing in yet)
- tor-service user config (nothing in yet)