nixos-config/hosts/x86_64-linux/beleth/default.nix

260 lines
6.9 KiB
Nix
Raw Normal View History

2024-04-01 02:29:05 +02:00
{
config,
lib,
pkgs,
...
}:
with lib; {
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
./monitoring.nix
./jellyfin.nix
2024-04-12 12:03:38 +02:00
./calibre-web.nix
./transmission.nix
2024-07-17 13:01:09 +02:00
./fail2ban.nix
2024-04-12 12:03:38 +02:00
./lanrarari.nix
2024-07-31 13:02:54 +02:00
# ./hydra.nix
2024-09-10 16:04:54 +02:00
./conduit.nix
2024-04-18 14:57:24 +02:00
./uptime.nix
./networking.nix
2024-05-16 19:00:47 +02:00
./git.nix
2024-06-19 10:45:20 +02:00
./nextcloud.nix
2024-06-19 11:54:07 +02:00
./paperless.nix
2024-07-15 21:03:34 +02:00
../../docker.nix
2024-07-05 20:44:42 +02:00
# ./borg.nix
2024-06-19 15:34:15 +02:00
# ./nfs.nix
# ../../gc.nix
2024-04-12 12:50:19 +02:00
../../../common
2024-04-01 02:29:05 +02:00
];
2024-08-05 11:52:59 +02:00
services.btrfs.autoScrub.enable = true;
services.btrfs.autoScrub.interval = "weekly";
2024-04-02 00:55:26 +02:00
services.caddy = {
enable = true;
email = "xqtc@tutanota.com";
2024-06-19 11:09:38 +02:00
virtualHosts = {
"heroin.trade" = {
extraConfig = ''
root * /var/www/website/public/
handle_errors {
rewrite * /404.html
file_server
2024-06-09 20:48:07 +02:00
}
2024-06-19 11:09:38 +02:00
file_server
'';
};
2024-09-10 16:04:54 +02:00
# "matrix.heroin.trade" = {
# extraConfig = ''
# reverse_proxy /_matrix/* 127.0.0.1:${builtins.toString config.services.matrix-conduit.settings.global.port}
# '';
# };
2024-07-24 14:11:31 +02:00
"hydra.heroin.trade" = {
extraConfig = ''
reverse_proxy http://localhost:${builtins.toString config.services.hydra.port}
'';
};
2024-07-21 21:29:06 +02:00
"cheats-rs.heroin.trade" = {
2024-07-24 14:11:31 +02:00
extraConfig = ''
root * /var/www/cheats-rs/public/
handle_errors {
rewrite * /404.html
file_server
}
file_server
'';
2024-07-21 21:29:06 +02:00
};
2024-06-19 11:09:38 +02:00
"syncthing.heroin.trade" = {
extraConfig = ''
reverse_proxy http://localhost:8384 {
header_up Host {upstream_hostport}
}
'';
};
"demos.heroin.trade" = {
extraConfig = ''
root * /var/www/demos/
file_server browse
'';
};
"git.heroin.trade" = {
extraConfig = ''
reverse_proxy http://localhost:3002
'';
};
"jellyfin.heroin.trade" = {
2024-07-01 20:45:31 +02:00
extraConfig = ''
2024-07-06 16:42:49 +02:00
reverse_proxy http://127.0.0.1:8096
redir /metrics* /
2024-07-01 20:45:31 +02:00
'';
2024-06-19 11:09:38 +02:00
};
"calibre.heroin.trade" = {
2024-07-01 20:45:31 +02:00
extraConfig = ''
reverse_proxy http://localhost:3000
'';
2024-06-19 11:09:38 +02:00
};
"grafana.heroin.trade" = {
2024-07-01 20:45:31 +02:00
extraConfig = ''
reverse_proxy http://127.0.0.1:2342
'';
2024-06-19 11:09:38 +02:00
};
"uptime.heroin.trade" = {
2024-07-01 20:45:31 +02:00
extraConfig = ''
reverse_proxy http://127.0.0.1:3001
'';
2024-06-19 11:09:38 +02:00
};
2024-06-19 11:54:07 +02:00
"paperless.heroin.trade" = {
2024-07-01 20:45:31 +02:00
extraConfig = ''
reverse_proxy http://127.0.0.1:28981
'';
2024-06-19 11:54:07 +02:00
};
2024-07-11 19:49:46 +02:00
"radarr.heroin.trade" = {
extraConfig = ''
reverse_proxy http://127.0.0.1:7878
'';
};
"sonarr.heroin.trade" = {
extraConfig = ''
reverse_proxy http://127.0.0.1:8989
'';
};
"prowlarr.heroin.trade" = {
extraConfig = ''
reverse_proxy http://127.0.0.1:9696
'';
};
"qbit.heroin.trade" = {
extraConfig = ''
reverse_proxy http://127.0.0.1:8085
'';
};
2024-09-09 20:41:48 +02:00
"marie.software" = {
2024-09-10 16:04:54 +02:00
extraConfig = ''
root * /var/www/marie-website/
file_server
'';
2024-09-09 20:41:48 +02:00
};
2024-07-05 20:44:42 +02:00
"servers" = {
2024-07-06 16:42:49 +02:00
extraConfig = ''
metrics
'';
2024-07-05 20:44:42 +02:00
};
2024-06-19 11:09:38 +02:00
};
2024-04-01 02:29:05 +02:00
};
2024-04-12 12:50:19 +02:00
services.syncthing.settings.gui.insecureSkipHostcheck = true;
2024-04-01 02:29:05 +02:00
nix.settings.experimental-features = ["nix-command" "flakes"];
nix.settings = {
trusted-users = ["xqtc"];
substituters = [
"https://nix-community.cachix.org"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "beleth"; # Define your hostname.
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
2024-06-09 19:50:36 +02:00
networking.wireguard.enable = true;
2024-04-01 02:29:05 +02:00
# Set your time zone.
time.timeZone = "Europe/Berlin";
users.users.xqtc = {
isNormalUser = true;
2024-05-27 19:29:50 +02:00
extraGroups = ["wheel" "docker"];
2024-04-01 02:29:05 +02:00
packages = with pkgs; [
tree
];
openssh.authorizedKeys.keys = [
# TODO: Add remaining keys from https://meta.sr.ht/~xqrc.keys
2024-04-12 12:50:19 +02:00
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJTLJqIVwnqFO64rnc66d234TFOdFXpDS9fJUA4/f4in xqtc@alastor"
2024-04-01 02:29:05 +02:00
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN7UkcmSVo+SeB5Obevz3mf3UHruYxn0UHUzoOs2gDBy xqtc@asmodeus"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPf3w5bHAssHthg9SPXVpG4w9v8m16X/0J3bjg08P6EA xqtc@seraphim"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJYa+LoHGGvu12iBufUcr3GD8tsq4LuJdwLjaDkTr0SL xqtc@lilith"
];
};
2024-09-09 20:41:48 +02:00
users.users.marie = {
isNormalUser = true;
packages = with pkgs; [
git
wget
];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN0mGd4YS4f3Wy+a4PBXbie42C5Qo4H0uWsN7joaK27h marie@titania"
2024-09-09 22:22:23 +02:00
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFckmWImlMVsCbu5M1lsLtzxhBxrQhTQHYrKWJYDOHr5 marie@oberon"
2024-09-09 20:41:48 +02:00
];
};
2024-09-09 23:40:22 +02:00
users.users.mo = {
isNormalUser = true;
packages = with pkgs; [
git
wget
];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFjRrLI5mBnoIMcjq2WGPCGuKYLwS7uhgI6F0T5ojp6n moe@martini.moe"
];
};
2024-09-09 20:41:48 +02:00
2024-09-24 16:25:58 +02:00
users.users.ellie = {
isNormalUser = true;
packages = with pkgs; [
git
wget
];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKA4+3PkFptATzrWncxdj63SqZ747cDb8TqmdQFugvW7 ellie@card"
];
};
2024-04-01 02:29:05 +02:00
users.users.root.openssh.authorizedKeys.keys = [
2024-07-01 20:45:31 +02:00
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJTLJqIVwnqFO64rnc66d234TFOdFXpDS9fJUA4/f4in xqtc@alastor"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN7UkcmSVo+SeB5Obevz3mf3UHruYxn0UHUzoOs2gDBy xqtc@asmodeus"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPf3w5bHAssHthg9SPXVpG4w9v8m16X/0J3bjg08P6EA xqtc@seraphim"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJYa+LoHGGvu12iBufUcr3GD8tsq4LuJdwLjaDkTr0SL xqtc@lilith"
2024-04-01 02:29:05 +02:00
];
2024-04-18 12:12:03 +02:00
programs.bash.blesh.enable = true;
# programs.bash.shellInit = "cd /home/xqtc/nixos-config/; export GIT_REVISION_CONFIG=$(nix flake metadata --json | jq -r '.locked.rev'); echo $GIT_REVISION_CONFIG; cd;";
2024-04-18 12:12:03 +02:00
2024-04-01 02:29:05 +02:00
environment.systemPackages = with pkgs; [
neovim
vim
git
wget
2024-04-18 12:12:03 +02:00
jq
2024-04-18 13:36:44 +02:00
zola
2024-04-01 02:29:05 +02:00
];
programs.mtr.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
# Enable the OpenSSH daemon.
services.openssh.enable = true;
2024-08-06 13:06:59 +02:00
# programs.ssh.extraConfig = ''
# Host frotting
# HostName 2a0f:be01:0:100::a3
# User communism
# '';
2024-04-01 02:29:05 +02:00
2024-08-06 13:06:59 +02:00
# services.mullvad-vpn.enable = true;
2024-04-12 12:03:38 +02:00
2024-04-01 02:29:05 +02:00
# Open ports in the firewall.
2024-06-16 00:42:51 +02:00
networking.nftables.enable = true;
2024-04-01 02:29:05 +02:00
networking.firewall.allowedTCPPorts = [22 80 443];
2024-06-14 12:14:00 +02:00
networking.firewall.allowedUDPPorts = [51820];
2024-04-01 02:29:05 +02:00
system.stateVersion = "24.05"; # Did you read the comment?
}