This commit is contained in:
DuN0z 2025-10-09 17:46:15 +02:00
parent fd5f22ae65
commit 845c3373ba
9 changed files with 65 additions and 55 deletions

View file

@ -3,7 +3,6 @@
../desktop/bspwm.nix ../desktop/bspwm.nix
./lomig.nix ./lomig.nix
]; ];
home.stateVersion = "25.05"; # ou ton actuelle
home = { home = {
packages = with pkgs; [ packages = with pkgs; [
fastfetch fastfetch

View file

@ -1,4 +1,7 @@
{pkgs, ...}: { {pkgs, ...}:
let
globals = import ../../config/globals.nix;
in {
imports = [ imports = [
../../profiles/workstation-bspwm.nix ../../profiles/workstation-bspwm.nix
../../modules/hardware/bepovim.nix ../../modules/hardware/bepovim.nix
@ -37,7 +40,7 @@
users.users.lomig = { users.users.lomig = {
isNormalUser = true; isNormalUser = true;
extraGroups = ["networkmanager" "lp" "wheel"]; extraGroups = [ "lp" "wheel"];
shell = pkgs.zsh; shell = pkgs.zsh;
}; };
@ -49,21 +52,26 @@
networking = { networking = {
useNetworkd = true; useNetworkd = true;
firewall.allowedTCPPorts = [22 80 5900 5901 5902]; firewall.allowedTCPPorts = [22 80 5900 5901 5902];
interfaces.enp11s0.useDHCP = false; interfaces = {
interfaces.br0 = { enp11s0 = {
useDHCP = false;
wakeOnLan.enable = true ;
br0 = {
useDHCP = false; useDHCP = false;
ipv4.addresses = [ ipv4.addresses = [
{ {
address = "192.168.50.12"; address = globals.network.pennsardin.ip;
prefixLength = 24; prefixLength = 24;
} }
]; ];
}; };
};
defaultGateway = { defaultGateway = {
interface = "br0"; interface = "br0";
address = "192.168.50.1"; address = globals.network.gateway;
}; };
nameservers = ["192.168.50.1" "1.1.1.1"]; nameservers = [ globals.network.gateway "1.1.1.1"];
bridges.br0.interfaces = ["enp11s0"]; bridges.br0.interfaces = ["enp11s0"];
}; };
systemd.network = { systemd.network = {

View file

@ -1,8 +1,6 @@
_: { _: {
networking = { networking = {
nameservers = ["1.1.1.1" "8.8.8.8"]; nameservers = ["1.1.1.1" "8.8.8.8"];
# dhcpcd.extraConfig = "nohook resolv.conf";
firewall.enable = true; firewall.enable = true;
interfaces.enp11s0.wakeOnLan.enable = true;
}; };
} }

View file

@ -1,18 +1,10 @@
{pkgs, ...}: { {pkgs, ...}: {
imports = [ imports = [
../common/nix.nix ../common/nix.nix
# Matériel
../hardware/gpu-amd.nix ../hardware/gpu-amd.nix
../hardware/sensors-zenpower.nix ../hardware/sensors-zenpower.nix
# Virtualisation/tuning
../virtual/kvm-amd.nix ../virtual/kvm-amd.nix
../virtual/vfio.nix ../virtual/vfio.nix
# Dev
# ../dev/qemu.nix
# ../virtual/truenas.nix # seulement si tu lutilises sur ce host
]; ];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [

View file

@ -1,4 +1,7 @@
{pkgs, ...}: { {pkgs, ...}:
let
import ../../config/globals.nix;
in {
# --- Utilisateur dédié --- # --- Utilisateur dédié ---
users.users.git = { users.users.git = {
isSystemUser = true; isSystemUser = true;
@ -20,10 +23,10 @@
}; };
settings = { settings = {
server = { server = {
DOMAIN = "govel.porzh.me"; DOMAIN = globals.services.forgejo.url ;
ROOT_URL = "https://govel.porzh.me/"; ROOT_URL = "https://${globals.services.forgejo.url}/";
SSH_DOMAIN = "govel.porzh.me"; SSH_DOMAIN = globals.services.forgejo.url;
HTTP_PORT = 3000; HTTP_PORT = globals.services.forgejo.port;
SSH_PORT = 22; SSH_PORT = 22;
START_SSH_SERVER = false; START_SSH_SERVER = false;
}; };
@ -32,16 +35,16 @@
REGISTER_EMAIL_CONFIRM = false; REGISTER_EMAIL_CONFIRM = false;
}; };
repository = { repository = {
DEFAULT_BRANCH = "main"; DEFAULT_BRANCH = "master";
}; };
}; };
}; };
openssh.enable = true; openssh.enable = true;
caddy = { caddy = {
enable = true; enable = true;
virtualHosts."govel.porzh.me" = { virtualHosts.${globals.services.forgejo.url} = {
extraConfig = '' extraConfig = ''
reverse_proxy localhost:3000 reverse_proxy localhost:${globals.services.forgejo.port}
''; '';
}; };
}; };

View file

@ -1,4 +1,7 @@
{pkgs, ...}: { {pkgs, ...}:
let
imports = ../../config/globals.nix ;
in {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
goaccess goaccess
]; ];
@ -7,7 +10,7 @@
systemd.services.goaccess-report = { systemd.services.goaccess-report = {
description = "Generate GoAccess HTML report"; description = "Generate GoAccess HTML report";
serviceConfig = { serviceConfig = {
ExecStart = "${pkgs.goaccess}/bin/goaccess /var/log/caddy/access-levr.porzh.me.log --log-format=CADDY -o /var/www/goaccess/index.html"; ExecStart = "${pkgs.goaccess}/bin/goaccess /var/log/caddy/access-${globals.services.levr.url}.log --log-format=CADDY -o ${globals.services.goaccess.home}/index.html";
}; };
}; };
@ -22,9 +25,9 @@
}; };
services.caddy = { services.caddy = {
virtualHosts = { virtualHosts = {
"koum.porzh.me" = { globals.services.goaccess.url = {
extraConfig = '' extraConfig = ''
root * /var/www/goaccess root * ${globals.services.goaccess.home}
file_server browse file_server browse
try_files {path} {path}/ /index.html try_files {path} {path}/ /index.html

View file

@ -1,26 +1,29 @@
{ config, pkgs, lib, ... }: { { config, pkgs, lib, ... }:
let
import ../../config/globals.nix ;
in {
services = { services = {
outline = { outline = {
enable = true; enable = true;
port = 3002 ; port = globals.services.outline.port ;
publicUrl = "http://notes.porzh.me"; publicUrl = "http://${globals.services.outline.url}";
forceHttps = true; forceHttps = true;
smtp = { smtp = {
host = "smtp.protonmail.ch"; host = globals.smtp.host ;
username = "contact@porzh.me"; username = globals.smtp.user ;
passwordFile = "/run/secrets/proton_pass"; passwordFile = "/run/secrets/proton_pass";
fromEmail = "contact@porzh.me"; fromEmail = globals.smtp.user;
replyEmail = "contact@porzh.me"; replyEmail = globals.smtp.user;
port = 587 ; port = globals.smtp.port;
secure = false; secure = false;
}; };
storage.storageType = "local"; storage.storageType = "local";
}; };
caddy = { caddy = {
enable = true; enable = true;
virtualHosts."notes.porzh.me" = { virtualHosts.${globals.services.outline.url} = {
extraConfig = '' extraConfig = ''
reverse_proxy localhost:3002 reverse_proxy localhost:${globals.services.outline.port}
''; '';
}; };
}; };

View file

@ -1,4 +1,7 @@
{ pkgs, lib, ...}: { { pkgs, lib, ...}:
let
import = ../../config/globals.nix ;
in {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
hugo hugo
]; ];
@ -6,8 +9,8 @@
description = "Auto build du blog hugo"; description = "Auto build du blog hugo";
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
WorkingDirectory = "/srv/blog" ; WorkingDirectory = globals.services.levr.home ;
ExecStart = ''${pkgs.hugo}/bin/hugo --minify build -d /srv/blog/public''; ExecStart = ''${pkgs.hugo}/bin/hugo --minify build -d ${globals.services.levr.build}'';
User = "lomig"; User = "lomig";
}; };
}; };
@ -23,7 +26,7 @@
description = "Synchronisation du dépôt Hugo"; description = "Synchronisation du dépôt Hugo";
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
WorkingDirectory = "/srv/blog"; WorkingDirectory = globals.services.levr.home;
ExecStart = "${pkgs.git}/bin/git pull origin master"; ExecStart = "${pkgs.git}/bin/git pull origin master";
User = "lomig"; User = "lomig";
}; };
@ -41,17 +44,17 @@
services.caddy = { services.caddy = {
enable = true; enable = true;
virtualHosts = { virtualHosts = {
"levr.porzh.me" = { globals.services.levr.url = {
extraConfig = '' extraConfig = ''
@http { @http {
protocol http protocol http
} }
redir @http https://{host}{uri} permanent redir @http https://{host}{uri} permanent
root * /srv/blog/public root * ${globals.services.levr.build}
file_server file_server
log { log {
output file /var/log/caddy/access-levr.porzh.me.log output file /var/log/caddy/access-${global.services.levr.url}.log
} }
''; '';
}; };

View file

@ -1,4 +1,5 @@
{pkgs, ...}: let {pkgs, ...}: let
import ../../config/globals.nix ;
porzhSite = pkgs.stdenv.mkDerivation { porzhSite = pkgs.stdenv.mkDerivation {
pname = "porzh-site"; pname = "porzh-site";
version = "1.0"; version = "1.0";
@ -13,8 +14,8 @@ in {
services.caddy = { services.caddy = {
enable = true; enable = true;
virtualHosts = { virtualHosts = {
"porzh.me" = { globals.domain = {
serverAliases = ["www.porzh.me"]; serverAliases = [ "www.${globals.domain}" ];
extraConfig = '' extraConfig = ''
root * ${porzhSite} root * ${porzhSite}
file_server file_server