Move config into hosts folder
This commit is contained in:
parent
f0ba2200e8
commit
8ddd026085
5 changed files with 2 additions and 27 deletions
336
nixos/hosts/nixos/configuration.nix
Normal file
336
nixos/hosts/nixos/configuration.nix
Normal file
|
@ -0,0 +1,336 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
unstable,
|
||||
inputs,
|
||||
nix-your-shell,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
inputs.ucodenix.nixosModules.default
|
||||
];
|
||||
|
||||
# Use the latest linux Kernel
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
# boot.kernelPackages = unstable.linuxPackages_xanmod_latest;
|
||||
# boot.kernelPackages = pkgs.linuxPackages_6_14;
|
||||
# boot.kernelPackages = pkgs.linuxPackages_6_13;
|
||||
|
||||
# Bootloader.
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = 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;
|
||||
|
||||
i18n = {
|
||||
|
||||
# Select internationalisation properties.
|
||||
defaultLocale = "C.UTF-8";
|
||||
|
||||
extraLocaleSettings = {
|
||||
LC_ADDRESS = "C.UTF-8";
|
||||
LC_IDENTIFICATION = "C.UTF-8";
|
||||
LC_MEASUREMENT = "C.UTF-8";
|
||||
LC_MONETARY = "C.UTF-8";
|
||||
LC_NAME = "C.UTF-8";
|
||||
LC_NUMERIC = "C.UTF-8";
|
||||
LC_PAPER = "C.UTF-8";
|
||||
LC_TELEPHONE = "C.UTF-8";
|
||||
LC_TIME = "C.UTF-8";
|
||||
};
|
||||
|
||||
supportedLocales = [ "all" ];
|
||||
};
|
||||
|
||||
# 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.
|
||||
hardware.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.buymymojo = {
|
||||
isNormalUser = true;
|
||||
description = "Aria";
|
||||
extraGroups = [
|
||||
"networkmanager"
|
||||
"wheel"
|
||||
"video"
|
||||
"docker"
|
||||
"openrazer"
|
||||
"gamemode"
|
||||
"corectrl"
|
||||
];
|
||||
# packages = with pkgs; [
|
||||
# # discord.override { withMoonlight = true; }
|
||||
# ];
|
||||
|
||||
# packages = [
|
||||
# # (unstable.discord.override { withMoonlight = true; })
|
||||
# ];
|
||||
};
|
||||
|
||||
# Enable automatic login for the user.
|
||||
services.displayManager.autoLogin.enable = true;
|
||||
services.displayManager.autoLogin.user = "buymymojo";
|
||||
programs.java = {
|
||||
enable = true;
|
||||
package = pkgs.zulu23;
|
||||
};
|
||||
|
||||
programs.thunderbird.enable = true;
|
||||
|
||||
|
||||
programs.gpu-screen-recorder = {
|
||||
enable = true;
|
||||
package = unstable.gpu-screen-recorder;
|
||||
};
|
||||
|
||||
programs.corectrl = {
|
||||
enable = true;
|
||||
gpuOverclock = {
|
||||
enable = true;
|
||||
ppfeaturemask = "0xffffffff";
|
||||
};
|
||||
};
|
||||
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
package = pkgs.steam.override {
|
||||
extraPkgs = (pkgs: with pkgs; with unstable; [
|
||||
gamemode
|
||||
unstable.mangohud
|
||||
# additional packages...
|
||||
# e.g. some games require python3
|
||||
]);
|
||||
};
|
||||
|
||||
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
|
||||
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
|
||||
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
|
||||
};
|
||||
programs.steam.gamescopeSession.enable = true;
|
||||
programs.steam.protontricks.enable = true;
|
||||
hardware.steam-hardware.enable = true;
|
||||
programs.gamescope.enable = true;
|
||||
programs.gamemode.enable = true;
|
||||
|
||||
programs.noisetorch.enable = true;
|
||||
|
||||
# Allow unfree packages
|
||||
# nixpkgs.config.allowUnfree = true;
|
||||
# unstable.config.allowUnfree = true;
|
||||
|
||||
# List packages installed in system profile. To search, run:
|
||||
# $ nix search wget
|
||||
environment.systemPackages =
|
||||
with pkgs;
|
||||
with unstable;
|
||||
[
|
||||
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
||||
# wget
|
||||
fzf
|
||||
nixfmt-rfc-style
|
||||
unstable.dwarfs
|
||||
unrar
|
||||
unstable.mpv
|
||||
pkgs.clamav
|
||||
unstable.waypipe
|
||||
unstable.nix-your-shell
|
||||
|
||||
amdgpu_top
|
||||
# unstable.mangohud
|
||||
|
||||
unstable.svt-av1-psy
|
||||
unstable.ffmpeg-full
|
||||
unstable.ab-av1
|
||||
unstable.whisper-cpp-vulkan
|
||||
|
||||
vscode.fhs # .fhs version will be more compatable even if slightly less nix flavoured
|
||||
|
||||
# unstable.openrazer-daemon # Broken, enable again in a few days?
|
||||
|
||||
# === nix related ===
|
||||
comma
|
||||
nh
|
||||
# === nix related ===
|
||||
|
||||
rustc
|
||||
cargo
|
||||
go
|
||||
pnpm
|
||||
zig
|
||||
maven
|
||||
gradle
|
||||
gcc
|
||||
dotnetCorePackages.sdk_8_0_3xx
|
||||
(pkgs.writeShellScriptBin "python" ''
|
||||
export LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH
|
||||
exec ${pkgs.python312}/bin/python "$@"
|
||||
'')
|
||||
# noisetorch
|
||||
# yad
|
||||
# unzip
|
||||
# wget
|
||||
# xdotool
|
||||
# xxd
|
||||
# xorg.xwininfo
|
||||
];
|
||||
|
||||
programs.nix-ld.enable = true;
|
||||
programs.nix-ld.libraries = with pkgs; [
|
||||
# === Godot ===
|
||||
xorg.libXcursor
|
||||
xorg.libXinerama
|
||||
xorg.libXext
|
||||
xorg.libXrandr
|
||||
xorg.libXrender
|
||||
xorg.libX11
|
||||
xorg.libXi
|
||||
libGL
|
||||
wayland
|
||||
wayland-scanner
|
||||
vulkan-loader
|
||||
fontconfig
|
||||
libxkbcommon
|
||||
dbus
|
||||
libpulseaudio
|
||||
dotnetCorePackages.sdk_8_0_3xx
|
||||
alsa-lib
|
||||
icu
|
||||
# === Godot ===
|
||||
|
||||
# === Ludusavi ===
|
||||
gtk3
|
||||
gtk4
|
||||
glib
|
||||
glibc
|
||||
# === Ludusavi ===
|
||||
|
||||
# === html wallpaper ===
|
||||
python312Packages.pyqt6-webengine
|
||||
# ===
|
||||
|
||||
zlib
|
||||
zstd
|
||||
stdenv.cc.cc
|
||||
curl
|
||||
openssl
|
||||
attr
|
||||
libssh
|
||||
bzip2
|
||||
libxml2
|
||||
acl
|
||||
libsodium
|
||||
util-linux
|
||||
xz
|
||||
systemd
|
||||
];
|
||||
|
||||
# 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.
|
||||
|
||||
virtualisation.docker.enable = true;
|
||||
virtualisation.docker.storageDriver = "btrfs";
|
||||
# virtualisation.docker.rootless = {
|
||||
# enable = true;
|
||||
# setSocketVariable = true;
|
||||
# };
|
||||
|
||||
# Open ports in the firewall.
|
||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||
# Or disable the firewall altogether.
|
||||
networking.firewall.enable = false;
|
||||
|
||||
networking.hosts = {
|
||||
"192.168.20.2" = [
|
||||
"upload.aria.coffee"
|
||||
"aria.local"
|
||||
"dev.aria.coffee"
|
||||
"vtt.buymymojo.net"
|
||||
"home-status.buymymojo.net"
|
||||
"syncthing-home.aria.coffee"
|
||||
"localfile.aria.coffee"
|
||||
"jellyfin.buymymojo.net"
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
|
||||
# environment.variables = {
|
||||
# };
|
||||
|
||||
environment.sessionVariables = {
|
||||
# === Prefer RADV driver ===
|
||||
AMD_VULKAN_ICD = "RADV";
|
||||
VK_ICD_FILENAMES = "/run/opengl-driver/share/vulkan/icd.d/radeon_icd.x86_64.json";
|
||||
|
||||
FLAKE = "/home/buymymojo/etc/nixos/";
|
||||
|
||||
MANGOHUD = "1";
|
||||
|
||||
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT = "1"; # Fixes godot 4 mono's launch issues
|
||||
};
|
||||
|
||||
# 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 = "24.11"; # Did you read the comment?
|
||||
|
||||
}
|
213
nixos/hosts/nixos/hardware-configuration.nix
Normal file
213
nixos/hosts/nixos/hardware-configuration.nix
Normal file
|
@ -0,0 +1,213 @@
|
|||
# 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,
|
||||
unstable,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"uas"
|
||||
"usbhid"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
];
|
||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.kernelParams = [ "microcode.amd_sha_check=off" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/0f2c323f-446e-4f3b-a188-be7ab574a6b2";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=@" ];
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/3466-259A";
|
||||
fsType = "vfat";
|
||||
options = [
|
||||
"fmask=0077"
|
||||
"dmask=0077"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/home/buymymojo/Videos" = {
|
||||
device = "/dev/disk/by-uuid/2f5047c5-49ea-455d-ae29-9d8e07a77181";
|
||||
fsType = "ext4";
|
||||
options = [
|
||||
"users"
|
||||
"nofail"
|
||||
"x-gvfs-show"
|
||||
"x-gvfs-name=Videos"
|
||||
"exec"
|
||||
"rw"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/run/media/buymymojo/KingstonSSD" = {
|
||||
device = "/dev/disk/by-uuid/ad01c809-a2dc-48b2-b1f8-95d8d341b586";
|
||||
fsType = "ext4";
|
||||
options = [
|
||||
"nofail"
|
||||
"users"
|
||||
"x-gvfs-show"
|
||||
"x-gvfs-name=KingstonSSD"
|
||||
"exec"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/run/media/buymymojo/sde1" = {
|
||||
device = "/dev/disk/by-uuid/0630447f-36b0-4355-9734-8aea1c318d56";
|
||||
fsType = "ext4";
|
||||
options = [
|
||||
"nofail"
|
||||
"users"
|
||||
"x-gvfs-show"
|
||||
"x-gvfs-name=CrucialBX500"
|
||||
"exec"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/run/media/buymymojo/sdf2" = {
|
||||
device = "/dev/disk/by-uuid/718f9731-8652-4146-90be-864ccde39e3f";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"compress=zstd:4"
|
||||
"x-gvfs-name=data"
|
||||
"nofail"
|
||||
"users"
|
||||
"x-gvfs-show"
|
||||
"rw"
|
||||
"exec"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/run/media/buymymojo/1TB\040HDD" = {
|
||||
device = "/dev/disk/by-uuid/17533a6c-2ac3-4765-b620-21214c752dc5";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"nosuid"
|
||||
"nodev"
|
||||
"x-gvfs-show"
|
||||
"x-gvfs-name=1TB%20HDD"
|
||||
"exec"
|
||||
"nofail"
|
||||
"users"
|
||||
"compress=zstd:4"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/run/media/buymymojo/Gen4-SSD" = {
|
||||
device = "/dev/disk/by-uuid/ce2d927a-be94-476f-aa36-b1daf5d92ace";
|
||||
fsType = "auto";
|
||||
options = [
|
||||
"nosuid"
|
||||
"nodev"
|
||||
"nofail"
|
||||
"x-gvfs-show"
|
||||
"x-gvfs-name=Gen4-SSD"
|
||||
"exec"
|
||||
"compress=zstd:1"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/run/media/buymymojo/SamsungSSD" = {
|
||||
device = "/dev/disk/by-uuid/3bf433b1-a75d-47d0-9d7f-da8efe69387e";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"nofail"
|
||||
"users"
|
||||
"exec"
|
||||
"x-gvfs-show"
|
||||
"x-gvfs-name=SamsungSSD"
|
||||
"compress=zstd:1"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/run/media/buymymojo/2TB-WDHDD" = {
|
||||
device = "/dev/disk/by-uuid/fc8b438e-78ed-41bf-bac2-c821fd647136";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"nosuid"
|
||||
"nodev"
|
||||
"nofail"
|
||||
"x-gvfs-show"
|
||||
"x-gvfs-name=2TB-WDHDD"
|
||||
"exec"
|
||||
"compress=zstd:1"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/run/media/buymymojo/4TB-SSD" = {
|
||||
device = "/dev/disk/by-uuid/9388e9a7-ea7b-4fb4-8062-93255a64b22f";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"nosuid"
|
||||
"nodev"
|
||||
"nofail"
|
||||
"x-gvfs-show"
|
||||
"x-gvfs-name=4TB-SSD"
|
||||
"exec"
|
||||
"compress=zstd:1"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/run/media/buymymojo/ExternalLinuxHDD" = {
|
||||
device = "/dev/disk/by-uuid/75d0408e-9e2c-47d0-aec3-cbc910d3c7d5";
|
||||
fsType = "ext4";
|
||||
options = [
|
||||
"nosuid"
|
||||
"nodev"
|
||||
"nofail"
|
||||
"x-gvfs-show"
|
||||
];
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{ device = "/dev/disk/by-uuid/64f19dfc-26bb-471b-81c5-ffb54e4191a5"; }
|
||||
];
|
||||
|
||||
# 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.enp4s0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp6s0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
hardware = {
|
||||
graphics = {
|
||||
# === vulkan/mesa ===
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
# package = unstable.mesa;
|
||||
# === vulkan/mesa ===
|
||||
|
||||
# === amdvlk driver ===
|
||||
};
|
||||
amdgpu.amdvlk = {
|
||||
enable = true;
|
||||
support32Bit.enable = true;
|
||||
};
|
||||
# === amdvlk driver ===
|
||||
|
||||
# openrazer.enable = true;
|
||||
|
||||
};
|
||||
}
|
98
nixos/hosts/nixos/services.nix
Normal file
98
nixos/hosts/nixos/services.nix
Normal file
|
@ -0,0 +1,98 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
unstable,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
|
||||
systemd.services.jellyfin-rpc = {
|
||||
enable = false;
|
||||
path = [ pkgs.jellyfin-rpc ];
|
||||
serviceConfig = {
|
||||
User = "buymymojo";
|
||||
ExecStart = "${pkgs.nix}/bin/nix run nixpkgs#jellyfin-rpc";
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
openssh.enable = true;
|
||||
flatpak.enable = true;
|
||||
pcscd.enable = true;
|
||||
|
||||
sunshine = {
|
||||
enable = true;
|
||||
autoStart = true;
|
||||
capSysAdmin = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
|
||||
ucodenix = {
|
||||
enable = true;
|
||||
# cpuModelId = "00A20F12"; # AMD 5900X
|
||||
};
|
||||
|
||||
syncthing = {
|
||||
enable = true;
|
||||
group = "users";
|
||||
user = "buymymojo";
|
||||
dataDir = "/home/buymymojo/Documents/Syncthing"; # Default folder for new synced folders
|
||||
configDir = "/home/buymymojo/Documents/.config/syncthing"; # Folder for Syncthing's settings and keys
|
||||
};
|
||||
|
||||
clamav = {
|
||||
daemon.enable = true;
|
||||
daemon.settings = {
|
||||
MaxThreads = 16;
|
||||
};
|
||||
updater.enable = true;
|
||||
updater.interval = "weekly";
|
||||
updater.settings = {
|
||||
CompressLocalDatabase = true;
|
||||
};
|
||||
};
|
||||
|
||||
# services.blocky = {
|
||||
# enable = true;
|
||||
# settings = {
|
||||
# ports.dns = 53; # Port for incoming DNS Queries.
|
||||
# upstreams.groups.default = [
|
||||
# "https://one.one.one.one/dns-query" # Using Cloudflare's DNS over HTTPS server for resolving queries.
|
||||
# ];
|
||||
# # For initially solving DoH/DoT Requests when no system Resolver is available.
|
||||
# bootstrapDns = {
|
||||
# upstream = "https://one.one.one.one/dns-query";
|
||||
# ips = [ "1.1.1.1" "1.0.0.1" ];
|
||||
# };
|
||||
# #Enable Blocking of certian domains.
|
||||
# blocking = {
|
||||
# blackLists = {
|
||||
# #Adblocking
|
||||
# ads = [
|
||||
# "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts"
|
||||
# "https://adaway.org/hosts.txt"
|
||||
# "https://v.firebog.net/hosts/AdguardDNS.txt"
|
||||
# ];
|
||||
# #Another filter for blocking adult sites
|
||||
# adult = ["https://blocklistproject.github.io/Lists/porn.txt"];
|
||||
# #You can add additional categories
|
||||
# };
|
||||
# #Configure what block categories are used
|
||||
# clientGroupsBlock = {
|
||||
# default = [ "ads" ];
|
||||
# # kids-ipad = ["ads" "adult"];
|
||||
# };
|
||||
# };
|
||||
# customDNS = {
|
||||
# customTTL = "1h";
|
||||
# mapping = {
|
||||
# "upload.aria.coffee" = "192.168.20.2";
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue