commit 5daefd2302fbdeb1256b5521cf63dff9877fa41b Author: brian Date: Sat Dec 13 17:11:31 2025 -0500 initial git connection diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..89b3a77 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +secrets.nix diff --git a/README.md b/README.md new file mode 100644 index 0000000..3df9dd4 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# My Setup for NixOS +This repo is to server as a backup and version manager for my nixos build. + +The current commit is the most up to date, working version. diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..7e2955a --- /dev/null +++ b/configuration.nix @@ -0,0 +1,147 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, ... }: + + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ./gpu-config.nix + ./filesystem.nix + ./nvme-mount.nix + ]; + + # Bootloader. + boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/sda"; + boot.loader.grub.useOSProber = true; + + networking.hostName = "nixos"; # Define your hostname. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Enable networking + networking.networkmanager.enable = true; + + # Set your time zone. + time.timeZone = "America/New_York"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + + # Enable the X11 windowing system. + # You can disable this if you're only using the Wayland session. + services.xserver.enable = true; + + # Enable the KDE Plasma Desktop Environment. + services.displayManager.sddm.enable = true; + services.desktopManager.plasma6.enable = true; + + # Configure keymap in X11 + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + + # Enable CUPS to print documents. + services.printing.enable = true; + + # Enable sound with pipewire. + services.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + # If you want to use JACK applications, uncomment this + #jack.enable = true; + + # use the example session manager (no others are packaged yet so this is enabled by default, + # no need to redefine it in your config for now) + #media-session.enable = true; + }; + + # Enable touchpad support (enabled default in most desktopManager). + # services.xserver.libinput.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.brian = { + isNormalUser = true; + description = "Brian"; + extraGroups = [ "networkmanager" "wheel" ]; + packages = with pkgs; [ + kdePackages.kate + # thunderbird + ]; + }; + + # Install firefox. + programs.firefox.enable = true; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + # wget + librewolf + steam + discord + prismlauncher + piper + git + protonvpn-gui + vscodium + gitea + tea + ]; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + + # List services that you want to enable: + + # Enable the OpenSSH daemon. + # services.openssh.enable = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "25.05"; # Did you read the comment? + +} diff --git a/filesystem.nix b/filesystem.nix new file mode 100644 index 0000000..5ea9046 --- /dev/null +++ b/filesystem.nix @@ -0,0 +1,54 @@ +{ config, lib, pkgs, ... }: + +let + username = "brian"; + uid = 1000; + gid = 100; + + secrets = import ./secrets.nix; + + networkShares = [ + { + name = "seagate8tb"; + device = "//10.0.0.128/PublicShare"; + mountPoint = "/mnt/smb-seagate8tb"; + } + { + name = "wd4tb"; + device = "//10.0.0.65/wd4tb"; + mountPoint = "/mnt/smb-wd4tb"; + } + { + name = "stashapp"; + device = "//10.0.0.65/stashapp"; + mountPoint = "/mnt/smb-app"; + } + ]; + + networkFileSystems = builtins.listToAttrs (map (share: { + name = share.mountPoint; + value = { + device = share.device; + fsType = "cifs"; + options = [ + "username=${secrets."${share.name}Username"}" + "password=${secrets."${share.name}Password"}" + "uid=${toString uid}" + "gid=${toString gid}" + "file_mode=0775" + "dir_mode=0775" + "nofail" # <<< ADDED: Don't fail boot if network is down + "_netdev" # <<< ADDED: Wait for network + ]; + }; + }) networkShares); +in +{ + # Only network shares - NO NVMe for now + fileSystems = networkFileSystems; + + # Create symlinks in home directory for easy access + systemd.tmpfiles.rules = map (share: + "L+ /home/${username}/${share.name} - - - - ${share.mountPoint}" + ) networkShares; +} diff --git a/gpu-config.nix b/gpu-config.nix new file mode 100644 index 0000000..4a69ae0 --- /dev/null +++ b/gpu-config.nix @@ -0,0 +1,30 @@ +{ config, pkgs, ... }: + +{ + # make the kernel use the correct driver early + boot.initrd.kernelModules = [ "amdgpu" ]; + + hardware.graphics.enable = true; + services.xserver.videoDrivers = [ "amdgpu" ]; + + hardware.graphics.enable32Bit = true; + + hardware.graphics.extraPackages = with pkgs; [ + # Mesa drivers (includes OpenGL, Vulkan via RADV) + mesa + + # AMD's official Vulkan driver (optional alternative to RADV) + amdvlk + + # OpenCL support - IMPORTANT: Check which OpenCL implementation works for RX 580 + # For R600-family and newer (RX 580 is GCN 4.0, so should use rusticl eventually) + mesa.opencl # Legacy OpenCL driver (Clover) - being removed soon + # OR for future-proofing (when rusticl becomes default): + # pkgs.mesa.rusticl + + # Video acceleration + libva + libva-utils + vaapiVdpau + ]; +} diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 100644 index 0000000..cd193e7 --- /dev/null +++ b/hardware-configuration.nix @@ -0,0 +1,32 @@ +# 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" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/1aa4a223-cd34-42c1-88d5-38d082cfed48"; + fsType = "ext4"; + }; + + 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp27s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/nvme-mount.nix b/nvme-mount.nix new file mode 100644 index 0000000..34fe214 --- /dev/null +++ b/nvme-mount.nix @@ -0,0 +1,16 @@ +{ config, lib, pkgs, ... }: + +{ + fileSystems."/mnt/nvme" = { + device = "/dev/nvme0n1"; + fsType = "ext4"; + options = [ + "defaults" + "nofail" + ]; + }; + + systemd.tmpfiles.rules = [ + "d /mnt/nvme 0775 brian users -" + ]; +}