initial git connection
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
secrets.nix
|
||||
4
README.md
Normal file
4
README.md
Normal file
@@ -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.
|
||||
147
configuration.nix
Normal file
147
configuration.nix
Normal file
@@ -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?
|
||||
|
||||
}
|
||||
54
filesystem.nix
Normal file
54
filesystem.nix
Normal file
@@ -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;
|
||||
}
|
||||
30
gpu-config.nix
Normal file
30
gpu-config.nix
Normal file
@@ -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
|
||||
];
|
||||
}
|
||||
32
hardware-configuration.nix
Normal file
32
hardware-configuration.nix
Normal file
@@ -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.<interface>.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;
|
||||
}
|
||||
16
nvme-mount.nix
Normal file
16
nvme-mount.nix
Normal file
@@ -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 -"
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user