Initial commit for phosphorous branch

This commit is contained in:
2025-07-29 12:17:29 -04:00
parent caeb108974
commit 82d34571c8
23 changed files with 720 additions and 501 deletions

54
hosts/work/config.nix Executable file
View File

@@ -0,0 +1,54 @@
{ slash, pkgs, username, ... }:
{
imports = [
./hardware.nix
];
# My module options
movOpts = {
sysEnv = {
issue.enable = true;
sddmConfig.enable = false;
stylixConfig.enable = true;
nixSettings.enable = true;
#consoleSettings.enable = true;
};
hardwareCfg = {
networkModule.enable = true;
kernelModule.enable = true;
bootLoader.enable = true;
};
softwareCfg = {
gamingPkgs.enable = true;
steamConfig.enable = true;
sysPkgs.enable = true;
sysProgs.enable = true;
sysServices.enable = true;
virtConfig.enable = true;
};
};
environment = {
variables = { PATH = "${pkgs.clang-tools}/bin:$PATH"; };
shells = [ pkgs.myPkgs.slash pkgs.zsh pkgs.bash ];
};
users = {
groups.persist = { };
users = {
root.initialPassword = "1234";
${username} = {
isNormalUser = true;
initialPassword = "1234";
shell = pkgs.zsh;
extraGroups = [ "input" "wheel" "persist" "libvirtd" ];
};
};
};
security.sudo.extraConfig = ''
${username} ALL=(ALL) NOPASSWD: /etc/profiles/per-user/${username}/bin/rebuild
'';
nix.settings.allowed-users = [ "${username}" ];
time.timeZone = "America/New_York";
}

126
hosts/work/containers.nix Normal file
View File

@@ -0,0 +1,126 @@
{ slash, pkgs, username, ... }:
let
kickstartServer =
let
libsrcds = pkgs.stdenv.mkDerivation {
name = "libsrcds";
src = pkgs.fetchFromGitHub {
owner = "km-clay";
repo = "sourceds-libraries";
rev = "08d12c91af664ffd103482ae1a24714222bef2df";
hash = "sha256-EFXBhqZEkBNpYjNuG7oTZLgfjqM5G+nLb7e/qeN1Tvw=";
};
installPhase = ''
mkdir -p $out/lib
cp ./* $out/lib
'';
};
startTf2Server = pkgs.writeShellScript "start-srv.sh" ''
set -euo pipefail
export HOME=/home/tf2
export LD_LIBRARY_PATH=/usr/lib:/usr/lib32
mkdir -p "$HOME/tf2server"
mkdir -p "$HOME/tf2server"
steamcmd +force_install_dir "$HOME/tf2server" \
+login anonymous \
+app_update 232250 validate \
+quit
cd "$HOME/tf2server"
ln -sf "$HOME/.steam/steam/linux64" "$HOME/.steam/sdk64"
ln -sf "$HOME/.steam/steam/linux32" "$HOME/.steam/sdk32"
exec ./srcds_run -game tf -console -port 25565 +map cp_dustbowl \
+ip 10.233.1.2 -norestart \
+sv_setsteamaccount 8862FD4B30F401036B8AAC6A7FE6B123
'';
in
pkgs.buildFHSEnv {
name = "srcds-env";
targetPkgs = pkgs: with pkgs; [
steamcmd
glibc
zlib
curl
libuuid
openssl
libnl
libsrcds
# Optional: link compat
stdenv.cc.cc.lib
];
multiPkgs = pkgs: with pkgs.pkgsi686Linux; [
glibc
zlib
ncurses5
libuuid
alsa-lib
libxcrypt-legacy
gcc
];
multiArch = true;
runScript = "${startTf2Server}";
};
in
{
networking = {
nat = {
enable = true;
internalInterfaces = ["ve-+"];
externalInterface = "enp8s0";
};
};
containers.tf2server = {
autoStart = true;
privateNetwork = true;
hostAddress = "10.233.1.1";
localAddress = "10.233.1.2";
config = {
imports = [ ];
nixpkgs.config.allowUnfree = true;
services.openssh.enable = true;
users.users.root.password = "root"; # For quick login, remove in prod
environment.systemPackages = with pkgs; [
steamcmd
steam-run
coreutils
wget
unzip
bash
nix
coreutils
vim
];
users.users.tf2server = {
isNormalUser = true;
initialPassword = "1234";
shell = pkgs.bash;
extraGroups = [ "wheel" ];
};
systemd.services.tf2server = {
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = "${kickstartServer}/bin/srcds-env";
};
};
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# Optional: open ports on the container
networking.firewall.allowedTCPPorts = [ 25565 ];
networking.firewall.allowedUDPPorts = [ 25565 27005 27015 27020 ];
system.stateVersion = "25.11"; # or your NixOS version
};
};
}

37
hosts/work/hardware.nix Normal file
View File

@@ -0,0 +1,37 @@
# 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 + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sr_mod" "virtio_blk" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/db4cf956-df00-4c26-851d-419136434eae";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/336C-A94E";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
swapDevices = [ ];
# 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.interfaces.enp1s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

57
hosts/work/home.nix Executable file
View File

@@ -0,0 +1,57 @@
{ username, ... }: {
home.username = "${username}";
home.homeDirectory =
"/home/${username}";
home.stateVersion = "25.05";
programs.home-manager.enable = true;
movOpts = {
# modules/home/files
homeFiles.enable = true;
# modules/home/environment
envConfig = {
hyprlandConfig = {
enable = true;
monitorNames = [ "DP-3" "DP-1" ];
workspaceLayout = "dualmonitor";
};
userPkgs.enable = true;
stylixHomeConfig.enable = true;
waybarConfig.enable = true;
gtkConfig.enable = true;
spicetifyConfig.enable = false;
starshipConfig.enable = true;
swayncConfig.enable = true;
zshConfig = {
shellAliases.enable = true;
envVariables.enable = true;
shellOptions.enable = true;
extraConfig.enable = true;
};
};
# modules/home/programs
programConfigs = {
autojumpConfig.enable = true;
btopConfig.enable = true;
cavaConfig.enable = false;
ezaConfig.enable = true;
fuzzelConfig.enable = true;
fzfConfig.enable = true;
gitConfig.enable = true;
kittyConfig.enable = true;
yaziConfig.enable = true;
passConfig.enable = true;
batConfig.enable = true;
};
};
dconf.settings = {
"org/virt-manager/virt-manager/connections" = {
autoconnect = [ "qemu:///system" ];
uris = [ "qemu:///system" ];
};
};
}