mirror of
https://github.com/nix-community/srvos.git
synced 2024-10-26 17:49:54 +03:00
NixOS profiles for servers [maintainer=@numtide]
.github | ||
nixos | ||
bors.toml | ||
default.nix | ||
flake.lock | ||
flake.nix | ||
LICENSE | ||
README.md |
SrvOS - NixOS for your server
STATUS: experimental
SrvOS is a collection of opinionated and sharable NixOS configurations.
As we learn more about NixOS in various deployments, we end up re-writing the same modules and configs. This is a way for us to speed up and share our setups.
Instead of supporting everything, our goal is to target certain verticals and make the support super smooth there.
Usage
Add srvos
to your flake.nix and include it in your nixos configuration. For
example to deploy a GitHub Action runner on Hetzner:
{
inputs = {
srvos.url = "github:numtide/srvos";
};
outputs = { srvos, nixpkgs, ... }: {
nixosConfigurations.myHost = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
srvos.nixosModules.common
srvos.nixosModules.hardware-hetzner-amd
srvos.nixosModules.roles-github-actions-runner
];
};
};
}
Modules
All modules are defined in this file
General
Used to define the type of machine.
server
:- Use this for headless systems that are remotely managed via ssh
- Includes everything from common
- Disables desktop features like sound
- Defaults to UTC
- Enables ssh
- Configures watchdog for reboot
- Sets up sudo without password
- ...
desktop
:- Mostly based on common but also includes some optimization for useful for interactive usage
common
:- Use if you are unsure if your nixos module will be used on server or desktop
- Better nix-daemon defaults
- Better serial console support
- Colored package diffs on nixos-rebuild
- Use systemd in initrd by default and networkd as a backend for the Networking module
- Do not block on networkd/networkmanager's online target
- Better zfs defaults
- Add well-known ssh git ssh keys to the git configuration
Hardware
NixOS hardware configurations that we know about.
hardware-amazon
: Amazon AWS virtual machineshardware-hetzner-cloud
: Hardware and network defaults for Hetzner virtual machinehardware-hetzner-amd
: Hardware and network defaults for Hetzner bare-metal servers for AMD and Intel cpus.hardware-hetzner-intel
: "
Mixins
Config extensions for a given machine.
mixins-cloud-init
enables cloud-initmixins-systemd-boot
configure systemd-boot as bootloadermixins-telegraf
enables a generic telegraf configuration. See Mic's dotfiles for monitoring rules targeting this telegraf configuration.mixins-nginx
recommended nginx settingsmixins-trusted-nix-caches
list of trust-worthy public binary caches
Roles
Designed to take over a machine with the given role.
roles-github-actions-runner
configures GitHub actions runner on a machine
License
This is a Numtide project.