Add retroarch to home config, modularize nixos config.

This commit is contained in:
CronyAkatsuki 2024-02-15 09:56:09 +01:00
parent 264dff6565
commit f1df19ed9b
6 changed files with 105 additions and 93 deletions

View File

@ -50,7 +50,11 @@
lazygit # Amazing git tui lazygit # Amazing git tui
lm_sensors # Sensor monitoring tool lm_sensors # Sensor monitoring tool
(nerdfonts.override { fonts = [ "CascadiaCode" ]; }) # Best font (nerdfonts.override { fonts = [ "CascadiaCode" ]; }) # Best font
(retroarch.override {
cores = with libretro; [
snes9x
];
})
# # You can also create simple shell scripts directly inside your # # You can also create simple shell scripts directly inside your
# # configuration. For example, this adds a command 'my-hello' to your # # configuration. For example, this adds a command 'my-hello' to your

View File

@ -5,18 +5,16 @@
imports = imports =
[ [
./hardware-configuration.nix ./hardware-configuration.nix
./modules/wifi-dongle.nix
./modules/disable-hibernation.nix
./modules/dns-over-https.nix
./modules/nvidia.nix
]; ];
# Bootloader. # Bootloader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
# Modules
boot.blacklistedKernelModules = [ "rtl8xxxu" "iwlwifi"];
boot.extraModulePackages = with config.boot.kernelPackages; [
rtl8192eu
];
# Set the hostname # Set the hostname
networking.hostName = "nixos"; networking.hostName = "nixos";
@ -26,63 +24,16 @@
# Allow unfree packages # Allow unfree packages
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
# Disable hibernation, sleep and other friends
systemd.targets = {
sleep = {
enable = false;
unitConfig.DefaultDependencies = "no";
};
suspend = {
enable = false;
unitConfig.DefaultDependencies = "no";
};
hibernate = {
enable = false;
unitConfig.DefaultDependencies = "no";
};
"hybrid-sleep" = {
enable = false;
unitConfig.DefaultDependencies = "no";
};
};
# Enable networking # Enable networking
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Europe/Zagreb";
# Set iwd as wifi backend # Set iwd as wifi backend
networking.wireless.iwd.enable = true; networking.wireless.iwd.enable = true;
networking.networkmanager.wifi.backend = "iwd"; networking.networkmanager.wifi.backend = "iwd";
networking.networkmanager.wifi.powersave = false; networking.networkmanager.wifi.powersave = false;
### --- Enabling DNS Over HTTPS --- ### # Set your time zone.
time.timeZone = "Europe/Zagreb";
# make network manager not set a default dns
networking.networkmanager.dns = "none";
# set dns to local nameservers
networking.nameservers = [ "127.0.0.1" "::1" ];
# Dnscrypt for dns over https
services.dnscrypt-proxy2 = {
enable = true;
settings = {
ipv6_servers = true;
require_dnssec = true;
sources.public-resolvers = {
urls = [
"https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/public-resolvers.md"
"https://download.dnscrypt.info/resolvers-list/v3/public-resolvers.md"
];
cache_file = "/var/lib/dnscrypt-proxy2/public-resolvers.md";
minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3";
};
# use mullvad dns server
server_names = [ "mullvad-base-doh" ];
};
};
# Select internationalisation properties. # Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";
@ -112,7 +63,7 @@
# Enable touchpad support # Enable touchpad support
services.xserver.libinput.enable = true; services.xserver.libinput.enable = true;
# Enable the KDE Plasma Desktop Environment. # Enable sddm with catppuccin theme and fix virtual keyboard bug
services.xserver.displayManager.sddm = { services.xserver.displayManager.sddm = {
enable = true; enable = true;
theme = "catppuccin-sddm-corners"; theme = "catppuccin-sddm-corners";
@ -123,6 +74,8 @@
}; };
}; };
}; };
# Setup plasma with excluding a couple unnecesarry packages
services.xserver.desktopManager.plasma5.enable = true; services.xserver.desktopManager.plasma5.enable = true;
environment.plasma5.excludePackages = with pkgs.libsForQt5; [ environment.plasma5.excludePackages = with pkgs.libsForQt5; [
plasma-browser-integration plasma-browser-integration
@ -131,7 +84,7 @@
]; ];
# Enable CUPS to print documents. # Enable CUPS to print documents.
services.printing.enable = false; services.printing.enable = true;
# Enable gvfs # Enable gvfs
services.gvfs.enable = true; services.gvfs.enable = true;
@ -154,34 +107,6 @@
driSupport32Bit = true; driSupport32Bit = true;
}; };
# Nvidia settings
hardware.nvidia = {
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
powerManagement.enable = true;
# Nvidia fine grainder power management, super experimental.
powerManagement.finegrained = false;
open = false;
# Enable the Nvidia settings menu,
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
# Nvidia prime settings
hardware.nvidia.prime = {
reverseSync.enable = true;
intelBusId = "PCI:5:0:0";
nvidiaBusId = "PCI:1:0:0";
};
# Enable bluetooth # Enable bluetooth
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;
@ -263,13 +188,6 @@
isNormalUser = true; isNormalUser = true;
description = "Crony"; description = "Crony";
extraGroups = [ "networkmanager" "wheel" ]; extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [
(retroarch.override {
cores = with libretro; [
snes9x
];
})
];
shell = pkgs.zsh; shell = pkgs.zsh;
}; };

View File

@ -0,0 +1,22 @@
{ ... }:
{
# Disable hibernation, sleep and other friends
systemd.targets = {
sleep = {
enable = false;
unitConfig.DefaultDependencies = "no";
};
suspend = {
enable = false;
unitConfig.DefaultDependencies = "no";
};
hibernate = {
enable = false;
unitConfig.DefaultDependencies = "no";
};
"hybrid-sleep" = {
enable = false;
unitConfig.DefaultDependencies = "no";
};
};
}

View File

@ -0,0 +1,29 @@
{ ... }:
{
### --- Enabling DNS Over HTTPS --- ###
# make network manager not set a default dns
networking.networkmanager.dns = "none";
# set dns to local nameservers
networking.nameservers = [ "127.0.0.1" "::1" ];
# Dnscrypt for dns over https
services.dnscrypt-proxy2 = {
enable = true;
settings = {
ipv6_servers = true;
require_dnssec = true;
sources.public-resolvers = {
urls = [
"https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/public-resolvers.md"
"https://download.dnscrypt.info/resolvers-list/v3/public-resolvers.md"
];
cache_file = "/var/lib/dnscrypt-proxy2/public-resolvers.md";
minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3";
};
# use mullvad dns server
server_names = [ "mullvad-base-doh" ];
};
};
}

31
nixos/modules/nvidia.nix Normal file
View File

@ -0,0 +1,31 @@
{ config, ... }:
{
# Nvidia settings
hardware.nvidia = {
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
powerManagement.enable = true;
# Nvidia fine grainder power management, super experimental.
powerManagement.finegrained = false;
# Open kernel drivers
open = false;
# Enable the Nvidia settings menu,
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
# Nvidia optimus prime settings
hardware.nvidia.prime = {
reverseSync.enable = true;
intelBusId = "PCI:5:0:0";
nvidiaBusId = "PCI:1:0:0";
};
}

View File

@ -0,0 +1,8 @@
{ config, ... }:
{
# Setup correct modules for tplink wifi dongle and disable builtin wifi card.
boot.blacklistedKernelModules = [ "rtl8xxxu" "iwlwifi" ];
boot.extraModulePackages = with config.boot.kernelPackages; [
rtl8192eu
];
}