- remove k3s.nix (1.3GB overhead unjustified for single-node) - add docker.nix (docker + arion CLI, mikl in docker group) - add caddy.nix (edge proxy, TLS via ACME staging, host-based routing) - add syncthing.nix (sync daemon + strelaysrv via systemd, /srv/syncthing) - add arion-compose.nix (forgejo first, others stubbed as TODO) - add arion flake input + nixos module - default.nix: wire up arion project as systemd service (serviceName=heather) Architecture: Caddy (host) terminates TLS, routes to host services (syncthing) and docker containers (arion, 127.0.0.1:PORT). Named volumes everywhere except silverbullet (bind /srv/syncthing/herbarium).
80 lines
No EOL
2.2 KiB
Nix
80 lines
No EOL
2.2 KiB
Nix
{
|
|
description = "nix-config — multi-host Nix configurations";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
|
|
nix-darwin = {
|
|
url = "github:LnL7/nix-darwin";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
sops-nix = {
|
|
url = "github:Mic92/sops-nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
arion = {
|
|
url = "github:hercules-ci/arion";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
outputs =
|
|
{ self, nixpkgs, nix-darwin, home-manager, sops-nix, arion, ... }:
|
|
let
|
|
mkNixos = hostname:
|
|
nixpkgs.lib.nixosSystem {
|
|
system = "x86_64-linux";
|
|
modules = [
|
|
./hosts/common
|
|
./hosts/${hostname}
|
|
sops-nix.nixosModules.sops
|
|
home-manager.nixosModules.home-manager
|
|
arion.nixosModules.arion
|
|
{
|
|
home-manager = {
|
|
useGlobalPkgs = true;
|
|
useUserPackages = true;
|
|
backupFileExtension = "backup";
|
|
# Серверные хосты используют минимульный home (headless).
|
|
# Десктоп-хосты (если появятся) могут переопределить users.mikl.
|
|
users.mikl = import ./home/server.nix;
|
|
};
|
|
}
|
|
];
|
|
};
|
|
|
|
mkDarwin = hostname:
|
|
nix-darwin.lib.darwinSystem {
|
|
system = "aarch64-darwin";
|
|
modules = [
|
|
./hosts/${hostname}
|
|
home-manager.darwinModules.home-manager
|
|
{
|
|
home-manager = {
|
|
useGlobalPkgs = true;
|
|
useUserPackages = true;
|
|
backupFileExtension = "backup";
|
|
users.mikl = import ./home;
|
|
};
|
|
}
|
|
];
|
|
};
|
|
in
|
|
{
|
|
nixosConfigurations = {
|
|
heather = mkNixos "heather";
|
|
# rosemary = mkNixos "rosemary"; # TODO: будущий EU сервер (не YC)
|
|
};
|
|
|
|
darwinConfigurations = {
|
|
poppy = mkDarwin "poppy";
|
|
};
|
|
};
|
|
} |