refactor: move common modules to modules/ directory

This commit is contained in:
toast 2026-04-27 17:45:21 +09:00
parent 3abbd61cfa
commit bf7e249d5b
35 changed files with 67 additions and 63 deletions

View file

@ -3,13 +3,22 @@
{
imports = [
inputs.sops-nix.nixosModules.sops
] ++ (
let
modulesPath = ./modules;
moduleFiles = builtins.attrNames (builtins.readDir modulesPath);
in
map (module: modulesPath + ("/" + module)) moduleFiles
);
../../modules/core/filesystem.nix
../../modules/core/sops.nix
../../modules/services/tailscale.nix
../../modules/services/caddy.nix
../../modules/services/forgejo.nix
../../modules/services/openssh.nix
../../modules/services/restic-rest-server.nix
../../modules/services/trilium-server.nix
../../modules/services/vaultwarden.nix
../../modules/services/zipline.nix
./modules/boot.nix
./modules/network.nix
./modules/users.nix
./modules/tailscale.nix
./modules/services/restic.nix
];
system.stateVersion = "23.11";
nix.settings.experimental-features = [ "nix-command" "flakes" ];

View file

@ -1,4 +0,0 @@
{
fileSystems."/" = { device = "/dev/vda1"; fsType = "ext4"; };
swapDevices = [ { device = "/dev/vda2"; } ];
}

View file

@ -1,25 +0,0 @@
{ config, ... }:
{
services.caddy = {
enable = true;
# zipline
virtualHosts."i.toast.name".extraConfig = ''
reverse_proxy http://127.0.0.1:${toString config.services.zipline.settings.CORE_PORT}
'';
# forgejo
virtualHosts."git.toast.name".extraConfig = ''
reverse_proxy http://127.0.0.1:${toString config.services.forgejo.settings.server.HTTP_PORT}
'';
# tailscale
virtualHosts."vps.curl-pence.ts.net".extraConfig = ''
reverse_proxy /vaultwarden/* http://127.0.0.1:${toString config.services.vaultwarden.config.ROCKET_PORT}
handle_path /restic/* {
reverse_proxy http://${toString config.services.restic.server.listenAddress}
}
'';
};
}

View file

@ -1,12 +0,0 @@
{
imports = [
./tailscale.nix
./vaultwarden.nix
./openssh.nix
./zipline.nix
./caddy.nix
./forgejo.nix
./restic.nix
./restic-rest-server.nix
];
}

View file

@ -1,19 +0,0 @@
{
services.forgejo = {
enable = true;
settings = {
server = {
HTTP_ADDR = "127.0.0.1";
HTTP_PORT = 3001;
DOMAIN = "git.toast.name";
ROOT_URL = "https://git.toast.name/";
LANDING_PAGE = "explore";
};
service.DISABLE_REGISTRATION = true;
actions = {
ENABLED = true;
DEFAULT_ACTIONS_URL = "github";
};
};
};
}

View file

@ -1,10 +0,0 @@
{
services.openssh = {
enable = true;
openFirewall = false;
settings = {
PasswordAuthentication = false;
PermitRootLogin = "prohibit-password";
};
};
}

View file

@ -1,8 +0,0 @@
{
services.restic.server = {
enable = true;
appendOnly = true;
listenAddress = "127.0.0.1:3003";
extraFlags = [ "--no-auth" ];
};
}

View file

@ -1,10 +0,0 @@
{
services.vaultwarden = {
enable = true;
config = {
ROCKET_ADDRESS = "127.0.0.1";
ROCKET_PORT = 8222;
DOMAIN = "https://vps.curl-pence.ts.net/vaultwarden";
};
};
}

View file

@ -1,13 +0,0 @@
{ config, ... }:
{
sops.secrets."zipline/env" = { };
services.zipline = {
enable = true;
settings = {
CORE_HOSTNAME = "127.0.0.1";
CORE_PORT = 3000;
};
environmentFiles = [ config.sops.secrets."zipline/env".path ];
};
}

View file

@ -1,8 +0,0 @@
{ rootPath, ... }:
{
sops.defaultSopsFile = rootPath + /secrets/secrets.yaml;
sops.defaultSopsFormat = "yaml";
sops.age.keyFile = "/home/toast/.config/sops/age/keys.txt";
}

View file

@ -0,0 +1,7 @@
{
services.tailscale = {
useRoutingFeatures = "both";
permitCertUid = "caddy";
extraUpFlags = [ "--ssh" ];
};
}