overlays refactor

This commit is contained in:
Lennart J. Kurzweg (Nx2)
2025-06-17 19:48:31 +02:00
parent fbd045d53e
commit d2d1ce7830
103 changed files with 156 additions and 323 deletions

View File

@@ -1,4 +1,4 @@
{ pkgs, hyper, lib, ... }:
{ pkgs, ... }@all: with all;
lib.mkIf (hyper.host != "NxACE")
{
environment.systemPackages = with pkgs; [

View File

@@ -1,4 +1,4 @@
{ config, pkgs, hyper, inputs, ... }:
{ pkgs, ... }@all: with all;
let
grub-theme-ascii-diana = (pkgs.fetchFromGitea {
domain = "git.${hyper.domain}";

View File

@@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, ... }@all: with all;
{
systemd.timers."nx_cal_dicos" = {
enable = true;

View File

@@ -1,4 +1,4 @@
{ config, pkgs, hyper, ... }:
{ pkgs, ... }@all: with all;
{
systemd.timers."nx_cal_lec" = {
enable = true;

View File

@@ -1,4 +1,4 @@
{ config, pkgs, hyper, ... }:
{ pkgs, ... }@all: with all;
{
systemd.timers."nx_cal_lr" = {
enable = true;

View File

@@ -1,4 +1,4 @@
{ pkgs, hyper, ... }:
{ pkgs, ... }@all: with all;
let
radicale-root = "/var/lib/radicale";
web-root = "/var/nginx/webroot";

View File

@@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, ... }@all: with all;
{
environment.systemPackages = with pkgs; [

View File

@@ -1,4 +1,4 @@
{ pkgs, hyper, ... }:
{ pkgs, ... }@all: with all;
{
services.greetd = {
enable = true;

View File

@@ -1,4 +1,4 @@
{ pkgs, hyper, ... }:
{ pkgs, ... }@all: with all;
{
environment.systemPackages = with pkgs; [

View File

@@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, ... }@all: with all;
{
# i18n.inputMethod = {
# type = "fcitx5";

View File

@@ -1,4 +1,4 @@
{ pkgs, rice, ... }:
{ pkgs, ... }@all: with all;
{
fonts.packages = with pkgs; [
noto-fonts

View File

@@ -1,4 +1,4 @@
{ config, pkgs, ...}:
{ pkgs, ... }@all: with all;
{
environment = {

View File

@@ -1,5 +1,5 @@
{ pkgs, hyper, ... }:
pkgs.lib.mkIf (hyper.host == "NxNORTH" || hyper.host == "NxACE")
{ pkgs, ... }@all: with all;
lib.mkIf (hyper.host == "NxNORTH" || hyper.host == "NxACE")
{
programs = {
steam = {

View File

@@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, ... }@all: with all;
{
environment.systemPackages = with pkgs; [
gnupg

View File

@@ -1,4 +1,4 @@
{ config, pkgs, hyper, modulesPath, ... }:
{ pkgs, ... }@all: with all;
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
@@ -29,19 +29,19 @@
{ device = "/dev/disk/by-label/swap"; }
];
networking.useDHCP = pkgs.lib.mkDefault true;
networking.useDHCP = lib.mkDefault true;
hardware.cpu.intel.updateMicrocode = pkgs.lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
# from nixos-hardware
services.thermald.enable = pkgs.lib.mkDefault true;
services.thermald.enable = lib.mkDefault true;
boot.extraModprobeConfig = if hyper.host == "NxXPS" then ''
options iwlwifi 11n_disable=8
'' else "";
boot.initrd.kernelModules = if hyper.host == "NxXPS" then [ "i915" ] else [];
environment.variables = if hyper.host == "NxXPS" then {
VDPAU_DRIVER = pkgs.lib.mkIf config.hardware.graphics.enable (pkgs.lib.mkDefault "va_gl");
VDPAU_DRIVER = lib.mkIf config.hardware.graphics.enable (lib.mkDefault "va_gl");
} else {};
hardware.graphics.extraPackages = if hyper.host == "NxXPS" then with pkgs; [

View File

@@ -1,5 +1,5 @@
{ pkgs, hyper, ... }:
pkgs.lib.mkIf (hyper.host != "NxACE")
{ pkgs, ... }@all: with all;
lib.mkIf (hyper.host != "NxACE")
{
systemd.timers."health_reminder" = {
enable = true;

View File

@@ -1,4 +1,4 @@
{ pkgs, lib, host, secrets, ... }:
{ pkgs, ... }@all: with all;
{
environment.systemPackages = with pkgs; [
strongswanNM

View File

@@ -1,4 +1,4 @@
{ pkgs, hyper, ... }:
{ pkgs, ... }@all: with all;
let p = pkgs; in
{
environment.systemPackages = with p; [

View File

@@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, ... }@all: with all;
{
services.kanata = {
enable = true;

View File

@@ -1,4 +1,4 @@
{ pkgs, lib, host, ... }:
{ pkgs, ... }@all: with all;
lib.mkIf (host == "NxACE")
{}
# {

View File

@@ -1,4 +1,4 @@
{ pkgs, hyper, secrets, ... }:
{ pkgs, ... }@all: with all;
{
# sops.secrets = {
# "wireless-networking.env" = {};

View File

@@ -1,5 +1,5 @@
{ config, pkgs, hyper, ... }:
pkgs.lib.mkIf hyper.nvidia.enable
{ pkgs, ... }@all: with all;
lib.mkIf hyper.nvidia.enable
{
environment.systemPackages = with pkgs; [
lshw
@@ -21,7 +21,7 @@ pkgs.lib.mkIf hyper.nvidia.enable
hardware = {
nvidia = {
prime = pkgs.lib.mkIf hyper.nvidia.prime {
prime = lib.mkIf hyper.nvidia.prime {
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
offload = {

View File

@@ -1,4 +1,4 @@
{ config, pkgs, hyper, secrets, ... }:
{ pkgs, ... }@all: with all;
let dns-user = "cloudflare"; in
{
sops.secrets = {

View File

@@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, ... }@all: with all;
{
services = {
audiobookshelf = {

View File

@@ -1,4 +1,4 @@
{ config, pkgs, hyper, ... }:
{ pkgs, ... }@all: with all;
{
sops.secrets = {
# "nx2site/namecheap.pw" = { };

View File

@@ -1,4 +1,4 @@
{ config, pkgs, hyper, secrets, ... }:
{ pkgs, ... }@all: with all;
let git-user = "git"; in
{
sops.secrets = {

View File

@@ -1,4 +1,4 @@
{ pkgs, hyper, ... }:
{ pkgs, ... }@all: with all;
{
services = {
open-web-calendar = {

View File

@@ -1,4 +1,4 @@
{ config, pkgs, hyper, secrets, ... }:
{ pkgs, ... }@all: with all;
let paperless-user = "paperless"; in
{
sops.secrets = {

View File

@@ -44,7 +44,7 @@
# appendConfig = '''';
clientMaxBodySize = "20m";
defaultHTTPListenPort = 80;
defaultListenAddresses = [ "0.0.0.0" ] ++ pkgs.lib.optional config.networking.enableIPv6 "[::0]";
defaultListenAddresses = [ "0.0.0.0" ] ++ lib.optional config.networking.enableIPv6 "[::0]";
defaultListen = dl;
defaultMimeTypes = "${pkgs.mailcap}/etc/nginx/mime.types";
defaultSSLListenPort = 443;
@@ -138,7 +138,7 @@
listen = dl;
locations = { "/" = { proxyPass = "http://127.0.0.1:8441"; }; };
};
"dav.${hyper.domain}" = pkgs.lib.mkIf config.services.radicale.enable (vh // {
"dav.${hyper.domain}" = lib.mkIf config.services.radicale.enable (vh // {
listen = dl;
locations = { "/" = { proxyPass = "http://127.0.0.1:5232"; }; };
});

View File

@@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, ... }@all: with all;
{
environment.systemPackages = [
(pkgs.mkYarnPackage {

View File

@@ -1,4 +1,4 @@
{ config, pkgs, hyper, secrets, ... }:
{ pkgs, ... }@all: with all;
{
sops.secrets = {
"nx2site/vaultwarden.env" = {

View File

@@ -1,9 +1,9 @@
{ pkgs, hyper, ... }:
{ pkgs, ... }@all: with all;
{
services.ollama = {
package = if hyper.nvidia.enable then pkgs.ollama-cuda else pkgs.ollama;
enable = true;
acceleration = pkgs.lib.mkIf hyper.nvidia.enable "cuda";
acceleration = lib.mkIf hyper.nvidia.enable "cuda";
host = if hyper.host == "NxACE" then "0.0.0.0" else "127.0.0.1";
port = 11434;
environmentVariables = {

View File

@@ -1,4 +1,4 @@
{ config, pkgs, lib, ... }:
{ pkgs, ... }@all: with all;
{
services = {
postgresql = {

View File

@@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, ... }@all: with all;
{
hardware.keyboard.qmk.enable = true;

View File

@@ -3,7 +3,7 @@
hardware.sane = {
enable = true;
};
services.avahi = {
services.avahi.nssmdns4 = {
enable = true;
nssmdns = true;
};

View File

@@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, ... }@all: with all;
{
environment.systemPackages = with pkgs; [
age

View File

@@ -1,4 +1,4 @@
{ config, pkgs, lib, ... }:
{ pkgs, ... }@all: with all;
{
services.pipewire = {

View File

@@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, ... }@all: with all;
{
environment.etc = {
"ssl/certs/tuda-eduroam-root.crt".source = "${pkgs.cacert.unbundled}/etc/ssl/certs/T-TeleSec_GlobalRoot_Class_2:1.crt";

View File

@@ -1,4 +1,4 @@
{ pkgs, hyper, ... }:
{ pkgs, ... }@all: with all;
{
users.defaultUserShell = pkgs.bash; # if interactive, itll switch to fish

View File

@@ -1,7 +1,7 @@
{ pkgs, hyper, ... }:
{ pkgs, ... }@all: with all;
{
config = pkgs.lib.mkIf (hyper.host == "NxNORTH") {
config = lib.mkIf (hyper.host == "NxNORTH") {
environment.systemPackages = with pkgs; [
virtiofsd
];

View File

@@ -1,5 +1,5 @@
{ pkgs, hyper, ... }:
pkgs.lib.mkIf (hyper.host == "NxXPS")
{ pkgs, ... }@all: with all;
lib.mkIf (hyper.host == "NxXPS")
{
programs.ydotool.enable = true;
}