refactor start

This commit is contained in:
Spectre 2025-02-18 11:19:45 +01:00
parent bd49791e06
commit e46d25f0b7
16699 changed files with 2 additions and 1484887 deletions

View file

@ -1,10 +0,0 @@
{...}: {
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# jack.enable = true;
};
}

View file

@ -1,10 +0,0 @@
{pkgs, ...}: {
users.mutableUsers = false;
users.users.root.password = "nixos";
services.getty.autologinUser = "root";
environment.systemPackages = with pkgs; [
vim
git
];
}

View file

@ -1,3 +0,0 @@
{...}: {
hardware.bluetooth.enable = true;
}

View file

@ -1,6 +0,0 @@
{pkgs, ...}: {
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
}

View file

@ -1,10 +0,0 @@
{...}: {
services.btrfs.autoScrub = {
enable = true;
interval = "Fri 07:00";
fileSystems = [
"/persist"
"/nix"
];
};
}

View file

@ -1,31 +0,0 @@
{pkgs, ...}: {
boot.tmp.useTmpfs = true;
time.timeZone = "Europe/Berlin";
environment.systemPackages = with pkgs; [
age
compsize
duf
eza
bat
file
htop
btop
git
jq
yq
du-dust
ranger
ripgrep
papirus-icon-theme
sops
wget
wireguard-tools
zip
];
environment.pathsToLink = ["/share/zsh"];
system.stateVersion = "24.11";
}

View file

@ -1,52 +0,0 @@
{
conf,
nixpkgs,
home-manager,
...
} @ inputs: let
inherit (conf) system;
pkgs = import ./nixpkgs.nix {inherit system nixpkgs;};
specialArgs = inputs;
in {
base = nixpkgs.lib.nixosSystem {
inherit system specialArgs;
modules = [
./common.nix
./options.nix
conf.extraConfig
conf.hardware-configuration
./base.nix
./boot.nix
];
};
full = nixpkgs.lib.nixosSystem {
inherit system specialArgs;
modules = [
./common.nix
./options.nix
./packages.nix
conf.extraConfig
conf.hardware-configuration
./full.nix
./boot.nix
home-manager.nixosModules.home-manager
({config, ...}: {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = specialArgs // {system-config = config;};
};
})
];
};
}

View file

@ -1,8 +0,0 @@
{conf, ...}: {
environment.variables = {
EDITOR = "hx";
VISUAL = "hx";
FLAKE = "${conf.home}/nixos";
ELECTRON_OZONE_PLATFORM_HINT = "auto";
};
}

View file

@ -1,7 +0,0 @@
{pkgs, ...}: {
fonts.packages = with pkgs; [
(nerdfonts.override {fonts = ["JetBrainsMono"];})
twemoji-color-font
];
}

View file

@ -1,25 +0,0 @@
{lib, config, conf, ...}: {
imports = [
./audio.nix
./env.nix
./networking.nix
./persistence.nix
./bluetooth.nix
./btrfs.nix
./fonts.nix
./hardware.nix
./nix.nix
./nfs.nix
./users.nix
./sops.nix
./ssh.nix
./steam.nix
./stylix.nix
./syncthing.nix
./wayland.nix
./zsh.nix
./ollama.nix
];
}

View file

@ -1,3 +0,0 @@
{...}: {
hardware.i2c.enable = true;
}

View file

@ -1,26 +0,0 @@
{conf, ...}: {
networking.hostName = conf.hostname;
networking.networkmanager = {
enable = true;
wifi.macAddress = "random";
ethernet.macAddress = "random";
};
networking.firewall = {
enable = true;
allowedTCPPorts = [
22 # ssh
22000 # syncthing
];
extraCommands = ''
ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN
ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN
'';
extraStopCommands = ''
ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN || true
ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN || true
'';
};
}

View file

@ -1,13 +0,0 @@
{ ... }: {
fileSystems."/mnt/nas" = {
device = "nixserver:/share";
fsType = "nfs";
options = [
"nfsvers=4.2"
"noauto"
"x-systemd.automount"
"x-systemd.idle-timeout=600"
"_netdev"
];
};
}

View file

@ -1,17 +0,0 @@
{...}: {
nix = {
gc = {
automatic = true;
dates = "05:30";
options = "--delete-older-than 7d";
};
settings = {
keep-outputs = true;
auto-optimise-store = true;
experimental-features = ["nix-command" "flakes"];
trusted-users = ["root" "@wheel"];
};
};
nixpkgs.config.allowUnfree = true;
}

View file

@ -1,8 +0,0 @@
{
nixpkgs,
system,
}:
import nixpkgs {
inherit system;
config.allowUnfree = true;
}

View file

@ -1,8 +0,0 @@
{ options, lib, ...}: {
options = lib.mkIf options.ollama.enable {
services.ollama = {
enable = true;
acceleration = "rocm";
};
};
}

View file

@ -1,12 +0,0 @@
{lib, ...}: {
options.gaming.enable = lib.mkEnableOption "Enable gaming";
options.ollama.enable = lib.mkEnableOption "Install Ollama for local LLMs";
options.hyprlandOverrides = lib.mkOption {
# type = lib.types.attributeSet;
default = {};
example = lib.literalExpression ''{ }'';
description = lib.mdDoc ''Override default Hyprland options in hm'';
};
}

View file

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

View file

@ -1,32 +0,0 @@
{impermanence, conf, lib, config, ...}: {
imports = [impermanence.nixosModule];
environment.persistence."/persist/data" = {
hideMounts = true;
directories = [
"/etc/NetworkManager/system-connections"
"/var/lib/systemd/coredump"
"/var/lib/bluetooth"
];
files = [];
users.${conf.user} = (import ../home/persist.nix { inherit config lib; }).data;
};
environment.persistence."/persist/cache" = {
hideMounts = true;
directories = [
"/root/.cache/nix"
"/var/lib/btrfs"
"/var/lib/nixos"
"/var/lib/systemd/backlight"
"/var/lib/systemd/timers"
"/var/log"
];
files = [
"/etc/machine-id"
];
users.${conf.user} = (import ../home/persist.nix { inherit config lib; }).cache;
};
}

View file

@ -1,6 +0,0 @@
{sops-nix, conf, ...}: {
imports = [sops-nix.nixosModules.sops];
sops = {
age.keyFile = /persist/data${conf.home}/.config/sops/age/keys.txt;
};
}

View file

@ -1,11 +0,0 @@
{...}: {
networking.firewall.allowedTCPPorts = [22];
services.openssh = {
enable = true;
ports = [22];
settings = {
PermitRootLogin = "no";
PasswordAuthentication = false;
};
};
}

View file

@ -1,12 +0,0 @@
{
lib,
config,
...
}: {
config = lib.mkIf config.gaming.enable {
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
};
};
}

View file

@ -1,34 +0,0 @@
{stylix, pkgs, config, ...}: {
imports = [stylix.nixosModules.stylix];
stylix = {
enable = true;
image = ../wallpapers/default.png;
polarity = "dark";
opacity = {
terminal = 0.8;
popups = 0.8;
};
fonts = {
monospace = {
package = (pkgs.nerdfonts.override {fonts = ["JetBrainsMono"];});
name = "JetBrainsMono Nerd Font";
};
emoji = {
package = pkgs.twemoji-color-font;
name = "Twemoji";
};
sizes = { applications = 14; desktop = 12; popups = 12; terminal = 14; };
};
cursor = {
package = pkgs.rose-pine-cursor;
name = "Rosé Pine";
};
};
}

View file

@ -1,47 +0,0 @@
{ conf, config, ...}: {
sops.secrets."syncthing/key.pem" = {
sopsFile = ../hosts/${conf.hostname}/secrets/default.yaml;
};
sops.secrets."syncthing/cert.pem" = {
sopsFile = ../hosts/${conf.hostname}/secrets/default.yaml;
};
services.syncthing = {
enable = true;
user = conf.user;
dataDir = "/home/${conf.user}/sync";
configDir = "/home/${conf.user}/.config/syncthing";
overrideDevices = true;
overrideFolders = true;
settings = {
key = config.sops.secrets."syncthing/key.pem".path;
cert = config.sops.secrets."syncthing/cert.pem".path;
devices = {
"phone" = {id = "C2CKYRP-72UNJRX-MUPZIUY-CCHQYGF-6T4NA6B-MO7AEZB-RSN5EAG-CN2JCAF";};
"nixserver" = {id = "DW6GTZ3-3JPAHLO-UEB3LBL-AWOX3BT-QPI7ODT-OZ6Q4YR-K3KK22C-5RY3XQZ";};
"lilith-pc" = {id = "37HHP4Q-NNQRQPQ-MVSIHAX-BK2A3GL-O6K4WXA-Y7ZQ5GZ-BY4UTFH-LG4HYAY";};
"lilith-pad" = {id = "GQJA6WA-G5YZZSN-4OOQMVE-JPIR22N-VFHPY4O-XMRG37D-DALH4R2-7DCTMQK";};
"lilith-old" = {id = "MSUZJ6K-4CIFE5D-ILO6FE4-SPRPTZI-VEWZQ7F-ECARCCF-2VLVMDQ-2HQUAAS";};
};
folders = {
"rdcj2-mfyb4" = {
path = "/home/lilith/sync";
devices = ["phone" "nixserver" "lilith-pad" "lilith-pc" "lilith-old"];
};
"sdpfs-2beqd" = {
path = "/home/lilith/.keepass";
devices = ["phone" "nixserver" "lilith-pad" "lilith-pc" "lilith-old"];
};
"7qim7-yzqpn" = {
path = "/home/lilith/obsidian";
devices = ["phone" "nixserver" "lilith-pad" "lilith-pc" "lilith-old"];
};
};
};
};
}

View file

@ -1,41 +0,0 @@
{
conf,
config,
...
} @ inputs: {
users.mutableUsers = false;
users.users = {
${conf.user} = {
isNormalUser = true;
uid = conf.uid;
extraGroups = ["wheel" "networkmanager"];
hashedPasswordFile = config.sops.secrets."user/password".path;
};
};
home-manager.users = let
hm = import ../home;
in {
${conf.user} = {
imports = hm.user;
home.username = conf.user;
home.stateVersion = "24.11";
};
};
sops.secrets."user/password" = {
sopsFile = ../hosts/${conf.hostname}/secrets/default.yaml;
neededForUsers = true;
};
sops.secrets."user/ssh/private" = {
sopsFile = ../hosts/${conf.hostname}/secrets/default.yaml;
path = "/home/lilith/.ssh/id_ed25519";
owner = "lilith";
};
sops.secrets."user/ssh/public" = {
sopsFile = ../hosts/${conf.hostname}/secrets/default.yaml;
path = "/home/lilith/.ssh/id_ed25519.pub";
owner = "lilith";
};
}

View file

@ -1,12 +0,0 @@
{...}: {
services.monado = {
enable = true;
defaultRuntime = true;
};
systemd.user.services.monado.environment = {
STEAMVR_LH_ENABLE = "1";
XRT_COMPOSITOR_COMPUTE = "1";
WMR_HANDTRACKING = "0";
};
}

View file

@ -1,43 +0,0 @@
{
pkgs,
conf,
lib,
...
}: {
security.polkit.enable = true;
security.pam.services.hyprlock = {};
services.dbus.enable = true;
environment.systemPackages = with pkgs; [
xdg-desktop-portal-hyprland
hyprcursor
hyprpicker
hyprlock
hypridle
hyprpaper
hyprcursor
];
xdg.portal = {
enable = true;
wlr.enable = lib.mkForce true;
config.common.default = "hyprland";
};
hardware.opengl.enable = true;
programs.hyprland.enable = true;
services.greetd = {
enable = true;
settings = rec {
default_session = initial_session;
initial_session = {
user = conf.user;
command = "Hyprland";
};
};
};
}

View file

@ -1,4 +0,0 @@
{pkgs, ...}: {
programs.zsh.enable = true;
users.defaultUserShell = pkgs.zsh;
}