Basic Nixos Module
| app | ||
| config | ||
| desktop | ||
| overlay/nixos-check_mk_agent-overlay | ||
| service | ||
| virtualisation | ||
| default.nix | ||
| flake.lock | ||
| flake.nix | ||
| options.nix | ||
| README.md | ||
Nixos - zNix
Vorraussetzung
- Nixos oder kompatibel
- Flakes https://nixos.wiki/wiki/flakes
- Colmena https://github.com/zhaofengli/colmena
Anwendung
Alias zur Anwendung:
alias apply_local="colmena apply-local --impure --sudo"
alias apply_remote="colmena apply --impure --on"
Danach kann mit apply_local oder apply_remote hostname der jeweilige Host aktualisiert werden. Flake aktualisieren: nix flake update znix Erneuert die flake.lock.
Options
Preset
Ein Preset ist eine Zusammenstellung aus mehreen Optionen:
Desktop Beispiel
znix = {
preset = "desktop";
desktops = ["plasma6" "sddm" "xserver"];
};
Die Optionen für Desktop setzt sich zusammen aus:
znix = {
# Config
config = {
audit = true;
basic = true;
boost = false;
bugfix = true;
localuser = true;
power = true;
secure = false;
shell = true;
};
# Services
service = {
ssh = {
enable = true;
secure = true;
};
checkmk_agent.enable = true;
logrotate.enable = false;
};
# Desktop-Optionen
desktop = {
sound = true;
print = true;
bluetooth = true;
};
# Desktop
# verfügbare Optionen
# xserver sddm lightdm xterm
# plasma6 xfce hyprland
desktops = [ "xserver" ];
# Virtualisation
virtualisation = {
podman = {
enable = true;
network = true;
};
};
# Apps
# verfügbare Optionen:
# video game dev_workstation dev_workstation desktop basic
apps = [ "basic" "desktop" ];
};
Setup
flake.nix
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager/release-25.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
nixos-hardware.url = "github:NixOS/nixos-hardware";
# -- Znix --
znix.url = "git+https://git.zarix.de/richi/znix.git?ref=main";
znix.inputs.nixpkgs.follows = "nixpkgs";
znix.inputs.nixpkgs-unstable.follows = "nixpkgs-unstable"; # optional
};
outputs = { nixpkgs, home-manager, nixpkgs-unstable, nixos-hardware, ... }@inputs: {
# ...
};
host.nix
imports = [
./hardware-configuration.nix
inputs.home-manager.nixosModules.home-manager
inputs.znix.nixosModules.znix
# ...
];
Dev
Revision für ein Pakte/Overlay bei Github ermitteln:
nix-prefetch-git https://github.com/Checkmk/checkmk/ --rev refs/tags/v2.2.0p17