clean up configuration.nix to move all configurations to the same locations

This commit is contained in:
mjallen18
2024-02-15 13:37:52 -06:00
parent 37540f1ef4
commit 3c7124593c

View File

@@ -4,6 +4,9 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
user = "matt";
hostname = "matt-nixos";
timezone = "America/Chicago";
# discover-wrapper is needed as of 1/24/24 since PackageKit does not work correctly so this removes error messages. # discover-wrapper is needed as of 1/24/24 since PackageKit does not work correctly so this removes error messages.
discover-wrapped = pkgs.symlinkJoin discover-wrapped = pkgs.symlinkJoin
{ {
@@ -25,24 +28,21 @@ in
# Enable nix flakes and nix-command tools # Enable nix flakes and nix-command tools
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [ "nix-command" "flakes" ];
# Enable non free # Configure bootloader with lanzaboot and secureboot
nixpkgs.config.allowUnfree = true; boot = {
loader = {
systemd-boot = {
enable = false;
configurationLimit = 2;
};
time.hardwareClockInLocalTime = true; efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot";
};
};
# Use the systemd-boot EFI boot loader. lanzaboote = {
boot.loader.systemd-boot.enable = false;
boot.loader.systemd-boot.configurationLimit = 2;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.efi.efiSysMountPoint = "/boot";
# boot.plymouth.enable = true;
boot.bootspec.enable = true;
boot.consoleLogLevel = 3;
boot.kernelParams = [
"quiet" "amdgpu.ppfeaturemask=0xffffffff"
];
boot.lanzaboote = {
enable = true; enable = true;
pkiBundle = "/etc/secureboot"; pkiBundle = "/etc/secureboot";
settings = { settings = {
@@ -52,86 +52,91 @@ in
configurationLimit = 2; configurationLimit = 2;
}; };
services.fwupd.enable = true;
hardware.enableAllFirmware = true;
# Override kernel to latest # Override kernel to latest
boot.kernelPackages = pkgs.linuxPackages_latest; kernelPackages = pkgs.linuxPackages_latest;
networking.hostName = "matt-nixos"; # Define your hostname. kernelParams = [
# Pick only one of the below networking options. "quiet" "amdgpu.ppfeaturemask=0xffffffff"
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. ];
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
# Bluetooth consoleLogLevel = 3;
hardware.bluetooth.enable = true; bootspec.enable = true;
hardware.xpadneo.enable = true;
# Steam udev rules for remote play
hardware.steam-hardware.enable = true;
# Set your time zone.
time.timeZone = "America/Chicago";
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Network option required using sysctl to let Ubisoft Connect work as of 7-12-2023 # Network option required using sysctl to let Ubisoft Connect work as of 7-12-2023
boot.kernel.sysctl."net.ipv4.tcp_mtu_probing" = 1; kernel.sysctl."net.ipv4.tcp_mtu_probing" = 1;
# Select internationalisation properties. # Enable AppImage
# i18n.defaultLocale = "en_US.UTF-8"; binfmt.registrations.appimage = {
# console = { wrapInterpreterInShell = false;
# font = "Lat2-Terminus16"; interpreter = "${pkgs.appimage-run}/bin/appimage-run";
# keyMap = "us"; recognitionType = "magic";
# useXkbConfig = true; # use xkb.options in tty. offset = 0;
# }; mask = ''\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff'';
magicOrExtension = ''\x7fELF....AI\x02'';
};
};
# Hardware configs
hardware = {
# Bluetooth
bluetooth.enable = true;
# Xbox controllers
xpadneo.enable = true;
# Steam udev rules for remote play
steam-hardware.enable = true;
# Enable all firmware
enableAllFirmware = true;
# Disable pulse audio in favor of pipewire
pulseaudio.enable = false;
opengl.enable = true;
# Enables support for 32bit libs that steam uses
opengl.driSupport32Bit = true;
};
# Services configs
services = {
# Enable firmware updates
fwupd.enable = true;
# Enable the X11 windowing system. # Enable the X11 windowing system.
services.xserver.enable = true; xserver = {
enable = true;
# Enable the Plasma 6 Desktop Environment.
# Enable the Plasma 5 Desktop Environment. displayManager = {
services.xserver.displayManager.sddm.enable = true; sddm.enable = true;
# services.xserver.desktopManager.plasma5.enable = true; defaultSession = "plasma";
services.xserver.desktopManager.plasma6.enable = true; };
# services.xserver.displayManager.defaultSession = "plasmawayland"; desktopManager.plasma6.enable = true;
services.xserver.displayManager.defaultSession = "plasma"; };
# Configure keymap in X11
# services.xserver.xkb.layout = "us";
# services.xserver.xkb.options = "eurosign:e,caps:escape";
# Enable CUPS to print documents. # Enable CUPS to print documents.
services.printing.enable = true; printing.enable = true;
# enable auto discovery of printers # configure pipewire
services.avahi = { pipewire = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
# Enable sound.
# sound.enable = true;
# hardware.pulseaudio.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true; enable = true;
alsa.enable = true; alsa.enable = true;
alsa.support32Bit = true; alsa.support32Bit = true;
pulse.enable = true; pulse.enable = true;
}; };
# Enable Flatpak # enable auto discovery of printers
services.flatpak.enable = true; avahi = {
# xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-kde ]; enable = true;
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; nssmdns4 = true;
openFirewall = true;
};
services.flatpak.packages = [ # Enable Flatpak
flatpak.enable = true;
flatpak.packages = [
"com.discordapp.Discord" "com.discordapp.Discord"
"com.spotify.Client" "com.spotify.Client"
"com.visualstudio.code" "com.visualstudio.code"
@@ -140,115 +145,32 @@ in
"net.davidotek.pupgui2" # Proton-Up Qt "net.davidotek.pupgui2" # Proton-Up Qt
"io.github.prateekmedia.appimagepool" "io.github.prateekmedia.appimagepool"
]; ];
# Enable AppImage
boot.binfmt.registrations.appimage = {
wrapInterpreterInShell = false;
interpreter = "${pkgs.appimage-run}/bin/appimage-run";
recognitionType = "magic";
offset = 0;
mask = ''\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff'';
magicOrExtension = ''\x7fELF....AI\x02'';
}; };
# Force radv # Networking configs
environment.variables.AMD_VULKAN_ICD = "RADV"; networking = {
hostName = hostname;
hardware.opengl.extraPackages = [ # Enable Network Manager
pkgs.amdvlk networkmanager.enable = true;
];
# To enable Vulkan support for 32-bit applications, also add:
hardware.opengl.extraPackages32 = [
pkgs.driversi686Linux.amdvlk
];
hardware.opengl.enable = true;
# For etcher
nixpkgs.config.permittedInsecurePackages = [
"electron-19.1.9"
];
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
programs.fish.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.matt = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" ]; # Enable sudo for the user.
shell = pkgs.fish;
packages = with pkgs; [
firefox
tree
lm_sensors
vmware-horizon-client
etcher
];
}; };
# List packages installed in system profile. To search, run: # Time config
# $ nix search wget time = {
environment.systemPackages = with pkgs; [ # Set your time zone.
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. timeZone = timezone;
wget hardwareClockInLocalTime = true;
nano }
os-prober
efibootmgr
git
sbctl
gparted
discover-wrapped
pciutils
papirus-icon-theme
vulkan-tools
aspell
aspellDicts.en
aspellDicts.en-computers
aspellDicts.en-science
aha
clinfo
# eglinfo
# glxinfo
# wayland-info
neofetch # xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-kde ];
gamescope xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
mangohud
goverlay
heroic
];
programs.java.enable = true; # Security config
programs.corectrl.enable = true; security = {
rtkit.enable = true;
# Steam # configure sudo
programs.steam = { sudo = {
enable = true;
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
};
hardware.opengl.driSupport32Bit = true; # Enables support for 32bit libs that steam uses
nixpkgs.config.packageOverrides = pkgs: {
steam = pkgs.steam.override {
extraPkgs = pkgs: with pkgs; [
xorg.libXcursor
xorg.libXi
xorg.libXinerama
xorg.libXScrnSaver
libpng
libpulseaudio
libvorbis
stdenv.cc.cc.lib
libkrb5
keyutils
];
};
};
security.sudo = {
enable = true; enable = true;
extraRules = [{ extraRules = [{
commands = [ commands = [
@@ -273,7 +195,8 @@ in
}]; }];
}; };
security.polkit = { # Configure polkit
polkit = {
enable = true; enable = true;
extraConfig = '' extraConfig = ''
polkit.addRule(function(action, subject) { polkit.addRule(function(action, subject) {
@@ -287,30 +210,99 @@ in
}); });
''; '';
}; };
};
# Some programs need SUID wrappers, can be configured further or are # Configure environment
# started in user sessions. environment = {
# programs.mtr.enable = true; # List packages installed in system profile. To search, run:
# programs.gnupg.agent = { # $ nix search wget
# enable = true; systemPackages = with pkgs; [
# enableSSHSupport = true; vim
# }; wget
nano
os-prober
efibootmgr
git
sbctl
gparted
discover-wrapped
pciutils
papirus-icon-theme
vulkan-tools
aspell
aspellDicts.en
aspellDicts.en-computers
aspellDicts.en-science
aha
clinfo
neofetch
gamescope
mangohud
goverlay
heroic
];
# List services that you want to enable: # Force radv
variables.AMD_VULKAN_ICD = "RADV";
};
# Enable the OpenSSH daemon. # Configure programs
# services.openssh.enable = true; programs = {
fish.enable = true;
java.enable = true;
corectrl.enable = true;
# Open ports in the firewall. # Steam
# networking.firewall.allowedTCPPorts = [ ... ]; steam = {
# networking.firewall.allowedUDPPorts = [ ... ]; enable = true;
# Or disable the firewall altogether. remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
# networking.firewall.enable = false; dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
};
};
# Copy the NixOS configuration file and link it from the resulting system # Configure nixpkgs
# (/run/current-system/configuration.nix). This is useful in case you nixpkgs = {
# accidentally delete configuration.nix. config = {
# system.copySystemConfiguration = true; # Enable non free
allowUnfree = true;
permittedInsecurePackages = [
# allow insecure electron for etcher
"electron-19.1.9"
];
packageOverrides = pkgs: {
steam = pkgs.steam.override {
extraPkgs = pkgs: with pkgs; [
xorg.libXcursor
xorg.libXi
xorg.libXinerama
xorg.libXScrnSaver
libpng
libpulseaudio
libvorbis
stdenv.cc.cc.lib
libkrb5
keyutils
];
};
};
};
};
# Define a user account. Don't forget to set a password with passwd.
users.users."${user}" = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" ]; # Enable sudo for the user.
shell = pkgs.fish;
packages = with pkgs; [
firefox
tree
lm_sensors
vmware-horizon-client
etcher
];
};
# This option defines the first version of NixOS you have installed on this particular machine, # This option defines the first version of NixOS you have installed on this particular machine,
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.