Compare commits

..

61 Commits

Author SHA1 Message Date
bot
38350b91e1 Merge pull request 'Lock file maintenance' (#272) from renovate/lock-file-maintenance into main 2026-05-03 04:05:59 +02:00
Renovate Bot
142d842886 Lock file maintenance 2026-05-03 02:05:52 +00:00
soraefir
c9e59a9a89 fix missing arg 2026-05-03 02:24:11 +02:00
soraefir
b1afbf6bbe missing lib 2026-05-03 02:23:41 +02:00
soraefir
4c2f368da3 fix sops 2026-05-03 02:23:16 +02:00
soraefir
9377d1ce45 Better Server cfg 2026-05-03 02:20:41 +02:00
soraefir
d3a3941591 keepalive 2026-05-03 01:47:38 +02:00
soraefir
b1bbb3ce86 SSH fix 2026-05-03 01:25:22 +02:00
soraefir
d8be8b72ab Fix ssh 2026-05-02 22:05:58 +02:00
soraefir
59709bcde9 Fix ssh 2026-05-02 21:40:06 +02:00
soraefir
b0f5ef7439 Fix Ssh 2026-05-02 21:39:40 +02:00
soraefir
301d8d1ea6 fixx 2026-05-02 21:12:43 +02:00
soraefir
5aa041ba27 ssh fix 2026-05-02 21:11:57 +02:00
soraefir
d2e35d3673 Fix ssh 2026-05-02 21:00:05 +02:00
soraefir
0baf9c1800 Fix SSH 2026-05-02 20:49:35 +02:00
soraefir
a7edc932a8 Fix VPS 2026-05-02 19:25:11 +02:00
soraefir
ae82eaa500 Fix 2026-05-02 10:32:08 +02:00
soraefir
e24e96f091 Fix VPS 2026-05-02 10:30:52 +02:00
soraefir
b42579f8cd Fix 2026-05-02 10:29:56 +02:00
soraefir
0192a1ace0 Fix boot 2026-05-02 10:29:21 +02:00
soraefir
dcc5c440f7 fix avalon 2026-05-02 10:12:36 +02:00
soraefir
1ceb440026 fix 2026-05-02 09:51:08 +02:00
bot
25b2e3e05f Merge pull request 'Lock file maintenance' (#271) from renovate/lock-file-maintenance into main 2026-05-02 04:03:53 +02:00
Renovate Bot
c823dbab4d Lock file maintenance 2026-05-02 02:03:51 +00:00
soraefir
32bbe70e2e fix 2026-05-02 00:26:53 +02:00
soraefir
1248c258df fix 2026-05-02 00:25:47 +02:00
soraefir
f852ed7662 Fix 2026-05-02 00:21:57 +02:00
soraefir
4729a82990 pkgs 2026-05-02 00:20:50 +02:00
soraefir
c9ebc6e512 wg sops 2026-05-02 00:20:20 +02:00
soraefir
d68c26a4eb test 2026-05-02 00:04:02 +02:00
soraefir
7b3d80c86e Fixing 2026-05-01 23:57:01 +02:00
soraefir
f98fee7988 wg fix 2026-05-01 23:52:10 +02:00
soraefir
401bb84bb0 temp ssh 2026-05-01 23:33:08 +02:00
soraefir
39ea963b7c Fix 2026-05-01 23:29:54 +02:00
soraefir
7cbb8ffae2 Fix 2026-05-01 23:26:23 +02:00
soraefir
9d9e99e462 fix 2026-05-01 23:22:21 +02:00
soraefir
3f5d05e076 Sops 2026-05-01 23:17:43 +02:00
soraefir
c1670a406c sops 2026-05-01 23:13:34 +02:00
soraefir
76b77b532c Boot 2026-05-01 23:03:39 +02:00
soraefir
16add98b0d boot fix 2026-05-01 22:57:34 +02:00
soraefir
f764e681c0 Gateway Boot 2026-05-01 22:49:06 +02:00
soraefir
f3c8020a85 Force 2026-05-01 22:40:19 +02:00
soraefir
376ac4a229 no bootloader on vps 2026-05-01 22:39:11 +02:00
soraefir
d4e599bd9b Fixes 2026-05-01 22:01:54 +02:00
soraefir
edc764461c Fix asguard name 2026-05-01 21:32:27 +02:00
soraefir
cf9c7f8b80 Fix 2026-05-01 18:55:03 +02:00
soraefir
0cdd18bec7 Fix 2026-05-01 18:53:18 +02:00
soraefir
5cbf1e8555 fix forwading 2026-05-01 18:51:45 +02:00
soraefir
735a9e2e0e Fix 2026-05-01 18:46:55 +02:00
soraefir
eba7f7bd74 fix 2026-05-01 18:46:22 +02:00
soraefir
beb6ef1b05 Fix 2026-05-01 18:44:33 +02:00
soraefir
e519f5c03c Fix sops 2026-05-01 18:43:49 +02:00
soraefir
d55fd5fc0e Fix sops 2026-05-01 18:42:47 +02:00
soraefir
b31f6cd331 Fix sops for wg peers 2026-05-01 18:38:13 +02:00
soraefir
9b0fc14795 Cleaner forwarding 2026-05-01 17:57:06 +02:00
soraefir
32c83bca98 Fix cfg 2026-05-01 17:48:43 +02:00
soraefir
a7ce1dc7ea Migrate gateway 2026-05-01 17:43:01 +02:00
bot
60bf451310 Merge pull request 'Lock file maintenance' (#270) from renovate/lock-file-maintenance into main 2026-04-26 04:04:29 +02:00
Renovate Bot
7f6e5879aa Lock file maintenance 2026-04-26 02:04:26 +00:00
bot
3fd400062d Merge pull request 'Lock file maintenance' (#269) from renovate/lock-file-maintenance into main 2026-04-25 04:16:05 +02:00
Renovate Bot
637297130f Lock file maintenance 2026-04-25 02:15:51 +00:00
25 changed files with 385 additions and 257 deletions

View File

@@ -9,55 +9,56 @@ keys:
- &avalon age1sxzuhh2fcd4pmaz4mdqq95t683d32ft22w9t2r7pk258u0s8wymsqdj7lg
- &valinor age1sxzuhh2fcd4pmaz4mdqq95t683d32ft22w9t2r7pk258u0s8wymsqdj7lg
- &asgard age1sxzuhh2fcd4pmaz4mdqq95t683d32ft22w9t2r7pk258u0s8wymsqdj7lg
- &gateway age1lqvnzlendlmtwgstzrj4xzrwpatwx56k5az5au78fyg99yecwfzs3s6xn6
creation_rules:
- path_regex: modules/shared/sops/private/iriy.[a-z]+
key_groups:
- age:
- *iriy
pgp:
- *sora
- age:
- *iriy
pgp:
- *sora
- path_regex: modules/shared/sops/private/avalon.[a-z]+
key_groups:
- age:
- *avalon
pgp:
- *sora
- age:
- *avalon
pgp:
- *sora
- path_regex: modules/shared/sops/private/valinor.[a-z]+
key_groups:
- age:
- *valinor
pgp:
- *sora
- age:
- *valinor
pgp:
- *sora
- path_regex: modules/shared/sops/private/asgard.[a-z]+
key_groups:
- age:
- *asgard
pgp:
- *sora
- age:
- *asgard
pgp:
- *sora
- path_regex: modules/shared/sops/common.[a-z]+
key_groups:
- age:
- *valinor
- *iriy
- *avalon
- *asgard
pgp:
- *sora
- age:
- *valinor
- *iriy
- *avalon
- *asgard
- *gateway
pgp:
- *sora
- path_regex: modules/shared/sops/mock.[a-z]+
key_groups:
- age:
- *ci
- age:
- *ci
- path_regex: modules/server/sops/server.[a-z]+
key_groups:
- age:
- *valinor
- *iriy
- *avalon
- *asgard
pgp:
- *sora
- age:
- *valinor
- *iriy
- *avalon
- *asgard
pgp:
- *sora

42
flake.lock generated
View File

@@ -103,11 +103,11 @@
},
"hardware": {
"locked": {
"lastModified": 1775490113,
"narHash": "sha256-2ZBhDNZZwYkRmefK5XLOusCJHnoeKkoN95hoSGgMxWM=",
"lastModified": 1776983936,
"narHash": "sha256-ZOQyNqSvJ8UdrrqU1p7vaFcdL53idK+LOM8oRWEWh6o=",
"owner": "nixos",
"repo": "nixos-hardware",
"rev": "c775c2772ba56e906cbeb4e0b2db19079ef11ff7",
"rev": "2096f3f411ce46e88a79ae4eafcfc9df8ed41c61",
"type": "github"
},
"original": {
@@ -139,11 +139,11 @@
]
},
"locked": {
"lastModified": 1775425411,
"narHash": "sha256-KY6HsebJHEe5nHOWP7ur09mb0drGxYSzE3rQxy62rJo=",
"lastModified": 1777771528,
"narHash": "sha256-YycygK6n7KeW1YCobdFJcORWzkmrvNcp6xT+IovA0d4=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "0d02ec1d0a05f88ef9e74b516842900c41f0f2fe",
"rev": "0585fbf645640973e3398863bbaf3bd1ddce4a51",
"type": "github"
},
"original": {
@@ -174,11 +174,11 @@
},
"nixUnstable": {
"locked": {
"lastModified": 1776329215,
"narHash": "sha256-a8BYi3mzoJ/AcJP8UldOx8emoPRLeWqALZWu4ZvjPXw=",
"lastModified": 1777641297,
"narHash": "sha256-WNGcmeOZ8Tr9dq6ztCspYbzWFswr2mPebM9LpsfGxPk=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "b86751bc4085f48661017fa226dee99fab6c651b",
"rev": "c6d65881c5624c9cae5ea6cedef24699b0c0a4c0",
"type": "github"
},
"original": {
@@ -190,11 +190,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1776434932,
"narHash": "sha256-gyqXNMgk3sh+ogY5svd2eNLJ6oEwzbAeaoBrrxD0lKk=",
"lastModified": 1777428379,
"narHash": "sha256-ypxFOeDz+CqADEQNL72haqGjvZQdBR5Vc7pyx2JDttI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "c7f47036d3df2add644c46d712d14262b7d86c0c",
"rev": "755f5aa91337890c432639c60b6064bb7fe67769",
"type": "github"
},
"original": {
@@ -221,11 +221,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1776169885,
"narHash": "sha256-l/iNYDZ4bGOAFQY2q8y5OAfBBtrDAaPuRQqWaFHVRXM=",
"lastModified": 1777578337,
"narHash": "sha256-Ad49moKWeXtKBJNy2ebiTQUEgdLyvGmTeykAQ9xM+Z4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "4bd9165a9165d7b5e33ae57f3eecbcb28fb231c9",
"rev": "15f4ee454b1dce334612fa6843b3e05cf546efab",
"type": "github"
},
"original": {
@@ -241,11 +241,11 @@
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1776563799,
"narHash": "sha256-BKc5W+iiKzBKuIIc9CLOjo8TTp6VkE9fzE9ze2KBpMs=",
"lastModified": 1777763626,
"narHash": "sha256-UFwZDbdMezNnxZwikhDR4EWiCPUiEmPXHmqLOrcG34g=",
"owner": "nix-community",
"repo": "nur",
"rev": "4bd9c7786f7975f90d34b46af4741fb85e38bcab",
"rev": "3873764e5896bd6da6cf0df17172849ea51ac5eb",
"type": "github"
},
"original": {
@@ -274,11 +274,11 @@
]
},
"locked": {
"lastModified": 1776119890,
"narHash": "sha256-Zm6bxLNnEOYuS/SzrAGsYuXSwk3cbkRQZY0fJnk8a5M=",
"lastModified": 1777338324,
"narHash": "sha256-bc+ZZCmOTNq86/svGnw0tVpH7vJaLYvGLLKFYP08Q8E=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "d4971dd58c6627bfee52a1ad4237637c0a2fb0cd",
"rev": "8eaee5c45428b28b8c47a83e4c09dccec5f279b5",
"type": "github"
},
"original": {

View File

@@ -44,6 +44,7 @@
avalon = gen.generate { host = "avalon"; };
ci = gen.generate { host = "ci"; };
sandbox = gen.generate { host = "sandbox"; };
gateway = gen.generate { host = "gateway"; };
};
darwinConfigurations = { asgard = gen.generate { host = "asgard"; }; };
homeConfigurations = {

View File

@@ -19,64 +19,5 @@
"wago_addons": null
}
}'';
# curse:master-plan
# curse:raretrackercore-rt
# curse:raretrackerdragonflight-rtd
# curse:raretrackermaw-rtmw
# curse:raretrackermechagon-rtm
# curse:raretrackerthewarwithin-rtww
# curse:raretrackertimelessisle-rtti
# curse:raretrackeruldum-rtu
# curse:raretrackervale-rtv
# curse:raretrackerworldbosses-rtwb
# curse:raretrackerzerethmortis-rtz
# curse:venture-plan
# curse:war-plan
# github:nevcairiel/bartender4
# github:cidan/betterbags
# github:bigwigsmods/bigwigs
# github:bigwigsmods/bigwigs_battleforazeroth
# github:bigwigsmods/bigwigs_burningcrusade
# github:bigwigsmods/bigwigs_cataclysm
# github:bigwigsmods/bigwigs_classic
# github:bigwigsmods/bigwigs_dragonflight
# github:bigwigsmods/bigwigs_legion
# github:bigwigsmods/bigwigs_mistsofpandaria
# github:bigwigsmods/bigwigs_shadowlands
# github:bigwigsmods/bigwigs_warlordsofdraenor
# github:bigwigsmods/bigwigs_wrathofthelichking
# github:nezroy/demodal
# github:curseforge-mirror/details
# github:edusperoni/details_elitism
# github:curseforge-mirror/elitismhelper
# github:michaelnpsp/grid2
# github:jods-gh/groupfinderrio
# github:nevcairiel/handynotes
# github:hekili/hekili
# github:thekrowi/krowi_achievementfilter
# github:bigwigsmods/littlewigs
# github:nnoggie/mythicdungeontools
# github:tullamods/omnicc
# github:tercioo/plater-nameplates
# github:curseforge-mirror/quest_completist
# github:raiderio/raiderio-addon
# github:wowrarity/rarity
# github:nevcairiel/shadowedunitframes
# github:simulationcraft/simc-addon
# github:curseforge-mirror/tomcats
# github:weakauras/weakauras2
# github:kemayo/wow-handynotes-battleforazerothtreasures
# github:kemayo/wow-handynotes-dragonflight
# github:kemayo/wow-handynotes-legiontreasures
# github:kemayo/wow-handynotes-longforgottenhippogryph
# github:kemayo/wow-handynotes-lostandfound
# github:kemayo/wow-handynotes-secretfish
# github:kemayo/wow-handynotes-shadowlandstreasures
# github:kemayo/wow-handynotes-stygia
# github:kemayo/wow-handynotes-treasurehunter
# github:kemayo/wow-handynotes-warwithin
# wowi:7032-tomtom
};
}

View File

@@ -9,7 +9,7 @@ in {
};
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot/efi";
efiSysMountPoint = "/boot";
};
};
};

View File

@@ -1,4 +1,12 @@
{ config, lib, ... }: {
{ config, lib, pkgs, ... }: let
isValidPeer = p:
(p ? syscfg.net.wg.enable) &&
(p.syscfg.net.wg.enable == true) &&
(p.syscfg.net.wg.pubkey != config.syscfg.net.wg.pubkey);
activePeers = builtins.filter isValidPeer config.syscfg.peers;
in
{
config = lib.mkIf (config.syscfg.net.wg.enable) {
networking.wireguard = {
enable = true;
@@ -9,12 +17,20 @@
config.sops.secrets."${config.syscfg.hostname}_wg_priv".path;
listenPort = 1515;
mtu = 1340;
peers = [{
allowedIPs = [ "10.10.1.0/24" "fd10:10:10::0/64" ];
endpoint = "vpn.helcel.net:1515";
publicKey = "NFBJvYXZC+bd62jhrKnM7/pugidWhgR6+C5qIiUiq3Q=";
persistentKeepalive = 30;
}];
peers =
if config.syscfg.server ? wireguard then
map (p: {
name = p.syscfg.hostname;
publicKey = p.syscfg.net.wg.pubkey;
allowedIPs = [ p.syscfg.net.wg.ip4 p.syscfg.net.wg.ip6 ];
}) activePeers
else
[{
allowedIPs = [ "10.10.1.0/24" "fd10:10:10::0/64" ];
endpoint = "vpn.helcel.net:1515";
publicKey = "NFBJvYXZC+bd62jhrKnM7/pugidWhgR6+C5qIiUiq3Q=";
persistentKeepalive = 30;
}];
};
};
};

View File

@@ -0,0 +1,13 @@
{ config, pkgs, lib, ... }:{
config = lib.mkIf (config.syscfg.server ? arion) {
environment.systemPackages = with pkgs; [ arion ];
virtualisation.arion = {
backend = "podman-socket";
projects = {
cloud.settings = import ./docker/cloud.nix { inherit config pkgs lib; };
authentik.settings =
import ./docker/authentik.nix { inherit config pkgs lib; };
};
};
};
}

View File

@@ -1,15 +1,3 @@
{ config, pkgs, lib, ... }:
let
in {
imports = [ ./sops ];
environment.systemPackages = with pkgs; [ arion ];
virtualisation.arion = {
backend = "podman-socket";
projects = {
cloud.settings = import ./docker/cloud.nix { inherit config pkgs lib; };
authentik.settings =
import ./docker/authentik.nix { inherit config pkgs lib; };
};
};
{ config, pkgs, lib, ... }:{
imports = [ ./sops ./nftables ./openssh ./arion ];
}

View File

@@ -0,0 +1,40 @@
{ config, lib, ... }:{
config = lib.mkIf (config.syscfg.server.nftables.enable) {
boot.kernel.sysctl = {
"net.ipv4.ip_forward" = 1;
"net.ipv6.conf.all.forwarding" = 1;
};
networking.nftables.enable = true;
networking.nftables.ruleset = ''
table inet nat {
chain prerouting {
type nat hook prerouting priority dstnat; policy accept;
${lib.concatMapStringsSep "\n" (rule:
let
srcInt = builtins.elemAt rule 0;
dstAddr4 = builtins.elemAt rule 1;
dstAddr6 = builtins.elemAt rule 2;
srcPort = toString (builtins.elemAt rule 3);
dstPort = toString (builtins.elemAt rule 4);
in ''
iifname "${srcInt}" tcp dport ${srcPort} counter dnat ip to ${dstAddr4}:${dstPort}
iifname "${srcInt}" udp dport ${srcPort} counter dnat ip to ${dstAddr4}:${dstPort}
iifname "${srcInt}" tcp dport ${srcPort} counter dnat ip6 to [${dstAddr6}]:${dstPort}
iifname "${srcInt}" udp dport ${srcPort} counter dnat ip6 to [${dstAddr6}]:${dstPort}
''
) config.syscfg.server.nftables.ports}
}
chain postrouting {
type nat hook postrouting priority srcnat; policy accept;
oifname { ${lib.concatMapStringsSep ", " (iface: ''"${iface}"'') config.syscfg.server.nftables.ifs} } masquerade
}
}
'';
};
}

View File

@@ -0,0 +1,27 @@
{ config, lib, ... }:
let
allUsers = lib.concatMap (peer: if peer.syscfg ? users then peer.syscfg.users else []) config.syscfg.peers;
groupedUsers = lib.groupBy (u: u.username) allUsers;
allowedUsernames = map (u: u.username) config.syscfg.users;
activeUsers = lib.filterAttrs (name: _: lib.elem name allowedUsernames) groupedUsers;
in {
config = lib.mkIf (config.syscfg.server.nftables.enable) {
services.openssh = {
enable = true;
ports = [ 422 ];
banner = "";
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";
ClientAliveInterval = 60;
ClientAliveCountMax = 3;
TCPKeepAlive = true;
};
};
users.users = lib.mapAttrs (name: userList: {
openssh.authorizedKeys.keys = lib.unique (
lib.concatMap (u: if u ? pubssh then [ u.pubssh ] else []) userList
);
}) activeUsers;
};
}

View File

@@ -1,20 +1,5 @@
{ config, pkgs, ... }: {
sops.secrets.INFOMANIAK_API_KEY = { sopsFile = ./server.yaml; };
sops.secrets."${config.syscfg.hostname}_ssh_pub" = {
mode = "0400";
owner = config.users.users.${config.syscfg.defaultUser}.name;
group = config.users.users.${config.syscfg.defaultUser}.group;
{ config, lib, pkgs, ... }: {
config = lib.mkIf (config.syscfg.server ? sops) {
sops.secrets.INFOMANIAK_API_KEY = { sopsFile = ./server.yaml; };
};
sops.secrets."iriy_ssh_pub" = {
mode = "0444";
owner = config.users.users.${config.syscfg.defaultUser}.name;
group = config.users.users.${config.syscfg.defaultUser}.group;
};
sops.secrets."valinor_ssh_pub" = {
mode = "0444";
owner = config.users.users.${config.syscfg.defaultUser}.name;
group = config.users.users.${config.syscfg.defaultUser}.group;
};
sops.secrets."${config.syscfg.hostname}_wg_priv" = { };
sops.secrets."${config.syscfg.hostname}_wg_pub" = { };
}

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ config, lib, pkgs, ... }:
let
isCI = builtins.elem config.syscfg.hostname [ "ci" "sandbox" ];
keyFilePath = (if isCI then
@@ -14,19 +14,15 @@ in {
sops.age.keyFile = keyFilePath;
sops.age.generateKey = true;
sops.secrets.wifi = { };
sops.secrets."${config.syscfg.hostname}_ssh_priv" = {
mode = "0400";
owner = config.users.users.${config.syscfg.defaultUser}.name;
group = config.users.users.${config.syscfg.defaultUser}.group;
};
sops.secrets."${config.syscfg.hostname}_ssh_pub" = {
mode = "0444";
owner = config.users.users.${config.syscfg.defaultUser}.name;
group = config.users.users.${config.syscfg.defaultUser}.group;
};
sops.secrets."${config.syscfg.hostname}_wg_priv" = { };
sops.secrets."${config.syscfg.hostname}_wg_pub" = { };
sops.secrets = lib.mkMerge [
{
wifi = { };
"${config.syscfg.hostname}_ssh_priv" = {
mode = "0400";
owner = config.users.users.${config.syscfg.defaultUser}.name;
group = config.users.users.${config.syscfg.defaultUser}.group;
};
"${config.syscfg.hostname}_wg_priv" = { };
}
];
}

View File

@@ -1,7 +1,13 @@
{ inputs, lib, ... }:
let
systemsDir = ../../../systems;
systemNames = lib.attrNames (lib.filterAttrs
(name: type: type == "directory" && builtins.pathExists (systemsDir + "/${name}/cfg.nix"))
(builtins.readDir systemsDir));
userOpt = with lib; {
username = mkOption { type = types.str; };
pubssh = mkOption { type = types.str; default=""; };
wm = mkOption {
type = types.enum [ "Wayland" "X11" "-" ];
default = "-";
@@ -42,6 +48,10 @@ let
type = types.str;
default = "";
};
pubkey = mkOption {
type = types.str;
default = "";
};
};
};
makeOpt = with lib; {
@@ -55,7 +65,7 @@ let
};
virt = mkOption {
type = types.bool;
default = true;
default = false;
};
power = mkOption {
type = types.bool;
@@ -84,7 +94,6 @@ let
type = types.str;
default = "3306";
};
configPath = mkOption {
type = types.str;
default = "/media/config";
@@ -93,6 +102,42 @@ let
type = types.str;
default = "/media/data";
};
arion = mkOption {
type = type.bool;
default = false;
};
sops = mkOption {
type = type.bool;
default = false;
};
openssh = mkOption {
type = type.bool;
default = false;
};
wireguard = mkOption {
type = type.bool;
default = false;
};
nftables = {
enable = mkOption {
type = type.bool;
default = false;
};
ifs = mkOption {
type = types.listOf types.str;
default = [ ];
};
ports = mkOption {
type = types.listOf (types.listOf (types.oneOf [ types.str types.int ]));
default = [];
description = "Forwarding rules: [ [srcInterface dstAddr srcPort dstPort] ... ]";
example = [
[ "ens3" "10.10.1.2" "IPV6" 22 2222 ]
[ "ens3" "10.10.1.2" "IPV6" 80 80 ]
[ "ens3" "10.10.1.2" "IPV6" 443 443 ]
];
};
};
};
in with lib; {
@@ -114,6 +159,9 @@ in with lib; {
type = types.listOf (types.submodule { options = userOpt; });
default = [ ];
};
peers = mkOption {
default = map (name: import (systemsDir + "/${name}/cfg.nix")) systemNames;
};
server = mkOption {
type = types.oneOf [
(types.attrs)

View File

@@ -1,6 +1,6 @@
{
syscfg = {
hostname = "asguard";
hostname = "asgard";
defaultUser = "sora";
type = "macos";
system = "x86_64-darwin";

View File

@@ -23,21 +23,16 @@
}
];
make = {
gui = false;
cli = true;
virt = true;
power = false;
game = false;
develop = false;
};
wlp = {
enable = false;
nif = "";
};
wg = {
enable = true;
ip4 = "10.10.1.2/32";
ip6 = "fd10:10:10::2/128";
net = {
wg = {
enable = true;
ip4 = "10.10.1.2/32";
ip6 = "fd10:10:10::2/128";
pubkey = "QlvpTiK6s/lIha9vKmo+teSy2Nw52qWLYatYjxVan3U=";
};
};
};
}

View File

@@ -0,0 +1,14 @@
AUTHENTIK_DB_PASSWORD=NTQRO0rhPCd4L3HLNK4AT09Npz+ks1jyRC6AOyo5u+k=
AUTHENTIK_SECRET_KEY=9Zw8Sy8257iJmRdBhUKGiq3d7uYAkhC9smuDUClE8aR1iPdpHHds+K2D1Zy3lwj2Hjnasu5jnopkhwnABWDu8A==
AUTHENTIK_EMAIL_PASSWORD=w+g:cPU+e.<q,f<mj3DFPxXxo4h2SVS9.;,T<!Sra>y!mNcAsiAp4jPCLTmjte2d
ETHERPAD_DB_PASSWORD=d43352c3906516bf4c34d63316509cb4b1621167af84c81b60689779a62b2348
ETHERPAD_ADMIN_PASSWORD=Hackme55#
COLLABORA_USER=...
COLLABORA_PASSWORD=...

44
systems/gateway/cfg.nix Normal file
View File

@@ -0,0 +1,44 @@
{
syscfg = {
hostname = "gateway";
type = "nixos";
system = "x86_64-linux";
defaultUser = "sora";
users = [{
username = "sora";
pubssh = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrrUB0KBjeAKPVG2Bdcm4mI9AMab7y97SOCdEHGogYv sora@gateway";
wm = "-";
git = {
email = "soraefir+git@helcel";
username = "soraefir";
key = "4E241635F8EDD2919D2FB44CA362EA0491E2EEA0";
};
}];
make = {
cli = true;
};
net = {
wlp = { enable = false; };
wg = {
enable = true;
ip4 = "10.10.1.1/32";
ip6 = "fd10:10:10::1/128";
pubkey = "NFBJvYXZC+bd62jhrKnM7/pugidWhgR6+C5qIiUiq3Q=";
};
};
server = {
openssh = true;
wireguard = true;
nftables = {
enable = true;
ifs = ["ens3" "wg0" ];
ports = [
[ "ens3" "10.10.1.2" "fd10:10:10::2" 22 2222 ] # SSH/GIT
[ "ens3" "10.10.1.2" "fd10:10:10::2" 80 80 ] # HTTP
[ "ens3" "10.10.1.2" "fd10:10:10::2" 443 443 ] # HTTPS
[ "ens3" "10.10.1.2" "fd10:10:10::2" 3979 3979 ] # OTTD
];
};
};
};
}

View File

@@ -0,0 +1,14 @@
{ config, lib, inputs, ... }: {
imports = [ ./hardware.nix ../../modules/server ];
system.autoUpgrade = {
enable = true;
flake = "git+https://git.helcel.net/sora/nixconfig";
flags = [
"--no-write-lock-file"
];
dates = "04:00";
randomizedDelaySec = "30min";
allowReboot = false;
};
}

View File

@@ -0,0 +1,27 @@
{ config, lib, pkgs, modulesPath, ... }: {
imports = [ (modulesPath + "/profiles/qemu-guest.nix" ) ];
boot.kernelPackages = pkgs.linuxPackages_latest;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
boot.loader.systemd-boot.enable = lib.mkForce false;
boot.loader.grub = {
enable = true;
device = "/dev/sda";
efiSupport = true;
};
boot.initrd.availableKernelModules =
[ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ];
boot.initrd.kernelModules = [ "nvme" ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/25df457a-21d0-41ab-9de5-88ffc00e3469";
fsType = "btrfs";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/F24E-74FA";
fsType = "vfat";
options = [ "defaults" ];
};
}

View File

@@ -6,6 +6,7 @@
defaultUser = "sora";
users = [{
username = "sora";
pubssh = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDGtotfQkclilrhEOzY3QUpOwYF+eOjHvqN6Of3NVg4x8NQLjx/X/gxC+GAllQxy9Zkz/N5wY0Fa4/6HoGheCRvWaN/nofz95VgtX8a1A/flrT8CGdBfRqXlcd4OEXhpFcbEm9VRXmxSKnsD4zySZr/151S+1PlQr8pJ1yyzxsIQx+RNo9P4gzpoJgkfZ3JIqLWb6B4aXallAg9Ha1WX0lx24voWNgg9AQt6/lccfmeoWAzBGUNq5a/mH59O+UCIM2y19ksEweY6URHpk6Ss597zp+0j2NYg8MS4rToYUb0Y7giNNBdKAzqNd+Wp6gjqBthuDIOfsXM082O5IarPKPJNVbx/Xpf3m1hYtxfL+LhEkdoE94iue601WqTltC0btS63LeZuoAZYji/GG/D8U7V77Lh3MV5/hJm5sK6wM6r7fCoenehgiy49z00NqtgM33rWNrpL9eXNKb//5Lxe7U58jPyteWpsL8+fJFcs/2uh4D5zN3d/I+yLZ1OMgUN6LM= sora@iriy";
wm = "Wayland";
git = {
email = "soraefir+git@helcel";
@@ -17,7 +18,6 @@
gui = true;
cli = true;
virt = true;
power = false;
game = true;
develop = true;
};
@@ -31,6 +31,7 @@
enable = true;
ip4 = "10.10.1.7/32";
ip6 = "fd10:10:10::7/128";
pubkey = "6d1bINFmH12ACAJLDOwfFIZgmNHV/FGGk0YJyDP50HQ=";
};
};
};

View File

@@ -24,7 +24,7 @@
fsType = "ext4";
};
fileSystems."/boot/efi" = {
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/349E-5086";
fsType = "vfat";
};

View File

@@ -2,10 +2,6 @@
imports = [ ./hardware.nix ../../modules/server ];
services.openssh.enable = true;
services.openssh.authorizedKeysFiles = [
config.sops.secrets."iriy_ssh_pub".path
config.sops.secrets."valinor_ssh_pub".path
];
users.users.root.openssh.authorizedKeys.keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC0GpKd62XMlO410/iYkNG8MHdGGaeMG3Gmsf3Pv3u2BllUzR9Dpym1ZOz2lwo3iK0FimcQpOiJqSIahO59HJl8jQ9BoQrJMXH7l2kuq1T09cMNWGjlzowg0LWKWOzoBzOwcheyW68OJGgkSfvk9BdshkUYTLVBXjiI9jo/8Qkcv1WLJJvJmDBDwnbYDQpODXCEDQ/t3YVubb+ocLmh40sDUffJLWZQXN6OFW9N5XxnvY7K5x9ci9GU4Reei40K8yDw2Hgi0njzijRdzie3MJlKPPawJ2TATu9LsGuxfx8bJXVx+mNxP0lhO8dOOhP7p0ozTxlJJY9ZWaKgOz3SzYNCgJ1gH7NtTBtSruXd6pfmErUmuJEAeMD6+QF3yJ5tnVFNPoSHqjP+oL3CgSRpmuvn7ChSSI3J3UVhLux165VtwIL7UhosO2mCqmn0Yk2mSBkB/L4ZiWFmO3vYdagYNQX7xZHzCJ5my8vomiT+DUGb2h/o1NetKwIZJiFAuHxKt3k= sora@valinor"
];

View File

@@ -6,6 +6,7 @@
defaultUser = "sora";
users = [{
username = "sora";
pubssh = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDCZibVYTvS4Dd+ZhGCpRpKfxs1fQeepNTzfzYk9I12Hyez25pQCeH+6ArrVhf6yX5Na1ffkvqTrNIDYJ1V2GHhemX0ruYp2B3xt229JszI7DeRC7YeG7v5uvsfTgicADCstGPSNorKXuNnHuBebSHpmWWbuKrYZdmcA/Az7H8uwF5+VQrnyASgZgwGV94MHinFVWsisB7o6iq4qxqpsUdtuZGbU0stDE5f9DLMDYuUxtx+jASRt+X60Bzjv3OFjU/b/YYzojTtuujkYXunNNTceCB4DTue5YMKQOlmd/IezL5nPAK9IsonPqojX9LPk2RvTCr4qalQ6AD92nq+xMW6FY1uJaKT81S8TvZcaqTm4FhEDkChuFq77biSUDhQkpcdNVOjUn5OtKpYl+0VkCaAx/8uyoylBacrn1XXLLg+gjwGCFHa2eeNu/BKIUa+5EK/FRwLpnEoPDkAHQ95JXQewChcUKG8A+Bz29XRKr9J64kbbGmwa+yjlVTPLSE6ZZE= sora@valinor";
wm = "Wayland";
git = {
email = "soraefir+git@helcel";
@@ -31,6 +32,7 @@
enable = true;
ip4 = "10.10.1.5/32";
ip6 = "fd10:10:10::5/128";
pubkey = "EUYd/dMdGcbxiWJXHhQhCXV00cr87pxiW1HExwCTGg0=";
};
};
};

View File

@@ -17,7 +17,7 @@
fsType = "ext4";
};
fileSystems."/boot/efi" = {
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/F344-72E2";
fsType = "vfat";
};