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

@ -7,13 +7,33 @@
inputs.sops-nix.nixosModules.sops
inputs.lanzaboote.nixosModules.lanzaboote
./hardware-configuration.nix
] ++ (
let
modulesPath = ./modules;
moduleFiles = builtins.attrNames (builtins.readDir modulesPath);
in
map (module: modulesPath + ("/" + module)) moduleFiles
);
] ++ [
../../modules/core/packages.nix
../../modules/core/time.nix
../../modules/core/sops.nix
../../modules/graphical/environment.nix
../../modules/graphical/greetd.nix
../../modules/graphical/hyprland.nix
../../modules/graphical/steam.nix
../../modules/graphical/thunar.nix
../../modules/graphical/xfconf.nix
../../modules/graphical/xserver.nix
../../modules/graphical/flatpak.nix
../../modules/graphical/ratbagd.nix
../../modules/programs/nh.nix
../../modules/programs/nix-ld.nix
../../modules/programs/ssh.nix
../../modules/programs/ydotool.nix
../../modules/programs/zsh.nix
../../modules/services/tailscale.nix
../../modules/services/udisks2.nix
../../modules/services/zerotierone.nix
./modules/boot.nix
./modules/network.nix
./modules/users.nix
./modules/hardware.nix
./modules/services/restic.nix
];
system.stateVersion = "25.05";
nix.settings.experimental-features = [ "nix-command" "flakes" ];

View file

@ -1,8 +0,0 @@
{ config, pkgs, ... }:
{
environment.sessionVariables = {
# WLR_NO_HARDWARE_CURSORS = "1";
NIXOS_OZONE_WL = "1";
};
}

View file

@ -1,10 +0,0 @@
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
vim
wget
sbctl
];
nixpkgs.config.allowUnfree = true;
}

View file

@ -1,15 +0,0 @@
{ config, pkgs, ... }:
{
imports = [
./zsh.nix
./hyprland.nix
./thunar.nix
./xfconf.nix
./ssh.nix
./ydotool.nix
./steam.nix
./nix-ld.nix
./nh.nix
];
}

View file

@ -1,10 +0,0 @@
{ inputs, pkgs, ... }:
{
programs.hyprland = {
enable = true;
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
withUWSM = true;
xwayland.enable = true;
};
}

View file

@ -1,8 +0,0 @@
{
programs.nh = {
enable = true;
clean.enable = true;
clean.extraArgs = "--keep-since 7d --keep 3";
flake = "/home/toast/nix-config";
};
}

View file

@ -1,3 +0,0 @@
{
programs.nix-ld.enable = true;
}

View file

@ -1,5 +0,0 @@
{ config, pkgs, ... }:
{
programs.ssh.startAgent = true;
}

View file

@ -1,5 +0,0 @@
{ config, pkgs, ... }:
{
programs.steam.enable = true;
}

View file

@ -1,12 +0,0 @@
{ config, pkgs, ... }:
{
programs.thunar = {
enable = true;
plugins = with pkgs; [
thunar-volman
];
};
services.gvfs.enable = true; # Mount, trash, and other functionalities
services.tumbler.enable = true; # Thumbnail support for images
}

View file

@ -1,5 +0,0 @@
{ config, pkgs, ... }:
{
programs.xfconf.enable = true;
}

View file

@ -1,5 +0,0 @@
{ config, pkgs, ... }:
{
programs.ydotool.enable = true;
}

View file

@ -1,5 +0,0 @@
{ config, pkgs, ... }:
{
programs.zsh.enable = true;
}

View file

@ -1,14 +0,0 @@
{ config, pkgs, ... }:
{
imports = [
./xserver.nix
./greetd.nix
./tailscale.nix
./flatpak.nix
./restic.nix
./zerotierone.nix
./udisks2.nix
./ratbagd.nix
];
}

View file

@ -1,19 +0,0 @@
{ config, pkgs, ... }:
{
services.flatpak = {
enable = true;
packages = [
"org.vinegarhq.Sober"
"org.vinegarhq.Vinegar"
];
overrides = {
"org.vinegarhq.Sober".Context = {
filesystems = [
"xdg-run/app/com.discordapp.Discord:create"
"xdg-run/discord-ipc-0"
];
};
};
};
}

View file

@ -1,14 +0,0 @@
{ config, pkgs, ... }:
{
services.greetd = {
enable = true;
settings = {
default_session = {
command = "${pkgs.tuigreet}/bin/tuigreet --time --remember --remember-session";
user = "greeter";
};
};
useTextGreeter = true;
};
}

View file

@ -1,3 +0,0 @@
{
services.ratbagd.enable = true;
}

View file

@ -1,3 +0,0 @@
{
services.udisks2.enable = true;
}

View file

@ -1,8 +0,0 @@
{ config, pkgs, ... }:
{
services.xserver = {
xkb.layout = "us";
videoDrivers = [ "nvidia" ];
};
}

View file

@ -1,3 +0,0 @@
{
services.zerotierone.enable = true;
}

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

@ -1,24 +0,0 @@
{ config, pkgs, ... }:
{
time.timeZone = "Asia/Seoul";
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "ko_KR.UTF-8";
LC_IDENTIFICATION = "ko_KR.UTF-8";
LC_MEASUREMENT = "ko_KR.UTF-8";
LC_MONETARY = "ko_KR.UTF-8";
LC_NAME = "ko_KR.UTF-8";
LC_NUMERIC = "ko_KR.UTF-8";
LC_PAPER = "ko_KR.UTF-8";
LC_TELEPHONE = "ko_KR.UTF-8";
LC_TIME = "ko_KR.UTF-8";
};
inputMethod = {
enable = true;
type = "kime";
kime.iconColor = "White";
};
};
}

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" ];
};
}