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

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

10
modules/core/packages.nix Normal file
View file

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

8
modules/core/sops.nix Normal file
View file

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

24
modules/core/time.nix Normal file
View file

@ -0,0 +1,24 @@
{ 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

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

View file

@ -0,0 +1,19 @@
{ 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

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

View file

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

View file

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

View file

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

View file

@ -0,0 +1,12 @@
{ 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

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

View file

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

8
modules/programs/nh.nix Normal file
View file

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

View file

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

5
modules/programs/ssh.nix Normal file
View file

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

View file

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

5
modules/programs/zsh.nix Normal file
View file

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

View file

@ -0,0 +1,25 @@
{ 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

@ -0,0 +1,19 @@
{
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

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

View file

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

View file

@ -0,0 +1,10 @@
{ config, ... }:
{
sops.secrets."tailscale/authkey" = { };
services.tailscale = {
enable = true;
authKeyFile = config.sops.secrets."tailscale/authkey".path;
};
}

View file

@ -0,0 +1,7 @@
{
services.trilium-server = {
enable = true;
host = "127.0.0.1";
port = 8080;
};
}

View file

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

View file

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

View file

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

View file

@ -0,0 +1,13 @@
{ 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 ];
};
}