massive refactoring

This commit is contained in:
yaroslav
2026-05-09 16:17:24 +03:00
parent fa9f084702
commit 79483c0b9b
26 changed files with 370 additions and 507 deletions
+53
View File
@@ -0,0 +1,53 @@
# filesystem and storage specific options for Aphelion
{...}:
{
boot.initrd.clevis = {
enable = true;
devices."aphelion-zroot/data/sensitive".secretFile = ../../secrets/Aphelion/sensitive.jwe;
devices."aphelion-zroot/nix-enc".secretFile = ../../secrets/Aphelion/sensitive.jwe;
};
fileSystems = {
"/" = {
device = "none";
fsType = "tmpfs";
options = ["defaults" "mode=755"];
};
"/boot" = {
device = "/dev/disk/by-uuid/278A-0FB0";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
"/nix" = {
device = "aphelion-zroot/nix-enc";
fsType = "zfs";
};
"/home" = {
device = "aphelion-zroot/home";
fsType = "zfs";
};
"/home/yaroslav/.local/share/Steam"= {
device = "aphelion-zroot/data/steam";
fsType = "zfs";
};
"/Volumes/Trash" = {
device = "/dev/yarikpc/trash";
fsType = "ext4";
options = [ "x-mount.mkdir" "rw" ];
};
"/Volumes/Games" = {
device = "/dev/yarikpc/games";
fsType = "ext4";
options = [ "x-mount.mkdir" "rw" ];
};
"/Volumes/Sensitive" = {
device = "aphelion-zroot/data/sensitive";
fsType = "zfs";
options = [ "x-mount.mkdir" "rw" ];
};
};
services.nfs.server.enable = true;
services.nfs.server.exports = ''
/Volumes/Trash 192.168.1.0/24(rw)
'';
}
-113
View File
@@ -1,113 +0,0 @@
# 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.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
boot.supportedFilesystems = [ "zfs" ];
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.zfs.package = pkgs.zfs_2_4;
boot.initrd.clevis = {
enable = true;
devices."aphelion-zroot/data/sensitive".secretFile = ../../secrets/Aphelion/sensitive.jwe;
devices."aphelion-zroot/nix-enc".secretFile = ../../secrets/Aphelion/sensitive.jwe;
};
fileSystems."/" =
{ device = "none";
fsType = "tmpfs";
options = ["defaults" "mode=755"];
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/278A-0FB0";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
fileSystems."/nix" =
{ device = "aphelion-zroot/nix-enc";
fsType = "zfs";
};
fileSystems."/home" =
{ device = "aphelion-zroot/home";
fsType = "zfs";
};
fileSystems."/home/yaroslav/.local/share/Steam"=
{ device = "aphelion-zroot/data/steam";
fsType = "zfs";
};
fileSystems."/Volumes/Trash" =
{
device = "/dev/yarikpc/trash";
fsType = "ext4";
options = [ "x-mount.mkdir" "rw" ];
};
fileSystems."/Volumes/Games" =
{
device = "/dev/yarikpc/games";
fsType = "ext4";
options = [ "x-mount.mkdir" "rw" ];
};
fileSystems."/Volumes/Sensitive" =
{
device = "aphelion-zroot/data/sensitive";
fsType = "zfs";
options = [ "x-mount.mkdir" "rw" ];
};
# fileSystems."/Volumes/ssd_g" =
# {
# device = "/dev/disk/by-id/ata-KINGSTON_SA400S37240G_50026B77846D940A-part1";
# fsType = "btrfs";
# options = [ "x-mount.mkdir" "rw" ];
# };
swapDevices = [ ];
hardware.graphics.extraPackages = with pkgs; [
rocmPackages.clr.icd
];
systemd.tmpfiles.rules = [
"L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}"
];
#chaotic.mesa-git.enable = true;
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
networking.firewall.allowedTCPPorts = [ 42420 25565 ];
networking.firewall.allowedUDPPorts = [ 5900 ];
networking.firewall.trustedInterfaces = [ "enp12s0" "wlp11s0" "wg0"];
#networking.firewall.enable = false;
# networking.interfaces.enp12s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp11s0.useDHCP = lib.mkDefault true;
hardware.bluetooth.enable = true; # enables support for Bluetooth
hardware.bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot
services.lact = {
enable = true;
};
services.hardware.openrgb.enable = true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
system.stateVersion = "25.11";
networking.hostName = "Aphelion";
networking.hostId = "b7fa9c25";
}
+47
View File
@@ -0,0 +1,47 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
boot.supportedFilesystems = [ "zfs" ];
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.zfs.package = pkgs.zfs_2_4;
swapDevices = [ ];
hardware.graphics.extraPackages = with pkgs; [
rocmPackages.clr.icd
];
systemd.tmpfiles.rules = [
"L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}"
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
#networking.firewall.enable = false;
# networking.interfaces.enp12s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp11s0.useDHCP = lib.mkDefault true;
hardware.bluetooth.enable = true; # enables support for Bluetooth
hardware.bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot
services.lact = {
enable = true;
};
services.hardware.openrgb.enable = true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
system.stateVersion = "25.11";
networking.hostName = "Aphelion";
networking.hostId = "b7fa9c25";
}
@@ -1,3 +1,4 @@
# various entertainment-related services
{ ... }:
{
services.minidlna = {
@@ -10,4 +11,11 @@
};
openFirewall = true;
};
services.sunshine = {
enable = true;
autoStart = true;
capSysAdmin = true;
openFirewall = true;
};
programs.noisetorch.enable = true;
}
@@ -4,8 +4,7 @@
nixpkgs.overlays = [ inputs.millennium.overlays.default ];
virtualisation.waydroid.enable = true;
services.flatpak.enable = true;
programs.throne.enable = true;
programs.throne.tunMode.enable = true;
programs.obs-studio.enable = true;
programs.obs-studio.enableVirtualCamera = true;
boot.extraModulePackages = with config.boot.kernelPackages; [
@@ -15,36 +14,15 @@
boot.extraModprobeConfig = ''
options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1
'';
security.polkit.enable = true;
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"ida-free"
"pantum-driver"
];
programs.hyprland.enable = true;
networking.interfaces.enp12s0.wakeOnLan.enable = true;
networking.interfaces.enp12s0.wakeOnLan.policy = [ "magic" ];
# build substituter
users.users.nixremote = {
isNormalUser = true;
createHome = false;
group = "nixremote";
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIt6Ts4SNWXv2hObOOKyyxXr/6iZBRZXEwE0mtEpCa8X root@Ratchet"
];
};
users.groups.nixremote = {};
services.nix-serve.secretKeyFile = "/home/store_secret.pem";
services.displayManager.plasma-login-manager.enable = true;
nix.settings.trusted-users = [ "nixremote" ];
# services.xrdp.enable = true;
# services.xrdp.defaultWindowManager = "startplasma-x11";
# services.xrdp.openFirewall = true;
}
+12
View File
@@ -0,0 +1,12 @@
{...} :
{
networking.firewall.allowedTCPPorts = [ 42420 25565 2049 ]; # 2049 - nfs, 25565 - generic
networking.firewall.allowedUDPPorts = [ 5900 ]; # 5900 - vnc
networking.firewall.trustedInterfaces = [ "enp12s0" "wlp11s0"];
# WoL
networking.interfaces.enp12s0.wakeOnLan.enable = true;
networking.interfaces.enp12s0.wakeOnLan.policy = [ "magic" ];
# throne
programs.throne.enable = true;
programs.throne.tunMode.enable = true;
}
-8
View File
@@ -1,8 +0,0 @@
{ ... }:
{
services.nfs.server.enable = true;
services.nfs.server.exports = ''
/Volumes/Trash 192.168.1.0/24(rw)
'';
networking.firewall.allowedTCPPorts = [ 2049 ];
}
-12
View File
@@ -1,12 +0,0 @@
{ ... }:
{
boot.initrd.kernelModules = [ "nvidia" ];
hardware.graphics.enable = true;
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = true;
open = true;
nvidiaSettings = true;
};
}
-10
View File
@@ -1,10 +0,0 @@
{ ... }:
{
services.sunshine = {
enable = true;
autoStart = true;
capSysAdmin = true;
openFirewall = true;
};
programs.noisetorch.enable = true;
}