This commit is contained in:
Sebastian Moser
2025-04-22 22:59:04 +02:00
parent 12fcb7050a
commit a4e3c42595
21 changed files with 544 additions and 59 deletions

View File

@@ -12,6 +12,8 @@
programs.bash.loginShellInit = "";
virtualisation.docker.enable = true;
users.users.me.extraGroups = [ "docker" ];
# to build rpi images
boot.binfmt.emulatedSystems = [

View File

@@ -61,6 +61,8 @@
qemuSwtpm = true;
#qemuOvmfPackage = pkgs.OVMFFull;
};
virtualisation.docker.enable = true;
users.users.server.extraGroups = [ "docker" ];
# Use the GRUB 2 boot loader.
boot.loader.grub = {
@@ -119,8 +121,17 @@
49391
49392
49393
];
networking.firewall.allowedTCPPortRanges = [
{ from = 25500; to = 27777;} # minecraft
];
networking.firewall.allowedUDPPortRanges = [
{ from = 27700; to = 28800;} # minecraft
];
networking.firewall.allowedUDPPorts = [
3702 # wsdd
67 # allow DHCP traffic
@@ -313,6 +324,7 @@
"recycle:touch_mtime" = "Yes";
"recycle:maxsize" = "8000";
};
mama = {
"comment" = "Meine Dateien auf Mamas Laptop";
"path" = "/home/files/storage/files/stuff/Mamas-Laptop";

View File

@@ -1,4 +1,4 @@
{ lib, pkgs, inputs, secretsDir, workDir, ... }:
{ lib, pkgs, inputs, secretsDir, config, ... }:
{
#system.stateVersion = "23.05"; # Did you read the comment?
@@ -32,7 +32,13 @@
};
};
boot.kernelParams = lib.mkForce ["console=ttyS0,115200n8" "console=tty0" "nohibernate" "loglevel=7" ];
# get usbip working
boot.extraModulePackages = [
config.boot.kernelPackages.usbip
];
boot.kernelParams = lib.mkForce ["console=ttyS0,115200n8" "console=ttyAMA0,115200n8" "console=tty0" "nohibernate" "loglevel=7" ];
# hardware.bluetooth.enable = true;
@@ -62,9 +68,6 @@
services.blueman.enable = true;
hardware.enableRedistributableFirmware = true;
# This causes an overlay which causes a lot of rebuilding
environment.noXlibs = lib.mkForce false;
environment.systemPackages = with pkgs; [
vim
@@ -75,10 +78,11 @@
# "${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix" creates a
# disk with this label on first boot. Therefore, we need to keep it. It is the
# only information from the installer image that we need to keep persistent
fileSystems."/" =
{ device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
};
fileSystems."/" = {
device = "/dev/disk/by-label/NIXOS_SD";
noCheck = true;
fsType = "ext4";
};
boot = {
#kernelPackages = lib.mkForce pkgs.linuxPackages_latest;
@@ -115,6 +119,7 @@
networking.firewall.allowedTCPPorts = [
8888 # general use
9999 # general use
3240 # usbip
];
networking.hostName = "lush";
@@ -122,23 +127,6 @@
networking.networkmanager.enable = true;
networking.networkmanager.profiles = {
home = {
connection = {
id = "main";
uuid = "a02273d9-ad12-395e-8372-f61129635b6f";
type = "ethernet";
autoconnect-priority = "-999";
interface-name = "eth0";
autoconnect = true;
};
ipv4 = {
address1 = "192.168.1.44/24,192.168.1.1";
dns = "1.1.1.1;";
method = "manual";
};
};
pw = {
connection = {
id = "pw";
@@ -198,7 +186,7 @@
id = "dhcp";
uuid = "c006389a-1697-4f77-91c3-95b466f85f13";
type = "ethernet";
autoconnect = "false";
autoconnect = "true";
interface-name = "end0";
};
@@ -207,6 +195,7 @@
};
ipv4 = {
address1 = "192.168.1.44/24,192.168.1.1";
method = "auto";
};
};

View File

@@ -1,4 +1,4 @@
{ pkgs, inputs, ... }: let
{ secretsDir, pkgs, inputs, ... }: let
myobs = pkgs.wrapOBS {
plugins = with pkgs.obs-studio-plugins; [
@@ -16,13 +16,13 @@ in {
../common/building.nix
inputs.home-manager.nixosModules.home-manager
inputs.networkmanager.nixosModules.networkmanager
../users/me/headless.nix
../users/root/default.nix
];
networking.hostName = "mac";
networking.firewall.enable = false;
networking.useDHCP = true;
services.avahi = {
enable = true;
nssmdns = true;
@@ -35,6 +35,30 @@ in {
workstation = true;
};
};
networking.firewall.allowedTCPPorts = [
8888 # for general usage
9999 # for general usage
6000 # Xserver
5900 # vnc for win VM
5901 # vnc
5902 # vnc
4400 # rdp win VM
];
boot.kernelModules = [ "usbip_core" ];
boot.extraModprobeConfig = "options kvm_intel nested=1";
# to build rpi images
boot.binfmt.emulatedSystems = [
"aarch64-linux"
];
virtualisation.libvirtd = {
enable = true;
qemuOvmf = true;
qemuSwtpm = true;
#qemuOvmfPackage = pkgs.OVMFFull;
};
# Use the GRUB 2 boot loader.
boot.loader.grub = {
@@ -48,6 +72,7 @@ in {
};
environment.systemPackages = with pkgs; [
passt
mount
pkgs.hicolor-icon-theme
efibootmgr
@@ -154,4 +179,112 @@ in {
systemd.defaultUnit = "graphical.target";
############################# networkmanager
networking.networkmanager.enable = true;
networking.networkmanager.profiles = {
home = {
connection = {
id = "home";
uuid = "a02273d9-ad12-395e-8372-f61129635b6f";
type = "ethernet";
autoconnect-priority = "-999";
interface-name = "enp2s0";
};
ipv4 = {
address1 = "192.168.1.33/24,192.168.1.1";
dns = "1.1.1.1;";
method = "manual";
};
};
pw = {
connection = {
id = "pw";
uuid = "e0103dac-7da0-4e32-a01b-487b8c4c813c";
type = "wifi";
interface-name = "wlp3s0";
};
wifi = {
hidden = "true";
mode = "infrastructure";
ssid = builtins.readFile "${secretsDir}/wifi-ssid";
};
wifi-security = {
key-mgmt = "wpa-psk";
psk = builtins.readFile "${secretsDir}/wifi-password";
};
ipv4 = {
#address1 = "192.168.20.11/24";
dns = "1.1.1.1;8.8.8.8;";
method = "auto";
};
};
hot = {
connection = {
id = "hot";
uuid = "ab51de8a-9742-465a-928b-be54a83ab6a3";
type = "wifi";
autoconnect = false;
interface-name = "wlp3s0";
};
wifi = {
mac-address = "0C:96:E6:E3:64:03";
mode = "ap";
ssid = "c2vi-mac";
};
ipv4 = {
method = "shared";
};
};
share = {
connection = {
id = "share";
uuid = "f55f34e3-4595-4642-b1f6-df3185bc0a04";
type = "ethernet";
autoconnect = false;
interface-name = "enp2s0";
};
ethernet = {
mac-address = "C8:2A:14:0B:7F:3D";
};
ipv4 = {
address1 = "192.168.4.1/24";
method = "shared";
};
ipv6 = {
addr-gen-mode = "stable-privacy";
method = "auto";
};
};
dhcp = {
connection = {
id = "dhcp";
uuid = "c006389a-1697-4f77-91c3-95b466f85f13";
type = "ethernet";
autoconnect = "false";
interface-name = "enp2s0";
};
ethernet = {
mac-address = "C8:2A:14:0B:7F:3D";
};
ipv4 = {
method = "auto";
};
};
};
}

View File

@@ -1,5 +1,5 @@
{ pkgs, lib, workDir, self, secretsDir, config, inputs, system, ... }:
{ pkgs, lib, workDir, self, secretsDir, config, inputs, system, pkgsUnstable, ... }:
{
# https://bugzilla.kernel.org/show_bug.cgi?id=110941
@@ -38,6 +38,7 @@
services.sunshine = {
/*
package = pkgs.sunshine.overrideAttrs {
src = pkgs.fetchFromGitHub {
owner = "garnacho";
@@ -46,6 +47,32 @@
hash = "sha256-To1vhNQxjIa5Hc+z2xo+ODSQyIH6cnI3A7Ofc7MDL60=";
};
};
*/
package = pkgsUnstable.sunshine.overrideAttrs (prev: {
patches = prev.patches or [] ++ [
#(pkgs.fetchpatch {
#url = "https://github.com/LizardByte/Sunshine/pull/2507.patch";
#hash = "sha256-DdyiR7djH4GF1bcQP/a20BYpTBvrAzd0UxJ0o0nC4rU=";
#})
];
buildInputs = prev.buildInputs or [] ++ [
pkgsUnstable.pipewire
pkgsUnstable.xdg-desktop-portal
];
cmakeFlage = prev.cmakeFlags or [] ++ [
(lib.cmakeBool "SUNSHINE_ENABLE_PORTAL" true)
];
src = pkgs.fetchFromGitHub {
owner = "c2vi";
repo = "Sunshine";
rev = "2671cd374dc5d12d402de572d170c9dfee8c5d7b";
hash = "sha256-7IOMXmvl7/WYF6ktSUrLZjq+Lnq9YpSqUsj0FVtG8tI=";
fetchSubmodules = true;
};
});
enable = true;
autoStart = true;
capSysAdmin = true;
@@ -55,6 +82,9 @@
hardware.graphics.extraPackages = with pkgs; [
intel-media-driver intel-ocl intel-vaapi-driver intel-compute-runtime-legacy1
];
@@ -78,7 +108,6 @@
services.nscd.enable = lib.mkForce false;
virtualisation.docker.enable = true;
system.nssModules = lib.mkForce [];
@@ -149,6 +178,11 @@
environment.systemPackages = with pkgs; [
inputs.waveforms.packages.${system}.waveforms
intel-compute-runtime-legacy1
ffmpeg-full
remmina
vesktop
prismlauncher
# add pyclip for waydroid
python310Packages.pyclip
@@ -164,6 +198,11 @@
];
})
(writeShellScriptBin "davinci" ''
NIXPKGS_ALLOW_UNFREE=1 OCL_ICD_ENABLE_TRACE=True QT_QPA_PLATFORM=xcb nix run nixpkgs#davinci-resolve --impure -L
'')
# waveforms
# my keyboar flash script, that opens as an alacritty window
@@ -185,9 +224,7 @@
# shedule nix builds with low priority, so the laptop is still usable while building something
nix.daemonCPUSchedPolicy = "idle";
nix.daemonIONiceLevel = 7;
systemd.services.nix-daemon.serviceConfig.Nice = 9;
systemd.services.nix-daemon.serviceConfig.Nice = 9;
# enable ntp
#services.ntp.enable = true;
@@ -322,6 +359,7 @@
8080 # for mitm proxy
51820 # wireguard
6000 # Xserver
10000 # tailscale tcp funnel
];
networking.firewall.allowedUDPPorts = [

View File

@@ -33,6 +33,10 @@
8888 # general use
9999 # general use
25565 # minecraft
29901
29902
29903
29904
];