Compare commits

...

11 commits

17 changed files with 105 additions and 46 deletions

View file

@ -9,11 +9,13 @@
enable = true; enable = true;
# Enable extra features # Enable extra features
enableAutosuggestions = true; autosuggestion = {
enableCompletion = true; enable = true;
};
syntaxHighlighting = { syntaxHighlighting = {
enable = true; enable = true;
}; };
enableCompletion = true;
dotDir = ".config/zsh"; dotDir = ".config/zsh";
# Commands that should be added to to top of '.zshrc' # Commands that should be added to to top of '.zshrc'
@ -23,6 +25,8 @@
# Aliases # Aliases
shellAliases = { shellAliases = {
c = "clear"; c = "clear";
r = "cd ~/.repositories";
p = "cd ~/.print";
la = "ls -a"; la = "ls -a";
ll = "ls -l"; ll = "ls -l";
tt = "wezterm cli set-tab-title "; tt = "wezterm cli set-tab-title ";

View file

@ -6,7 +6,7 @@
package = pkgs.mangohud; package = pkgs.mangohud;
settings = { settings = {
# Performance # Performance
fps_limit = 60; fps_limit = 144;
# GPU # GPU
gpu_temp = true; gpu_temp = true;
gpu_junction_temp = true; gpu_junction_temp = true;

View file

@ -37,6 +37,9 @@
persistence."/persist/home/sajenim" = { persistence."/persist/home/sajenim" = {
directories = [ directories = [
".mozilla" ".mozilla"
# Hidden user data
".repositories"
".print"
# Mutable configurations # Mutable configurations
".config/Yubico" ".config/Yubico"
# Application specific data # Application specific data
@ -48,7 +51,6 @@
"Games" "Games"
"Music" "Music"
"Pictures" "Pictures"
"Printer"
"Videos" "Videos"
]; ];
}; };

View file

@ -28,8 +28,6 @@
persistence."/persist/home/sajenim" = { persistence."/persist/home/sajenim" = {
directories = [ directories = [
".backup"
".github"
".gnupg" ".gnupg"
".ssh" ".ssh"

View file

@ -14,7 +14,7 @@
programs.gnupg.agent = { programs.gnupg.agent = {
enable = true; enable = true;
# Fix: invalid time when using keytocard # Fix: invalid time when using keytocard
pinentryFlavor = "gtk2"; pinentryPackage = pkgs.pinentry-curses;
}; };
# Use our yubikey as a user login or for sudo access # Use our yubikey as a user login or for sudo access

View file

@ -20,5 +20,6 @@
users = { users = {
sajenim = import "${inputs.self}/home-manager/sajenim/${config.networking.hostName}.nix"; sajenim = import "${inputs.self}/home-manager/sajenim/${config.networking.hostName}.nix";
}; };
backupFileExtension = "bak";
}; };
} }

View file

@ -3,9 +3,11 @@
{ {
imports = [ imports = [
../common/global ../common/global
../common/users/sajenim ../common/users/sajenim
../common/users/sajenim/samba ../common/users/sajenim/samba
../common/users/sajenim/steam ../common/users/sajenim/steam
../common/optional/key.nix ../common/optional/key.nix
./services ./services
@ -65,27 +67,27 @@
# Setup our display server. # Setup our display server.
xserver = { xserver = {
enable = true; enable = true;
layout = "au"; xkb.layout = "au";
videoDrivers = [ "amdgpu" ]; videoDrivers = [ "amdgpu" ];
libinput = {
enable = true;
mouse = {
accelProfile = "flat";
};
};
displayManager.startx.enable = true; displayManager.startx.enable = true;
}; };
# Get up and running with large language models locally. libinput = {
ollama = {
enable = true; enable = true;
package = pkgs.unstable.ollama; mouse = { accelProfile = "flat"; };
acceleration = "rocm";
# environmentVariables = {
# HSA_OVERRIDE_GFX_VERSION = "10.3.0";
# };
}; };
# Get up and running with large language models locally.
# ollama = {
# enable = true;
# package = pkgs.unstable.ollama;
# acceleration = "rocm";
# # environmentVariables = {
# # HSA_OVERRIDE_GFX_VERSION = "10.3.0";
# # };
# };
# Enable a few other services. # Enable a few other services.
ratbagd.enable = true; ratbagd.enable = true;
pcscd.enable = true; pcscd.enable = true;

View file

@ -1,4 +1,4 @@
{ outputs, pkgs, ... }: { pkgs, ... }:
{ {
imports = [ imports = [

View file

@ -1,5 +1,7 @@
{ config, lib, ... }: { config, lib, ... }:
let
hostname = config.networking.hostName;
in
{ {
imports = [ imports = [
../common/optional/ephemeral-btrfs.nix ../common/optional/ephemeral-btrfs.nix
@ -30,11 +32,17 @@
}; };
fileSystems."/srv/containers" = { fileSystems."/srv/containers" = {
device = "/dev/disk/by-label/data"; device = "/dev/disk/by-label/${hostname}";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=containers" "compress=zstd" ]; options = [ "subvol=containers" "compress=zstd" ];
}; };
fileSystems."/srv/services" = {
device = "/dev/disk/by-label/${hostname}";
fsType = "btrfs";
options = [ "subvol=services" "compress=zstd" ];
};
fileSystems."/srv/shares" = { fileSystems."/srv/shares" = {
device = "/dev/disk/by-label/data"; device = "/dev/disk/by-label/data";
fsType = "btrfs"; fsType = "btrfs";

View file

@ -7,7 +7,21 @@
"/srv/containers" "/srv/containers"
]; ];
encryption.mode = "none"; encryption.mode = "none";
repo = "/srv/backup/borg/containers"; repo = "/srv/backup/containers";
compression = "auto,zstd";
startAt = "daily";
};
services = {
paths = [
"/srv/services"
];
encryption.mode = "none";
repo = "/srv/backup/services";
compression = "auto,zstd";
startAt = "daily";
};
shares = { shares = {
paths = [ paths = [
"/srv/shares" "/srv/shares"

View file

@ -6,6 +6,7 @@
./minecraft ./minecraft
./borgbackup.nix ./borgbackup.nix
./forgejo.nix ./forgejo.nix
./httpd.nix
./mpd.nix ./mpd.nix
./samba.nix ./samba.nix
]; ];

View file

@ -0,0 +1,16 @@
{ ... }:
{
services.httpd = {
enable = true;
virtualHosts."sajenim.dev" = {
documentRoot = "/srv/services/httpd/sajenim.dev";
listen = [{
ip = "192.168.1.102";
port = 5624;
}];
adminAddr = "its.jassy@pm.me";
};
};
}

View file

@ -11,7 +11,7 @@
]; ];
age.secrets.traefik = { age.secrets.traefik = {
# Environment variables for cloudflare dns challenge # Environment variables for porkbun dns challenge
rekeyFile = ./environment.age; rekeyFile = ./environment.age;
owner = "traefik"; owner = "traefik";
group = "traefik"; group = "traefik";
@ -73,24 +73,6 @@
# Hypertext Transfer Protocol Secure # Hypertext Transfer Protocol Secure
websecure = { websecure = {
address = ":443"; address = ":443";
# Trust cloudflares forwarded header information
forwardedHeaders.trustedIPs = [
"173.245.48.0/20"
"103.21.244.0/22"
"103.22.200.0/22"
"103.31.4.0/22"
"141.101.64.0/18"
"108.162.192.0/18"
"190.93.240.0/20"
"188.114.96.0/20"
"197.234.240.0/22"
"198.41.128.0/17"
"162.158.0.0/15"
"172.64.0.0/13"
"131.0.72.0/22"
"104.16.0.0/13"
"104.24.0.0/14"
];
# Requests wildcard SSL certs for our services # Requests wildcard SSL certs for our services
http.tls = { http.tls = {
certResolver = "lets-encrypt"; certResolver = "lets-encrypt";
@ -121,7 +103,7 @@
caServer = "https://acme-v02.api.letsencrypt.org/directory"; caServer = "https://acme-v02.api.letsencrypt.org/directory";
# Use a DNS-01 ACME challenge # Use a DNS-01 ACME challenge
dnsChallenge = { dnsChallenge = {
provider = "cloudflare"; provider = "porkbun";
resolvers = [ resolvers = [
"1.1.1.1:53" "1.1.1.1:53"
"8.8.8.8:53" "8.8.8.8:53"

View file

@ -2,6 +2,17 @@
{ {
services.traefik.dynamicConfigOptions.http.routers = { services.traefik.dynamicConfigOptions.http.routers = {
httpd = {
rule = "Host(`sajenim.dev`)";
entryPoints = [
"websecure"
];
middlewares = [
"geoblock"
];
service = "httpd";
};
forgejo = { forgejo = {
rule = "Host(`git.sajenim.dev`)"; rule = "Host(`git.sajenim.dev`)";
entryPoints = [ entryPoints = [
@ -113,7 +124,7 @@
}; };
qbittorrent = { qbittorrent = {
rule = "Host(`qbittorrent.kanto.dev`)"; rule = "Host(`torrent.kanto.dev`)";
entryPoints = [ entryPoints = [
"websecure" "websecure"
]; ];
@ -144,6 +155,17 @@
]; ];
service = "microbin"; service = "microbin";
}; };
ender1 = {
rule = "Host(`e1.kanto.dev`)";
entryPoints = [
"websecure"
];
middlewares = [
"admin"
];
service = "ender1";
};
}; };
} }

View file

@ -2,9 +2,15 @@
{ {
services.traefik.dynamicConfigOptions.http.services = { services.traefik.dynamicConfigOptions.http.services = {
# sajenim.dev
httpd.loadBalancer.servers = [
{ url = "http://192.168.1.102:5624"; }
];
forgejo.loadBalancer.servers = [ forgejo.loadBalancer.servers = [
{ url = "http://192.168.1.102:3131"; } { url = "http://192.168.1.102:3131"; }
]; ];
# kanto.dev
homarr.loadBalancer.servers = [ homarr.loadBalancer.servers = [
{ url = "http://192.168.1.102:7575"; } { url = "http://192.168.1.102:7575"; }
]; ];
@ -38,6 +44,9 @@
microbin.loadBalancer.servers = [ microbin.loadBalancer.servers = [
{ url = "http://192.168.1.102:8181"; } { url = "http://192.168.1.102:8181"; }
]; ];
ender1.loadBalancer.servers = [
{ url = "http://192.168.1.103:80"; }
];
}; };
} }