Refactor hosts folder

This commit is contained in:
2025-11-29 22:51:38 +01:00
parent 4e32e95eab
commit df731b0703
30 changed files with 214 additions and 1080 deletions

View File

@@ -75,7 +75,7 @@
inputs.nixos-hardware.nixosModules.common-cpu-amd
inputs.nixos-hardware.nixosModules.common-gpu-amd
./hosts/polaris/configuration.nix
./hosts/polaris/system.nix
];
};
@@ -90,7 +90,7 @@
inputs.nixos-hardware.nixosModules.lenovo-yoga-7-14ARH7-amdgpu
./hosts/altair/configuration.nix
./hosts/altair/system.nix
];
};
@@ -108,7 +108,7 @@
inputs.copyparty.nixosModules.default
inputs.disko.nixosModules.disko
./hosts/orion/configuration.nix
./hosts/orion/system.nix
];
};
};

View File

@@ -1,25 +0,0 @@
{ config, ... }:
{
imports = [
# Mostly system related configuration
../../modules/nixos/audio.nix
../../modules/nixos/bluetooth.nix
../../modules/nixos/fonts.nix
../../modules/nixos/home-manager.nix
../../modules/nixos/nix.nix
../../modules/nixos/systemd-boot.nix
../../modules/nixos/sddm.nix
../../modules/nixos/users.nix
../../modules/nixos/utils.nix
../../modules/nixos/hyprland.nix
# You should let those lines as is
./hardware-configuration.nix
./variables.nix
];
home-manager.users."${config.var.username}" = import ./home.nix;
# Don't touch this
system.stateVersion = "24.05";
}

View File

@@ -1,6 +1,6 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
# to /etc/nixos/system.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{

View File

@@ -6,100 +6,14 @@
}:
{
imports = [
# Mostly user-specific configuration
../../modules/home-manager/desktop.nix
./variables.nix
../../secrets
# Programs
../../modules/home-manager/accounts
../../modules/home-manager/nixCats
../../modules/home-manager/shell
../../modules/home-manager/aerc.nix
../../modules/home-manager/bitwarden.nix
../../modules/home-manager/direnv.nix
../../modules/home-manager/discord.nix
../../modules/home-manager/ghostty.nix
../../modules/home-manager/git.nix
../../modules/home-manager/gpg.nix
../../modules/home-manager/khal.nix
../../modules/home-manager/kitty.nix
../../modules/home-manager/lazygit.nix
../../modules/home-manager/nh.nix
../../modules/home-manager/rclone.nix
../../modules/home-manager/spicetify.nix
../../modules/home-manager/ssh.nix
../../modules/home-manager/thunar.nix
../../modules/home-manager/thunderbird.nix
../../modules/home-manager/todoman.nix
../../modules/home-manager/vicinae.nix
../../modules/home-manager/zathura.nix
# Scripts
../../modules/home-manager/scripts
# System (Desktop environment like stuff)
../../modules/home-manager/hyprland
../../modules/home-manager/hyprpanel.nix
../../modules/home-manager/hyprpaper.nix
../../modules/home-manager/mime.nix
../../modules/home-manager/udiskie.nix
];
home = {
inherit (config.var) username;
homeDirectory = "/home/" + config.var.username;
packages = with pkgs; [
dotnet-runtime
dafny
gemini-cli
# Apps
bitwarden-desktop # Password manager
vlc # Video player
blanket # White-noise app
obsidian # Note taking app
planify # Todolists
textpieces # Manipulate texts
curtail # Compress images
resources # Ressource monitor
gnome-clocks # Clocks app
gnome-text-editor # Basic graphic text editor
mpv # Video player
brave # Web browser
# Privacy
session-desktop # Session app, private messages
signal-desktop # Signal app, private messages
protonvpn-gui
proton-pass
proton-authenticator
ticktick # Privacy friendly todo app
# Utils
zip
unzip
optipng
jpegoptim
pfetch
btop
fastfetch
# Just cool
peaclock
cbonsai
pipes
cmatrix
# Backup
vscode
libreoffice-qt6-fresh
];
# Don't touch this
stateVersion = "24.05";
};

13
hosts/altair/system.nix Normal file
View File

@@ -0,0 +1,13 @@
{ config, ... }:
{
imports = [
../../modules/nixos/desktop.nix
./hardware-configuration.nix
./variables.nix
];
home-manager.users."${config.var.username}" = import ./home.nix;
system.stateVersion = "24.05";
}

View File

@@ -1,41 +1,10 @@
{ config, ... }:
{
config,
lib,
...
}:
{
imports = [
# Choose your theme here:
../../modules/themes/catppuccin.nix
];
config.var = {
hostname = "altair";
username = "kiri";
configDirectory = "/home/" + config.var.username + "/.config/nixos"; # The path of the nixos configuration directory
keyboardLayout = "us";
hyprsunset.temperature = 2000;
location = "Meterik";
timeZone = "Europe/Amsterdam";
defaultLocale = "en_US.UTF-8";
timeLocale = "en_DK.UTF-8";
numericLocale = "en_IE.UTF-8";
otherLocale = "nl_NL.UTF-8";
git = {
username = "kiri";
email = "mail@jelles.net";
};
preferred = {
editor = "nvim";
terminal = "kitty";
browser = "brave";
};
autoUpgrade = false;
autoGarbageCollector = true;
hyprland = {
workspace = [
"1, monitor:desc:California Institute of Technology 0x1410, persistent:true, default:true"
@@ -52,12 +21,4 @@
];
};
};
# Let this here
options = {
var = lib.mkOption {
type = lib.types.attrs;
default = { };
};
};
}

View File

@@ -1,6 +1,6 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
# to /etc/nixos/system.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{

View File

@@ -5,12 +5,9 @@
}:
{
imports = [
# Mostly user-specific configuration
./variables.nix
../../modules/home-manager/common.nix
# Programs
../../modules/home-manager/shell
../../modules/home-manager/git.nix
./variables.nix
];
home = {
@@ -26,7 +23,6 @@
ghostty
];
# Don't touch this
stateVersion = "24.05";
};

View File

@@ -4,10 +4,7 @@
(modulesPath + "/installer/scan/not-detected.nix")
(modulesPath + "/profiles/qemu-guest.nix")
../../modules/nixos/home-manager.nix
../../modules/nixos/nix.nix
../../modules/nixos/users.nix
../../modules/nixos/utils.nix
../../modules/nixos/common.nix
../../modules/nixos/ssh.nix
../../modules/nixos/caddy.nix
@@ -27,6 +24,5 @@
home-manager.users."${config.var.username}" = import ./home.nix;
# Don't touch this
system.stateVersion = "24.05";
}

View File

@@ -1,48 +1,6 @@
{ config, ... }:
{
config,
lib,
...
}:
{
imports = [
# Choose your theme here:
../../modules/themes/catppuccin.nix
];
config.var = {
hostname = "orion";
username = "kiri";
configDirectory = "/home/" + config.var.username + "/.config/nixos"; # The path of the nixos configuration directory
keyboardLayout = "us";
location = "Meterik";
timeZone = "Europe/Amsterdam";
defaultLocale = "en_US.UTF-8";
timeLocale = "en_DK.UTF-8";
numericLocale = "en_IE.UTF-8";
otherLocale = "nl_NL.UTF-8";
git = {
username = "kiri";
email = "mail@jelles.net";
};
preferred = {
editor = "nvim";
terminal = "kitty";
browser = "brave";
};
autoUpgrade = false;
autoGarbageCollector = true;
};
# Let this here
options = {
var = lib.mkOption {
type = lib.types.attrs;
default = { };
};
};
}

View File

@@ -1,27 +0,0 @@
{ config, ... }:
{
imports = [
# Mostly system related configuration
../../modules/nixos/audio.nix
../../modules/nixos/bluetooth.nix
../../modules/nixos/fonts.nix
../../modules/nixos/home-manager.nix
../../modules/nixos/nix.nix
../../modules/nixos/systemd-boot.nix
../../modules/nixos/sddm.nix
../../modules/nixos/users.nix
../../modules/nixos/utils.nix
#../../modules/nixos/tailscale.nix
../../modules/nixos/hyprland.nix
#../../modules/nixos/docker.nix
# You should let those lines as is
./hardware-configuration.nix
./variables.nix
];
home-manager.users."${config.var.username}" = import ./home.nix;
# Don't touch this
system.stateVersion = "24.05";
}

View File

@@ -1,6 +1,6 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
# to /etc/nixos/system.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{

View File

@@ -6,100 +6,14 @@
}:
{
imports = [
# Mostly user-specific configuration
../../modules/home-manager/desktop.nix
./variables.nix
../../secrets
# Programs
../../modules/home-manager/accounts
../../modules/home-manager/nixCats
../../modules/home-manager/shell
../../modules/home-manager/aerc.nix
../../modules/home-manager/bitwarden.nix
../../modules/home-manager/direnv.nix
../../modules/home-manager/discord.nix
../../modules/home-manager/ghostty.nix
../../modules/home-manager/git.nix
../../modules/home-manager/gpg.nix
../../modules/home-manager/khal.nix
../../modules/home-manager/kitty.nix
../../modules/home-manager/lazygit.nix
../../modules/home-manager/nh.nix
../../modules/home-manager/rclone.nix
../../modules/home-manager/spicetify.nix
../../modules/home-manager/ssh.nix
../../modules/home-manager/thunar.nix
../../modules/home-manager/thunderbird.nix
../../modules/home-manager/todoman.nix
../../modules/home-manager/vicinae.nix
../../modules/home-manager/zathura.nix
# Scripts
../../modules/home-manager/scripts
# System (Desktop environment like stuff)
../../modules/home-manager/hyprland
../../modules/home-manager/hyprpanel.nix
../../modules/home-manager/hyprpaper.nix
../../modules/home-manager/mime.nix
../../modules/home-manager/udiskie.nix
];
home = {
inherit (config.var) username;
homeDirectory = "/home/" + config.var.username;
packages = with pkgs; [
dotnet-runtime
dafny
gemini-cli
# Apps
bitwarden-desktop # Password manager
vlc # Video player
blanket # White-noise app
obsidian # Note taking app
planify # Todolists
textpieces # Manipulate texts
curtail # Compress images
resources # Ressource monitor
gnome-clocks # Clocks app
gnome-text-editor # Basic graphic text editor
mpv # Video player
brave # Web browser
# Privacy
session-desktop # Session app, private messages
signal-desktop # Signal app, private messages
protonvpn-gui
proton-pass
proton-authenticator
# ticktick # Privacy friendly todo app
# Utils
zip
unzip
optipng
jpegoptim
pfetch
btop
fastfetch
# Just cool
peaclock
cbonsai
pipes
cmatrix
# Backup
vscode
libreoffice-qt6-fresh
];
# Don't touch this
stateVersion = "24.05";
};

13
hosts/polaris/system.nix Normal file
View File

@@ -0,0 +1,13 @@
{ config, ... }:
{
imports = [
../../modules/nixos/desktop.nix
./hardware-configuration.nix
./variables.nix
];
home-manager.users."${config.var.username}" = import ./home.nix;
system.stateVersion = "24.05";
}

View File

@@ -1,41 +1,9 @@
{ config, ... }:
{
config,
lib,
...
}:
{
imports = [
# Choose your theme here:
../../modules/themes/catppuccin.nix
];
config.var = {
hostname = "polaris";
username = "kiri";
configDirectory = "/home/" + config.var.username + "/.config/nixos"; # The path of the nixos configuration directory
keyboardLayout = "us";
location = "Meterik";
timeZone = "Europe/Amsterdam";
defaultLocale = "en_US.UTF-8";
timeLocale = "en_DK.UTF-8";
numericLocale = "en_IE.UTF-8";
otherLocale = "nl_NL.UTF-8";
git = {
username = "kiri";
email = "mail@jelles.net";
};
preferred = {
editor = "nvim";
terminal = "kitty";
browser = "brave";
};
autoUpgrade = false;
autoGarbageCollector = true;
hyprsunset.temperature = 3500;
hyprland = {
workspace = [
@@ -54,12 +22,4 @@
];
};
};
# Let this here
options = {
var = lib.mkOption {
type = lib.types.attrs;
default = { };
};
};
}

View File

@@ -0,0 +1,8 @@
{ config, pkgs, ... }:
{
imports = [
../variables.nix
./shell
./git.nix
];
}

View File

@@ -0,0 +1,97 @@
{
pkgs,
config,
inputs,
...
}:
{
imports = [
./common.nix
../../secrets
# Programs
./accounts
./nixCats
./aerc.nix
./bitwarden.nix
./direnv.nix
./discord.nix
./ghostty.nix
./gpg.nix
./khal.nix
./kitty.nix
./lazygit.nix
./nh.nix
./rclone.nix
./spicetify.nix
./ssh.nix
./thunar.nix
./thunderbird.nix
./todoman.nix
./vicinae.nix
./zathura.nix
# Scripts
./scripts
# System (Desktop environment like stuff)
./hyprland
./hyprpanel.nix
./hyprpaper.nix
./hyprsunset.nix
./mime.nix
./udiskie.nix
];
home = {
packages = with pkgs; [
dotnet-runtime
dafny
gemini-cli
# Apps
bitwarden-desktop # Password manager
vlc # Video player
blanket # White-noise app
obsidian # Note taking app
planify # Todolists
textpieces # Manipulate texts
curtail # Compress images
resources # Ressource monitor
gnome-clocks # Clocks app
gnome-text-editor # Basic graphic text editor
mpv # Video player
brave # Web browser
# Privacy
session-desktop # Session app, private messages
signal-desktop # Signal app, private messages
protonvpn-gui
proton-pass
proton-authenticator
ticktick # Privacy friendly todo app
# Utils
zip
unzip
optipng
jpegoptim
pfetch
btop
fastfetch
# Just cool
peaclock
cbonsai
pipes
cmatrix
# Backup
vscode
libreoffice-qt6-fresh
];
};
}

View File

@@ -1,3 +1,4 @@
{ config, ... }:
{
services = {
hyprsunset = {
@@ -12,7 +13,7 @@
}
{
time = "23:00";
temperature = 2000;
temperature = config.var.hyprsunset.temperature;
gamma = 0.8;
}
];

View File

@@ -1,102 +0,0 @@
# Wofi is a launcher for Wayland, inspired by rofi.
{
config,
pkgs,
lib,
...
}:
let
accent = "#${config.lib.stylix.colors.base0D}";
background = "#${config.lib.stylix.colors.base00}";
background-alt = "#${config.lib.stylix.colors.base01}";
foreground = "#${config.lib.stylix.colors.base05}";
font = config.stylix.fonts.serif.name;
rounding = config.theme.rounding;
font-size = config.stylix.fonts.sizes.popups;
in
{
home.packages = with pkgs; [ wofi-emoji ];
programs.wofi = {
enable = true;
settings = {
allow_markup = true;
width = 450;
show = "drun";
prompt = "Apps";
normal_window = true;
height = 305;
allow_images = true;
image_size = 24;
insensitive = true;
hide_scroll = true;
no_actions = true;
gtk_dark = true;
};
style =
lib.mkForce
# css
''
* {
font-family: "${font}";
font-weight: 500;
font-size: ${toString font-size}px;
}
#window {
background-color: ${background};
color: ${foreground};
border-radius: ${toString rounding}px;
}
#outer-box {
padding: 20px;
}
#input {
background-color: ${background-alt};
border: 0px solid ${accent};
color: ${foreground};
padding: 8px 12px;
}
#scroll {
margin-top: 20px;
}
#inner-box {}
#img {
padding-right: 8px;
}
#text {
color: ${foreground};
}
#text:selected {
color: ${foreground};
}
#entry {
padding: 6px;
}
#entry:selected {
background-color: ${accent};
color: ${foreground};
}
#unselected {}
#selected {}
#input,
#entry:selected {
border-radius: ${toString rounding}px;
}
'';
};
}

View File

@@ -1,20 +0,0 @@
# Adguard is a network-wide ad blocker
# When installed, open localhost:3000 to setup
{config, ...}: let
domain = "adguard.hadi.diy";
in {
services = {
adguardhome = {
enable = true;
port = 3000;
};
nginx.virtualHosts."${domain}" = {
useACMEHost = "hadi.diy";
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:${toString config.services.adguardhome.port}";
};
};
};
}

View File

@@ -1,65 +0,0 @@
# *arr is a collection of media management applications.
# See https://github.com/rasmus-kirk/nixarr
# Setup guide: https://nixarr.com/wiki/setup/
{config, ...}: let
domain = "hadi.diy";
mkVirtualHost = port: {
useACMEHost = domain;
forceSSL = true;
locations."/" = {proxyPass = "http://127.0.0.1:${toString port}";};
};
username = config.var.username;
in {
# Add my secrets
sops.secrets = {
recyclarr = {
owner = "recyclarr";
mode = "0777";
};
wireguard-pia = {
group = "media";
mode = "0600";
};
};
nixarr = {
enable = true;
mediaUsers = [username];
mediaDir = "/mnt/data/media";
stateDir = "/mnt/data/.state/nixarr";
vpn = {
enable = true;
wgConf = config.sops.secrets.wireguard-pia.path;
};
jellyfin.enable = true;
jellyseerr.enable = true;
prowlarr.enable = true;
radarr.enable = true;
sonarr.enable = true;
bazarr.enable = true;
readarr.enable = true;
transmission = {
enable = true;
extraSettings = {trash-original-torrent-files = true;};
vpn.enable = true;
};
recyclarr = {
enable = true;
configFile = config.sops.secrets.recyclarr.path;
};
};
services.nginx.virtualHosts = {
"jellyfin.${domain}" = mkVirtualHost 8096;
"jellyseerr.${domain}" = mkVirtualHost 5055;
"bazarr.${domain}" = mkVirtualHost 6767;
"prowlarr.${domain}" = mkVirtualHost 9696;
"radarr.${domain}" = mkVirtualHost 7878;
"sonarr.${domain}" = mkVirtualHost 8989;
"transmission.${domain}" = mkVirtualHost 9091;
"readarr.${domain}" = mkVirtualHost 8787;
};
}

10
modules/nixos/common.nix Normal file
View File

@@ -0,0 +1,10 @@
{ config, pkgs, ... }:
{
imports = [
./home-manager.nix
./nix.nix
./users.nix
./utils.nix
../variables.nix
];
}

12
modules/nixos/desktop.nix Normal file
View File

@@ -0,0 +1,12 @@
{ config, pkgs, ... }:
{
imports = [
./common.nix
./audio.nix
./bluetooth.nix
./fonts.nix
./sddm.nix
./hyprland.nix
./systemd-boot.nix
];
}

View File

@@ -1,6 +0,0 @@
# Docker is a containerization platform that allows you to run applications in isolated environments called containers.
{ config, ... }:
{
virtualisation.docker.enable = true;
users.users."${config.var.username}".extraGroups = [ "docker" ];
}

View File

@@ -1,35 +0,0 @@
{
config,
inputs,
pkgs,
...
}:
{
users.groups.eleakxir = { };
users.users.hadi.extraGroups = [ "eleakxir" ];
services.eleakxir = {
enable = true;
port = 9198;
user = "eleakxir";
group = "eleakxir";
limit = 1000;
folders = [
"/var/lib/eleakxir/leaks/"
"/mnt/data/clean-leak/"
];
debug = true;
};
environment.systemPackages = [
inputs.eleakxir.packages.${pkgs.stdenv.hostPlatform.system}.leak-utils
];
services.nginx.virtualHosts."eleakxir-back.hadi.diy" = {
useACMEHost = "hadi.diy";
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:${toString config.services.eleakxir.port}";
};
};
}

View File

@@ -1,353 +0,0 @@
# Glance is a self-hosted homepage/dashboard service.
{
config,
lib,
...
}: let
domain = "start.hadi.diy";
rgb-to-hsl = color: let
r = ((lib.toInt config.lib.stylix.colors."${color}-rgb-r") * 100.0) / 255;
g = ((lib.toInt config.lib.stylix.colors."${color}-rgb-g") * 100.0) / 255;
b = ((lib.toInt config.lib.stylix.colors."${color}-rgb-b") * 100.0) / 255;
max = lib.max r (lib.max g b);
min = lib.min r (lib.min g b);
delta = max - min;
fmod = base: int: base - (int * builtins.floor (base / int));
h =
if delta == 0
then 0
else if max == r
then 60 * (fmod ((g - b) / delta) 6)
else if max == g
then 60 * (((b - r) / delta) + 2)
else if max == b
then 60 * (((r - g) / delta) + 4)
else 0;
l = (max + min) / 2;
s =
if delta == 0
then 0
else 100 * delta / (100 - lib.max (2 * l - 100) (100 - (2 * l)));
roundToString = value: toString (builtins.floor (value + 0.5));
in
lib.concatMapStringsSep " " roundToString [h s l];
in {
# TODO: Add tailscale custom widget
services = {
glance = {
enable = true;
settings = {
theme = {
contrast-multiplier = lib.mkForce 1.4;
};
pages = [
{
hide-desktop-navigation = true;
columns = [
{
size = "small";
widgets = [
{
type = "clock";
hour-format = "24h";
}
{
type = "weather";
location = "Paris, France";
}
{
type = "markets";
markets = [
{
symbol = "BTC-USD";
name = "Bitcoin";
chart-link = "https://www.tradingview.com/chart/?symbol=INDEX:BTCUSD";
}
{
symbol = "SOL-USD";
name = "Solana";
chart-link = "https://www.tradingview.com/chart/?symbol=INDEX:SOLUSD";
}
{
symbol = "ETH-USD";
name = "Ethereum";
chart-link = "https://www.tradingview.com/chart/?symbol=INDEX:ETHUSD";
}
];
}
{
type = "dns-stats";
service = "adguard";
url = "https://adguard.hadi.diy";
username = "hadi";
password = "\${secret:adguard-pwd}";
}
];
}
{
size = "full";
widgets = [
{
type = "search";
search-engine = "duckduckgo";
}
{
type = "bookmarks";
groups = [
{
title = "";
same-tab = true;
color = "200 50 50";
links = [
{
title = "ProtonMail";
url = "https://proton.me/mail";
}
{
title = "Github";
url = "https://github.com";
}
{
title = "Youtube";
url = "https://youtube.com";
}
{
title = "Figma";
url = "https://figma.com";
}
];
}
{
title = "Docs";
same-tab = true;
color = "200 50 50";
links = [
{
title = "Nixpkgs repo";
url = "https://github.com/NixOS/nixpkgs";
}
{
title = "Nixvim";
url = "https://nix-community.github.io/nixvim/";
}
{
title = "Hyprland wiki";
url = "https://wiki.hyprland.org/";
}
{
title = "Search NixOS";
url = "https://search-nixos.hadi.diy";
}
];
}
{
title = "Homelab";
same-tab = true;
color = "100 50 50";
links = [
{
title = "Router";
url = "http://192.168.1.254/";
}
{
title = "Cloudflare";
url = "https://dash.cloudflare.com/";
}
];
}
{
title = "Work";
same-tab = true;
color = "50 50 50";
links = [
{
title = "Outlook";
url = "https://outlook.office.com/";
}
{
title = "Teams";
url = "https://teams.microsoft.com/";
}
{
title = "Office";
url = "https://www.office.com/";
}
];
}
{
title = "Cyber";
same-tab = true;
color = rgb-to-hsl "base09";
links = [
{
title = "CyberChef";
url = "https://cyberchef.org/";
}
{
title = "TryHackMe";
url = "https://tryhackme.com/";
}
{
title = "RootMe";
url = "https://www.root-me.org/";
}
{
title = "Exploit-DB";
url = "https://www.exploit-db.com/";
}
{
title = "CrackStation";
url = "https://crackstation.net/";
}
];
}
{
title = "Misc";
same-tab = true;
color = rgb-to-hsl "base01";
links = [
{
title = "Svgl";
url = "https://svgl.app/";
}
{
title = "Excalidraw";
url = "https://excalidraw.com/";
}
{
title = "Cobalt (Downloader)";
url = "https://cobalt.tools/";
}
{
title = "Mazanoke (Image optimizer)";
url = "https://mazanoke.com/";
}
{
title = "Vert (File converter)";
url = "https://vert.sh/";
}
];
}
];
}
{
type = "server-stats";
servers = [
{
type = "local";
name = "Jack";
}
];
}
{
type = "group";
widgets = [
{
type = "monitor";
title = "Services";
cache = "1m";
sites = [
{
title = "Vaultwarden";
url = "https://vault.hadi.diy";
icon = "si:bitwarden";
}
{
title = "Nextcloud";
url = "https://cloud.hadi.diy";
icon = "si:nextcloud";
}
{
title = "Adguard";
url = "https://adguard.hadi.diy";
icon = "si:adguard";
}
{
title = "Mealie";
url = "https://mealie.hadi.diy";
icon = "si:mealie";
}
];
}
{
type = "monitor";
title = "*arr";
cache = "1m";
sites = [
{
title = "Jellyfin";
url = "https://jellyfin.hadi.diy";
icon = "si:jellyfin";
}
{
title = "Jellyseerr";
url = "https://jellyseerr.hadi.diy";
icon = "si:odysee";
}
{
title = "Radarr";
url = "https://radarr.hadi.diy";
icon = "si:radarr";
}
{
title = "Sonarr";
url = "https://sonarr.hadi.diy";
icon = "si:sonarr";
}
{
title = "Prowlarr";
url = "https://prowlarr.hadi.diy";
icon = "si:podcastindex";
}
{
title = "Transmission";
url = "https://transmission.hadi.diy";
icon = "si:transmission";
}
];
}
];
}
];
}
];
name = "Home";
}
];
server = {port = 5678;};
};
};
nginx.virtualHosts."${domain}" = {
useACMEHost = "hadi.diy";
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:${
toString config.services.glance.settings.server.port
}";
};
};
};
systemd.services.glance = {
serviceConfig = {
DynamicUser = lib.mkForce false;
User = "glance";
Group = "glance";
};
};
users = {
groups.glance = {};
users.glance = {
isSystemUser = true;
description = "Glance user";
group = "glance";
};
};
sops.secrets.adguard-pwd = {
owner = "glance";
mode = "0600";
};
}

View File

@@ -1,19 +0,0 @@
# Mealie is a recipe management and meal planning application.
{config, ...}: let
domain = "mealie.hadi.diy";
in {
services = {
mealie = {
enable = true;
port = 8092;
};
nginx.virtualHosts."${domain}" = {
useACMEHost = "hadi.diy";
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:${toString config.services.mealie.port}";
};
};
};
}

View File

@@ -1,45 +0,0 @@
# Nginx is a web server that can also be used as a reverse proxy, load balancer, and HTTP cache.
{config, ...}: let
domain = "hadi.diy";
in {
security.acme = {
acceptTerms = true;
defaults.email = config.var.git.email;
certs."${domain}" = {
domain = "${domain}";
extraDomainNames = ["*.${domain}"];
group = "nginx";
dnsProvider = "cloudflare";
dnsPropagationCheck = true;
credentialsFile = config.sops.secrets.cloudflare-dns-token.path;
};
};
# Return 444 for all requests not matching a used subdomain.
services.nginx = {
enable = true;
virtualHosts = {
"default" = {
default = true;
locations."/" = {return = 444;};
};
"*.${domain}" = {
useACMEHost = domain;
forceSSL = true;
locations."/" = {return = 444;};
};
"aaaaaa.${domain}" = {
useACMEHost = domain;
forceSSL = true;
locations."/" = {return = 444;};
};
};
};
networking.firewall = {
allowedTCPPorts = [80 443];
allowedUDPPorts = [80 443];
};
sops.secrets.cloudflare-dns-token = {path = "/etc/cloudflare/dnskey.txt";};
}

View File

@@ -1,63 +0,0 @@
# Omen laptop configuration for NixOS
# Import this only if you have an HP Omen laptop
{
config,
pkgs,
...
}: let
hp-omen-linux-module =
pkgs.callPackage
({
kernel ? config.boot.kernelPackages.kernel,
stdenv,
fetchFromGitHub,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "hp-omen-linux-module";
version = "rebase-6.14";
src = fetchFromGitHub {
owner = "ranisalt";
repo = "hp-omen-linux-module";
rev = finalAttrs.version;
sha256 = "sha256-2zCm29bdboSjRm/caMjBPGNc0tZXPUnIIYlHxxfhAok=";
};
setSourceRoot = ''
export sourceRoot=$(pwd)/${finalAttrs.src.name}/src
'';
nativeBuildInputs = kernel.moduleBuildDependencies;
makeFlags = [
"KERNELDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
];
installPhase = ''
runHook preInstall
install hp-wmi.ko -Dm444 -t $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/platform/x86/hp/
runHook postInstall
'';
})) {kernel = config.boot.kernelPackages.kernel;};
in {
boot.extraModulePackages = [hp-omen-linux-module];
boot.kernelModules = ["hp-wmi"];
users.groups.omen-rgb = {};
users.users.${config.var.username}.extraGroups = ["omen-rgb"];
systemd.tmpfiles.rules = [
"w /sys/devices/platform/hp-wmi/rgb_zones/zone00 0660 root omen-rgb -"
"w /sys/devices/platform/hp-wmi/rgb_zones/zone01 0660 root omen-rgb -"
"w /sys/devices/platform/hp-wmi/rgb_zones/zone02 0660 root omen-rgb -"
"w /sys/devices/platform/hp-wmi/rgb_zones/zone03 0660 root omen-rgb -"
];
services.udev.extraRules = ''
SUBSYSTEM=="platform", KERNEL=="hp-wmi", ACTION=="add", \
RUN+="${pkgs.coreutils-full}/bin/sleep 2", \
RUN+="${pkgs.coreutils}/bin/chgrp omen-rgb /sys/devices/platform/hp-wmi/rgb_zones/zone00", \
RUN+="${pkgs.coreutils}/bin/chmod 0660 /sys/devices/platform/hp-wmi/rgb_zones/zone00", \
RUN+="${pkgs.coreutils}/bin/chgrp omen-rgb /sys/devices/platform/hp-wmi/rgb_zones/zone01", \
RUN+="${pkgs.coreutils}/bin/chmod 0660 /sys/devices/platform/hp-wmi/rgb_zones/zone01", \
RUN+="${pkgs.coreutils}/bin/chgrp omen-rgb /sys/devices/platform/hp-wmi/rgb_zones/zone02", \
RUN+="${pkgs.coreutils}/bin/chmod 0660 /sys/devices/platform/hp-wmi/rgb_zones/zone02", \
RUN+="${pkgs.coreutils}/bin/chgrp omen-rgb /sys/devices/platform/hp-wmi/rgb_zones/zone03", \
RUN+="${pkgs.coreutils}/bin/chmod 0660 /sys/devices/platform/hp-wmi/rgb_zones/zone03"
'';
}

41
modules/variables.nix Normal file
View File

@@ -0,0 +1,41 @@
{ config, lib, ... }:
{
imports = [
./themes/catppuccin.nix
];
config.var = {
username = "kiri";
configDirectory = "/home/" + config.var.username + "/.config/nixos";
keyboardLayout = "us";
location = "Meterik";
timeZone = "Europe/Amsterdam";
defaultLocale = "en_US.UTF-8";
timeLocale = "en_DK.UTF-8";
numericLocale = "en_IE.UTF-8";
otherLocale = "nl_NL.UTF-8";
git = {
username = "kiri";
email = "mail@jelles.net";
};
preferred = {
editor = "nvim";
terminal = "kitty";
browser = "brave";
};
autoUpgrade = false;
autoGarbageCollector = true;
};
options = {
var = lib.mkOption {
type = lib.types.attrs;
default = { };
};
};
}