feat[server]: add dns server

This commit is contained in:
Leon Schwarzäugl 2025-11-25 19:49:58 +01:00 committed by Leon Schwarzäugl
parent a8f29d26c6
commit 00340a9c01
22 changed files with 478 additions and 38 deletions

View file

@ -114,13 +114,31 @@ in
services = mkOption {
type = types.attrsOf (
types.submodule {
types.submodule (serviceSubmod: {
options = {
domain = mkOption {
type = types.str;
};
subDomain = mkOption {
readOnly = true;
type = types.str;
default = lib.swarselsystems.getSubDomain serviceSubmod.config.domain;
};
baseDomain = mkOption {
readOnly = true;
type = types.str;
default = lib.swarselsystems.getBaseDomain serviceSubmod.config.domain;
};
proxyAddress4 = mkOption {
type = types.nullOr types.str;
default = null;
};
proxyAddress6 = mkOption {
type = types.nullOr types.str;
default = null;
};
};
}
})
);
};
@ -163,6 +181,12 @@ in
defaultGateway6 = mkOption {
type = types.nullOr types.net.ipv6;
};
wanAddress4 = mkOption {
type = types.nullOr types.net.ipv4;
};
wanAddress6 = mkOption {
type = types.nullOr types.net.ipv6;
};
};
}
);

View file

@ -12,7 +12,6 @@
inputs.nix-index-database.homeModules.nix-index
inputs.sops-nix.homeManagerModules.sops
inputs.spicetify-nix.homeManagerModules.default
# inputs.swarsel-modules.homeModules.default
inputs.swarsel-nix.homeModules.default
{
imports = [

View file

@ -72,6 +72,7 @@ in
hideMounts = true;
directories =
[
"/root/.dotfiles"
"/etc/nix"
"/etc/NetworkManager/system-connections"
"/var/lib/nixos"

View file

@ -1,5 +1,6 @@
{ self, lib, pkgs, config, outputs, inputs, minimal, ... }:
let
inherit (config.swarselsystems) mainUser;
settings = if minimal then { } else {
environment.etc."nixos/configuration.nix".source = pkgs.writeText "configuration.nix" ''
assert builtins.trace "This location is not used. The config is found in ${config.swarselsystems.flakePath}!" false;
@ -36,7 +37,8 @@ let
channel.enable = false;
registry = rec {
nixpkgs.flake = inputs.nixpkgs;
swarsel.flake = inputs.swarsel;
# swarsel.flake = inputs.swarsel;
swarsel.flake = self;
n = nixpkgs;
s = swarsel;
};
@ -57,7 +59,7 @@ in
(lib.recursiveUpdate
{
sops.secrets.github-api-token = lib.mkIf (!minimal) {
sopsFile = "${config.swarselsystems.flakePath}/secrets/general/secrets.yaml";
owner = mainUser;
};
nix =

View file

@ -1,11 +1,8 @@
{ self, pkgs, config, lib, globals, minimal, ... }:
let
sopsFile = self + /secrets/general/secrets.yaml;
in
{ pkgs, config, lib, globals, minimal, ... }:
{
options.swarselmodules.users = lib.mkEnableOption "user config";
config = lib.mkIf config.swarselmodules.users {
sops.secrets.main-user-hashed-pw = lib.mkIf (!config.swarselsystems.isPublic) { inherit sopsFile; neededForUsers = true; };
sops.secrets.main-user-hashed-pw = lib.mkIf (!config.swarselsystems.isPublic) { neededForUsers = true; };
users = {
mutableUsers = lib.mkIf (!minimal) false;