refactor *started*

This commit is contained in:
martyTF 2026-03-30 22:03:03 +02:00
parent d0413cb830
commit db2103a37d
103 changed files with 1008 additions and 786 deletions

42
modules/system/boot.nix Normal file
View file

@ -0,0 +1,42 @@
{
config,
lib,
pkgs,
inputs,
...
}:
{
system = {
autoUpgrade = {
enable = false;
allowReboot = false;
};
};
boot = {
loader = {
systemd-boot = {
enable = true;
editor = false;
};
timeout = 3;
efi.canTouchEfiVariables = true;
};
kernelPackages = pkgs.linuxPackages_zen;
kernel = {
sysctl = {
"vm.swappiness" = 10;
};
};
};
services = {
dbus.implementation = "broker";
};
hardware = {
graphics = {
enable = true;
enable32Bit = true;
};
};
}

View file

@ -0,0 +1,18 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [
./boot.nix
./shell.nix
./networking.nix
./localization.nix
./fira-code.nix
./nixos-cli.nix
./ssh.nix
];
}

View file

@ -0,0 +1,10 @@
{
config,
pkgs,
lib,
...
}:
{
environment.systemPackages = [ pkgs.nerd-fonts.fira-code ];
}

View file

@ -0,0 +1,51 @@
{
config,
pkgs,
lib,
...
}:
let
timezone = config.system.timezone;
language = config.system.language;
locale = config.system.locale;
in
{
options = {
system = {
timezone = lib.mkOption {
default = "Europe/Berlin";
description = "timezone";
};
language = lib.mkOption {
default = "en_GB.UTF-8";
description = "language";
};
locale = lib.mkOption {
default = "de_DE.UTF-8";
description = "locale";
};
};
};
config = {
time.timeZone = timezone;
i18n = {
defaultLocale = language;
extraLocaleSettings = {
LC_ADDRESS = locale;
LC_IDENTIFICATION = locale;
LC_MEASUREMENT = locale;
LC_MONETARY = locale;
LC_NAME = locale;
LC_NUMERIC = locale;
LC_PAPER = locale;
LC_TELEPHONE = locale;
LC_TIME = locale;
};
};
console.keyMap = builtins.substring 0 2 locale;
};
}

View file

@ -0,0 +1,41 @@
{ config, pkgs, ... }:
{
networking = {
networkmanager.enable = true;
firewall = {
enable = true;
allowedUDPPorts = [
config.services.tailscale.port
53317
16261
16262
];
allowedTCPPorts = [
53317
16261
16262
];
trustedInterfaces = [ "tailscale0" ];
};
};
services = {
tailscale = {
enable = true;
extraSetFlags = [
"--ssh"
];
};
};
hardware = {
bluetooth = {
enable = true;
powerOnBoot = true;
settings = {
General = {
Experimental = true;
};
};
};
};
}

View file

@ -0,0 +1,10 @@
{
config,
pkgs,
lib,
...
}:
{
programs.nixos-cli.enable = true;
}

15
modules/system/shell.nix Normal file
View file

@ -0,0 +1,15 @@
{ config, pkgs, ... }:
{
environment = {
systemPackages = with pkgs; [
coreutils
util-linux
];
};
programs = {
fish.enable = true;
bash.enable = true;
zsh.enable = true;
};
}

13
modules/system/ssh.nix Normal file
View file

@ -0,0 +1,13 @@
{ config, pkgs, ... }:
{
services = {
openssh = {
enable = true;
settings = {
PermitRootLogin = "no";
PasswordAuthentication = false;
};
};
};
}