mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-23 01:49:08 +01:00
Compare commits
No commits in common. "7a429c5177440a38b79433a89e460df79b37a980" and "7fd21d8cde2afb0ddf0da4d702a9be825fea7508" have entirely different histories.
7a429c5177
...
7fd21d8cde
7 changed files with 62 additions and 34 deletions
17
flake.lock
generated
17
flake.lock
generated
|
|
@ -16,6 +16,22 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"blocklist": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1773514984,
|
||||||
|
"narHash": "sha256-c6qB3i3wetKEp/uD+dR51v9Izbshhy+ECqi2K+1HSoc=",
|
||||||
|
"owner": "StevenBlack",
|
||||||
|
"repo": "hosts",
|
||||||
|
"rev": "24b12bd67d953a1afbfed3ae85c080b033b47c36",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "StevenBlack",
|
||||||
|
"repo": "hosts",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"comin": {
|
"comin": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat",
|
||||||
|
|
@ -353,6 +369,7 @@
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"betterfox": "betterfox",
|
"betterfox": "betterfox",
|
||||||
|
"blocklist": "blocklist",
|
||||||
"comin": "comin",
|
"comin": "comin",
|
||||||
"disko": "disko",
|
"disko": "disko",
|
||||||
"dns": "dns",
|
"dns": "dns",
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,11 @@
|
||||||
url = "github:iBigQ/radicale-birthday-calendar";
|
url = "github:iBigQ/radicale-birthday-calendar";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
blocklist = {
|
||||||
|
url = "github:StevenBlack/hosts";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,40 @@
|
||||||
{ config, lib, ... }:
|
|
||||||
{
|
{
|
||||||
options.custom.networking.hostName = lib.mkOption {
|
config,
|
||||||
type = lib.types.nonEmptyStr;
|
lib,
|
||||||
default = config.networking.hostName;
|
allHosts,
|
||||||
readOnly = true;
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
cfg = config.custom.networking;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.custom.networking = {
|
||||||
|
hostName = lib.mkOption {
|
||||||
|
type = lib.types.nonEmptyStr;
|
||||||
|
default = config.networking.hostName;
|
||||||
|
readOnly = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
nodes = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.attrs;
|
||||||
|
default =
|
||||||
|
allHosts
|
||||||
|
|> lib.attrValues
|
||||||
|
|> lib.map (host: host.config.custom.networking)
|
||||||
|
|> lib.map (
|
||||||
|
node:
|
||||||
|
lib.removeAttrs node [
|
||||||
|
"nodes"
|
||||||
|
"peers"
|
||||||
|
]
|
||||||
|
);
|
||||||
|
readOnly = true;
|
||||||
|
};
|
||||||
|
peers = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.attrs;
|
||||||
|
default = cfg.nodes |> lib.filter (node: node.hostName != cfg.hostName);
|
||||||
|
readOnly = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
|
|
||||||
|
|
@ -33,9 +33,7 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
nodeRecords =
|
nodeRecords =
|
||||||
allHosts
|
netCfg.nodes
|
||||||
|> lib.attrValues
|
|
||||||
|> lib.map (host: host.config.custom.networking)
|
|
||||||
|> lib.map (node: {
|
|> lib.map (node: {
|
||||||
name = node.hostName;
|
name = node.hostName;
|
||||||
inherit (node.overlay) address;
|
inherit (node.overlay) address;
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,7 @@ let
|
||||||
netCfg = config.custom.networking;
|
netCfg = config.custom.networking;
|
||||||
|
|
||||||
lighthouses =
|
lighthouses =
|
||||||
allHosts
|
netCfg.peers
|
||||||
|> lib.attrValues
|
|
||||||
|> lib.map (host: host.config.custom.networking)
|
|
||||||
|> lib.filter (node: node.hostName != netCfg.hostName)
|
|
||||||
|> lib.filter (peer: peer.overlay.isLighthouse)
|
|> lib.filter (peer: peer.overlay.isLighthouse)
|
||||||
|> lib.map (lighthouse: lighthouse.overlay.address);
|
|> lib.map (lighthouse: lighthouse.overlay.address);
|
||||||
in
|
in
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,4 @@
|
||||||
{
|
{ config, lib, ... }:
|
||||||
config,
|
|
||||||
self,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
let
|
||||||
cfg = config.custom.web-services.scrutiny;
|
cfg = config.custom.web-services.scrutiny;
|
||||||
in
|
in
|
||||||
|
|
@ -21,11 +16,6 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
assertions = lib.singleton {
|
|
||||||
assertion = self.lib.isPrivateDomain cfg.domain;
|
|
||||||
message = self.lib.mkUnprotectedMessage "Scrutiny";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.scrutiny = {
|
services.scrutiny = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings.web.listen = {
|
settings.web.listen = {
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,4 @@
|
||||||
{
|
{ config, lib, ... }:
|
||||||
config,
|
|
||||||
self,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
let
|
||||||
cfg = config.custom.web-services.searxng;
|
cfg = config.custom.web-services.searxng;
|
||||||
in
|
in
|
||||||
|
|
@ -21,11 +16,6 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
assertions = lib.singleton {
|
|
||||||
assertion = self.lib.isPrivateDomain cfg.domain;
|
|
||||||
message = self.lib.mkUnprotectedMessage "SearXNG";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.searx = {
|
services.searx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue