mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 14:19:08 +01:00
Compare commits
3 commits
7fd21d8cde
...
7a429c5177
| Author | SHA1 | Date | |
|---|---|---|---|
| 7a429c5177 | |||
| 253c897a5f | |||
| 25e81ccc80 |
7 changed files with 34 additions and 62 deletions
17
flake.lock
generated
17
flake.lock
generated
|
|
@ -16,22 +16,6 @@
|
|||
"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": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
|
|
@ -369,7 +353,6 @@
|
|||
"root": {
|
||||
"inputs": {
|
||||
"betterfox": "betterfox",
|
||||
"blocklist": "blocklist",
|
||||
"comin": "comin",
|
||||
"disko": "disko",
|
||||
"dns": "dns",
|
||||
|
|
|
|||
|
|
@ -80,11 +80,6 @@
|
|||
url = "github:iBigQ/radicale-birthday-calendar";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
blocklist = {
|
||||
url = "github:StevenBlack/hosts";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
|
||||
outputs =
|
||||
|
|
|
|||
|
|
@ -1,40 +1,9 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
allHosts,
|
||||
...
|
||||
}:
|
||||
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;
|
||||
};
|
||||
options.custom.networking.hostName = lib.mkOption {
|
||||
type = lib.types.nonEmptyStr;
|
||||
default = config.networking.hostName;
|
||||
readOnly = true;
|
||||
};
|
||||
|
||||
config = {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,9 @@ let
|
|||
};
|
||||
|
||||
nodeRecords =
|
||||
netCfg.nodes
|
||||
allHosts
|
||||
|> lib.attrValues
|
||||
|> lib.map (host: host.config.custom.networking)
|
||||
|> lib.map (node: {
|
||||
name = node.hostName;
|
||||
inherit (node.overlay) address;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,10 @@ let
|
|||
netCfg = config.custom.networking;
|
||||
|
||||
lighthouses =
|
||||
netCfg.peers
|
||||
allHosts
|
||||
|> lib.attrValues
|
||||
|> lib.map (host: host.config.custom.networking)
|
||||
|> lib.filter (node: node.hostName != netCfg.hostName)
|
||||
|> lib.filter (peer: peer.overlay.isLighthouse)
|
||||
|> lib.map (lighthouse: lighthouse.overlay.address);
|
||||
in
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
config,
|
||||
self,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.custom.web-services.scrutiny;
|
||||
in
|
||||
|
|
@ -16,6 +21,11 @@ in
|
|||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = lib.singleton {
|
||||
assertion = self.lib.isPrivateDomain cfg.domain;
|
||||
message = self.lib.mkUnprotectedMessage "Scrutiny";
|
||||
};
|
||||
|
||||
services.scrutiny = {
|
||||
enable = true;
|
||||
settings.web.listen = {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
config,
|
||||
self,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.custom.web-services.searxng;
|
||||
in
|
||||
|
|
@ -16,6 +21,11 @@ in
|
|||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = lib.singleton {
|
||||
assertion = self.lib.isPrivateDomain cfg.domain;
|
||||
message = self.lib.mkUnprotectedMessage "SearXNG";
|
||||
};
|
||||
|
||||
services.searx = {
|
||||
enable = true;
|
||||
settings = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue