mirror of
https://github.com/lightly-toasted/nix-config.git
synced 2026-05-07 13:36:24 +00:00
refactor: move common modules to modules/ directory
This commit is contained in:
parent
3abbd61cfa
commit
bf7e249d5b
35 changed files with 67 additions and 63 deletions
4
modules/core/filesystem.nix
Normal file
4
modules/core/filesystem.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
fileSystems."/" = { device = "/dev/vda1"; fsType = "ext4"; };
|
||||
swapDevices = [ { device = "/dev/vda2"; } ];
|
||||
}
|
||||
10
modules/core/packages.nix
Normal file
10
modules/core/packages.nix
Normal 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
8
modules/core/sops.nix
Normal 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
24
modules/core/time.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
}
|
||||
8
modules/graphical/environment.nix
Normal file
8
modules/graphical/environment.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.sessionVariables = {
|
||||
# WLR_NO_HARDWARE_CURSORS = "1";
|
||||
NIXOS_OZONE_WL = "1";
|
||||
};
|
||||
}
|
||||
19
modules/graphical/flatpak.nix
Normal file
19
modules/graphical/flatpak.nix
Normal 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"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
14
modules/graphical/greetd.nix
Normal file
14
modules/graphical/greetd.nix
Normal 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;
|
||||
};
|
||||
}
|
||||
10
modules/graphical/hyprland.nix
Normal file
10
modules/graphical/hyprland.nix
Normal 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;
|
||||
};
|
||||
}
|
||||
3
modules/graphical/ratbagd.nix
Normal file
3
modules/graphical/ratbagd.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
services.ratbagd.enable = true;
|
||||
}
|
||||
5
modules/graphical/steam.nix
Normal file
5
modules/graphical/steam.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.steam.enable = true;
|
||||
}
|
||||
12
modules/graphical/thunar.nix
Normal file
12
modules/graphical/thunar.nix
Normal 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
|
||||
}
|
||||
5
modules/graphical/xfconf.nix
Normal file
5
modules/graphical/xfconf.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.xfconf.enable = true;
|
||||
}
|
||||
8
modules/graphical/xserver.nix
Normal file
8
modules/graphical/xserver.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
services.xserver = {
|
||||
xkb.layout = "us";
|
||||
videoDrivers = [ "nvidia" ];
|
||||
};
|
||||
}
|
||||
8
modules/programs/nh.nix
Normal file
8
modules/programs/nh.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
programs.nh = {
|
||||
enable = true;
|
||||
clean.enable = true;
|
||||
clean.extraArgs = "--keep-since 7d --keep 3";
|
||||
flake = "/home/toast/nix-config";
|
||||
};
|
||||
}
|
||||
3
modules/programs/nix-ld.nix
Normal file
3
modules/programs/nix-ld.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
programs.nix-ld.enable = true;
|
||||
}
|
||||
5
modules/programs/ssh.nix
Normal file
5
modules/programs/ssh.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.ssh.startAgent = true;
|
||||
}
|
||||
5
modules/programs/ydotool.nix
Normal file
5
modules/programs/ydotool.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.ydotool.enable = true;
|
||||
}
|
||||
5
modules/programs/zsh.nix
Normal file
5
modules/programs/zsh.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.zsh.enable = true;
|
||||
}
|
||||
25
modules/services/caddy.nix
Normal file
25
modules/services/caddy.nix
Normal 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}
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
19
modules/services/forgejo.nix
Normal file
19
modules/services/forgejo.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
10
modules/services/openssh.nix
Normal file
10
modules/services/openssh.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
openFirewall = false;
|
||||
settings = {
|
||||
PasswordAuthentication = false;
|
||||
PermitRootLogin = "prohibit-password";
|
||||
};
|
||||
};
|
||||
}
|
||||
8
modules/services/restic-rest-server.nix
Normal file
8
modules/services/restic-rest-server.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
services.restic.server = {
|
||||
enable = true;
|
||||
appendOnly = true;
|
||||
listenAddress = "127.0.0.1:3003";
|
||||
extraFlags = [ "--no-auth" ];
|
||||
};
|
||||
}
|
||||
10
modules/services/tailscale.nix
Normal file
10
modules/services/tailscale.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
sops.secrets."tailscale/authkey" = { };
|
||||
|
||||
services.tailscale = {
|
||||
enable = true;
|
||||
authKeyFile = config.sops.secrets."tailscale/authkey".path;
|
||||
};
|
||||
}
|
||||
7
modules/services/trilium-server.nix
Normal file
7
modules/services/trilium-server.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
services.trilium-server = {
|
||||
enable = true;
|
||||
host = "127.0.0.1";
|
||||
port = 8080;
|
||||
};
|
||||
}
|
||||
3
modules/services/udisks2.nix
Normal file
3
modules/services/udisks2.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
services.udisks2.enable = true;
|
||||
}
|
||||
10
modules/services/vaultwarden.nix
Normal file
10
modules/services/vaultwarden.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
}
|
||||
3
modules/services/zerotierone.nix
Normal file
3
modules/services/zerotierone.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
services.zerotierone.enable = true;
|
||||
}
|
||||
13
modules/services/zipline.nix
Normal file
13
modules/services/zipline.nix
Normal 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 ];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue