Merge remote-tracking branch 'origin/main'

This commit is contained in:
Kurtis Andrews
2024-06-29 16:13:37 +10:00
12 changed files with 215 additions and 185 deletions

View File

@@ -2,11 +2,18 @@
{ {
imports = imports =
[ # Include the results of the hardware scan. [ # Include the results of the hardware scan.
./hosts/blade/hardware-configuration.nix /etc/nixos/hardware-configuration.nix
./components/base-software.nix ./components/base-software.nix
./components/user-kurtisa.nix ./components/user-kurtisa.nix
]; ];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Enable networking
networking.networkmanager.enable = true;
networking.hostName = "blade"; # Define your hostname. networking.hostName = "blade"; # Define your hostname.
system.stateVersion = "24.05"; # Did you read the comment? system.stateVersion = "24.05"; # Did you read the comment?

View File

@@ -0,0 +1,49 @@
{ config, pkgs, ... }:
{
# Set your time zone.
time.timeZone = "Australia/Brisbane";
# Select internationalisation properties.
i18n.defaultLocale = "en_AU.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_AU.UTF-8";
LC_IDENTIFICATION = "en_AU.UTF-8";
LC_MEASUREMENT = "en_AU.UTF-8";
LC_MONETARY = "en_AU.UTF-8";
LC_NAME = "en_AU.UTF-8";
LC_NUMERIC = "en_AU.UTF-8";
LC_PAPER = "en_AU.UTF-8";
LC_TELEPHONE = "en_AU.UTF-8";
LC_TIME = "en_AU.UTF-8";
};
# Configure keymap in X11
services.xserver = {
layout = "au";
xkbVariant = "";
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile. To search, run:
environment.systemPackages = with pkgs; [
wget
btop
duf
sshed
nmap
fish
starship
thefuck
git
stow
];
# Enable the OpenSSH daemon.
services.openssh.enable = true;
programs.fish.enable = true;
}

View File

@@ -1,17 +1,10 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone. # Set your time zone.
time.timeZone = "Australia/Brisbane"; time.timeZone = "Australia/Brisbane";
# Select internationalisation properties. # Select internationalisation properties.
i18n.defaultLocale = "en_GB.UTF-8"; i18n.defaultLocale = "en_AU.UTF-8";
i18n.extraLocaleSettings = { i18n.extraLocaleSettings = {
LC_ADDRESS = "en_AU.UTF-8"; LC_ADDRESS = "en_AU.UTF-8";
@@ -59,6 +52,19 @@
xkbVariant = ""; xkbVariant = "";
}; };
# Enable Numlock being turned on at startup
systemd.services.numLockOnTty = {
wantedBy = [ "multi-user.target" ];
serviceConfig = {
# /run/current-system/sw/bin/setleds -D +num < "$tty";
ExecStart = pkgs.lib.mkForce (pkgs.writeShellScript "numLockOnTty" ''
for tty in /dev/tty{1..6}; do
${pkgs.kbd}/bin/setleds -D +num < "$tty";
done
'');
};
};
# Enable CUPS to print documents. # Enable CUPS to print documents.
services.printing.enable = true; services.printing.enable = true;
# Print auto discovery is not working seeing if this fixes it. # Print auto discovery is not working seeing if this fixes it.

View File

@@ -12,12 +12,21 @@ in
boot.kernelModules = [ "kvm-intel" "kvm-amd" ]; boot.kernelModules = [ "kvm-intel" "kvm-amd" ];
virtualisation.libvirtd.enable = true; virtualisation.libvirtd.enable = true;
virtualisation.spiceUSBRedirection.enable = true; virtualisation.spiceUSBRedirection.enable = true;
#docker
virtualisation.docker.enable = true;
#GS CONNECT
programs.kdeconnect = {
enable = true;
package = pkgs.gnomeExtensions.gsconnect;
};
# My user account. Don't forget to set a password with passwd. # My user account. Don't forget to set a password with passwd.
users.users.kurtisa = { users.users.kurtisa = {
isNormalUser = true; isNormalUser = true;
description = "Kurtis Andrews"; description = "Kurtis Andrews";
extraGroups = [ "networkmanager" "wheel" ]; extraGroups = [ "networkmanager" "wheel" "docker" ];
packages = with pkgs; [ packages = with pkgs; [
firefox firefox
thunderbird thunderbird
@@ -31,7 +40,6 @@ in
gnome.gnome-boxes gnome.gnome-boxes
gnomeExtensions.caffeine gnomeExtensions.caffeine
gnome.gnome-disk-utility gnome.gnome-disk-utility
gnome-extension-manager
]; ];
shell = pkgs.fish; shell = pkgs.fish;
}; };
@@ -42,8 +50,12 @@ in
tap-to-click = true; tap-to-click = true;
two-finger-scrolling-enabled = true; two-finger-scrolling-enabled = true;
}; };
"org/gnome/mutter" = {
edge-tiling = true;
};
"org/gnome/shell".enabled-extensions = [ "org/gnome/shell".enabled-extensions = [
"caffeine@patapon.info" "caffeine@patapon.info"
"gsconnect@andyholmes.github.io"
]; ];
"org/gnome/desktop/interface" = { "org/gnome/desktop/interface" = {
clock-format = "12h"; clock-format = "12h";

27
game-serv.nix Normal file
View File

@@ -0,0 +1,27 @@
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
/etc/nixos/hardware-configuration.nix
./components/base-server.nix
];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "game-serv"; # Define your hostname.
users.users.kurtisa = {
isNormalUser = true;
description = "Kurtis Andrews";
extraGroups = [ "networkmanager" "wheel" "docker"];
shell = pkgs.fish;
};
# Docker
virtualisation.docker.enable = true;
system.stateVersion = "23.11"; # Did you read the comment?
}

View File

@@ -1,92 +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 = [ "xhci_pci" "nvme" "uas" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/6270d5e5-c300-4fb5-9752-93bca7d8cb4b";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/5184-28C3";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/156b072b-2d78-40f7-a4ae-9ff8b88b7003"; }
];
# 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.wlo1.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
# Nvidia Drivers
# Enable OpenGL
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
# Load nvidia driver for Xorg and Wayland
services.xserver.videoDrivers = ["nvidia"]; # or "nvidiaLegacy470 etc.
hardware.nvidia = {
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
powerManagement.enable = false;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting.
open = false;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
# laptop hybrid video settings settings
hardware.nvidia.prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
# Make sure to use the correct Bus ID values for your system!
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:2:0:0";
};
}

View File

@@ -1,40 +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 = [ "xhci_pci" "ahci" "nvme" "uas" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/fcc18df6-fd6c-46b6-ba9b-68b35dc7e2e9";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/A3AC-7B6E";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/da9cffb9-6af8-4591-8c0c-eeb059144813"; }
];
# 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.eno1.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

57
rock64.nix Normal file
View File

@@ -0,0 +1,57 @@
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
/etc/nixos/hardware-configuration.nix
./components/base-server.nix
];
# Use the extlinux boot loader. (NixOS wants to enable GRUB by default)
boot.loader.grub.enable = false;
# Enables the generation of /boot/extlinux/extlinux.conf
boot.loader.generic-extlinux-compatible.enable = true;
networking.hostName = "rock64"; # Define your hostname.
# Set your time zone.
time.timeZone = "Australia/Brisbane";
users.users.kurtisa = {
isNormalUser = true;
description = "Kurtis Andrews";
extraGroups = [ "networkmanager" "wheel" ];
};
# List packages installed in system profile.
environment.systemPackages = with pkgs; [
netclient
];
# Docker
virtualisation.docker.enable = true;
#wireguard settings
networking.firewall = {
allowedUDPPorts = [ 51820 ]; # Clients and peers can use the same port, see listenport
};
networking.wireguard.interfaces = {
wg0 = {
ips = [ "10.138.53.253/32" ];
listenPort = 51820;
mtu = 1420;
privateKey = "EP5qHEd5XCjnRVAHQSobA8LJhnlBMtVFgNbR75s1eUw=";
peers = [
{
publicKey = "y5qD7a3Pf2Hmt/kje6zGObPBkYbg4V2Ugxzml1B32xw=";
allowedIPs = [ "10.138.53.0/24" "10.7.0.0/24" "10.14.88.0/24" "10.13.50.0/24" ];
endpoint = "139.99.171.43:51821";
persistentKeepalive = 25;
}
];
};
};
system.stateVersion = "23.05"; # Did you read the comment?
}

View File

@@ -1,9 +0,0 @@
#!/usr/bin/env bash
# This will update the repo
echo "Updating Configs"
git pull
echo "Done"

View File

@@ -1,27 +1,31 @@
#!/usr/bin/env bash #!/usr/bin/env bash
scriptDIR=$(dirname $0)
hostname=$(hostname -f) hostname=$(hostname -f)
# Okay need to get the hostname and see if this exists in our list of items. # Okay need to get the hostname and see if this exists in our list of items.
start () { start () {
if [ $hostname == "nixos" ] if [ $hostname == "nixos" ]
then then
# no hostname defined. need to generate menu. # no hostname defined. need to generate menu.
menuItems=( menuIndex=1
"1. blade " menuItems=()
"2. W00072" menuActions=()
"3. W00149" for entry in "$scriptDIR"/*.nix
"Q. Exit " do
) entry=${entry##*/}
menuActions=( entry=${entry%.nix}
setupBlade menuItems+=("$menuIndex. $entry")
setupW00072 menuActions+=(build_$entry)
setupW00149 eval "build_${entry}() { hostname=${entry}; doBuild; }"
quitApp ((menuIndex+=1))
) done
menuItems+=("Q. Exit")
menuActions+=(quitApp)
menuTitle=" New nixos instance detected. Please select a build to deploy." menuTitle=" New nixos instance detected. Please select a build to deploy."
else else
# Need to check if the nix file exists # Need to check if the nix file exists
if [[ ! -f "$hostname.nix" ]] if [[ ! -f $scriptDIR/$hostname.nix ]]
then then
menuItems=( menuItems=(
"Q. Exit" "Q. Exit"
@@ -33,12 +37,12 @@ start () {
else else
menuItems=( menuItems=(
"1. Perform Rebuild" "1. Perform Rebuild"
"2. Update Build " "2. Update Configs "
"Q. Exit " "Q. Exit "
) )
menuActions=( menuActions=(
doBuild doBuild
updateBuild updateScript
quitApp quitApp
) )
menuTitle=" $hostname was found. Proceed with rebuild?" menuTitle=" $hostname was found. Proceed with rebuild?"
@@ -52,24 +56,11 @@ start () {
menuLoop menuLoop
} }
setupBlade () {
hostname="blade"
doBuild
}
setupW00072 () {
hostname="w00072"
doBuild
}
setupW00149 () {
hostname="w00149"
doBuild
}
doBuild () { doBuild () {
logo logo
sudo nixos-rebuild switch -I nixos-config=./$hostname.nix sudo nixos-rebuild switch -I nixos-config=$scriptDIR/$hostname.nix --upgrade
echo Finished .. press any key to continue
read -n 1
return 0 return 0
} }
@@ -79,6 +70,14 @@ updateBuild () {
return 0 return 0
} }
updateScript () {
git -C $scriptDIR pull
echo Script pulled you may need to restart vargix-os if theres been an update to it
echo .. press any key to continue
read -n 1
return 0
}
quitApp () { quitApp () {
return 0 return 0
} }

View File

@@ -2,11 +2,18 @@
{ {
imports = imports =
[ # Include the results of the hardware scan. [ # Include the results of the hardware scan.
./hosts/w00072/hardware-configuration.nix /etc/nixos/hardware-configuration.nix
./components/base-software.nix ./components/base-software.nix
./components/user-kurtisa.nix ./components/user-kurtisa.nix
]; ];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Enable networking
networking.networkmanager.enable = true;
networking.hostName = "w00072"; # Define your hostname. networking.hostName = "w00072"; # Define your hostname.
system.stateVersion = "23.11"; # Did you read the comment? system.stateVersion = "23.11"; # Did you read the comment?

View File

@@ -2,11 +2,18 @@
{ {
imports = imports =
[ # Include the results of the hardware scan. [ # Include the results of the hardware scan.
./hosts/w00149/hardware-configuration.nix /etc/nixos/hardware-configuration.nix
./components/base-software.nix ./components/base-software.nix
./components/user-kurtisa.nix ./components/user-kurtisa.nix
]; ];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Enable networking
networking.networkmanager.enable = true;
networking.hostName = "w00149"; # Define your hostname. networking.hostName = "w00149"; # Define your hostname.
system.stateVersion = "23.11"; # Did you read the comment? system.stateVersion = "23.11"; # Did you read the comment?