zaneyos/hosts/familypc/config.nix

417 lines
9.8 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
config,
pkgs,
host,
inputs,
username,
options,
...
}:
{
imports = [
./hardware.nix
./users.nix
../../modules/amd-drivers.nix
../../modules/nvidia-drivers.nix
../../modules/nvidia-prime-drivers.nix
../../modules/intel-drivers.nix
../../modules/vm-guest-services.nix
../../modules/local-hardware-clock.nix
];
# Kernel
boot.kernelPackages = pkgs.linuxPackages;
# boot.kernelPackages = pkgs.linuxPackages_zen;
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernel.sysctl = {
"vm.max_map_count" = 2147483642;
};
boot.tmp.useTmpfs = false;
boot.tmp.tmpfsSize = "30%";
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'';
};
# This is for OBS Virtual Cam Support - v4l2loopback setup
boot.kernelModules = [ "v4l2loopback" ];
boot.extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
# Styling Options
stylix.image = ../../config/wallpapers/zaney-wallpaper.jpg;
# stylix.base16Scheme = {
# base00 = "232136";
# base01 = "2a273f";
# base02 = "393552";
# base03 = "6e6a86";
# base04 = "908caa";
# base05 = "e0def4";
# base06 = "e0def4";
# base07 = "56526e";
# base08 = "eb6f92";
# base09 = "f6c177";
# base0A = "ea9a97";
# base0B = "3e8fb0";
# base0C = "9ccfd8";
# base0D = "c4a7e7";
# base0E = "f6c177";
# base0F = "56526e";
# };
stylix.polarity = "dark";
stylix.cursor.package = pkgs.bibata-cursors;
stylix.cursor.name = "Bibata-Modern-Ice";
stylix.cursor.size = 24;
stylix.fonts = {
monospace = {
package = pkgs.nerdfonts.override { fonts = [ "JetBrainsMono" ]; };
name = "JetBrainsMono Nerd Font Mono";
};
sansSerif = {
package = pkgs.dejavu_fonts;
name = "DejaVu Sans";
};
serif = {
package = pkgs.dejavu_fonts;
name = "DejaVu Serif";
};
};
stylix.fonts.sizes = {
applications = 12;
terminal = 15;
desktop = 11;
popups = 12;
};
qt = {
enable = true;
style = "adwaita-dark";
platformTheme = "gtk2";
};
# 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;
networking.hostName = "${host}";
networking.timeServers = options.networking.timeServers.default ++ [ "pool.ntp.org" ];
# Set your time zone.
time.timeZone = "America/Chicago";
# 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";
};
programs = {
hyprland = {
enable = true;
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
xwayland.enable = true;
};
firefox.enable = true;
dconf.enable = true;
seahorse.enable = true;
fuse.userAllowOther = true;
mtr.enable = true;
gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
virt-manager.enable = true;
steam = {
enable = true;
gamescopeSession.enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
};
thunar = {
enable = true;
plugins = with pkgs.xfce; [
thunar-archive-plugin
thunar-volman
];
};
};
nixpkgs.config.allowUnfree = true;
users = {
mutableUsers = true;
};
environment.systemPackages =
let
sugar = pkgs.callPackage ../../pkgs/sddm-sugar-dark.nix { };
tokyo-night = pkgs.libsForQt5.callPackage ../../pkgs/sddm-tokyo-night.nix { };
in
with pkgs;
[
vim
wget
killall
git
cmatrix
lolcat
neofetch
htop
libvirt
lxqt.lxqt-policykit
mangohud
lm_sensors
unzip
unrar
libnotify
eza
v4l-utils
ydotool
wl-clipboard
pciutils
ffmpeg
socat
cowsay
ripgrep
lsd
lshw
pkg-config
meson
hyprpicker
gnumake
ninja
symbola
noto-fonts-color-emoji
material-icons
brightnessctl
virt-viewer
swappy
appimage-run
networkmanagerapplet
yad
playerctl
nh
nixfmt-rfc-style
discord
libvirt
swww
grim
slurp
gnome.file-roller
swaynotificationcenter
imv
transmission-gtk
distrobox
mpv
gimp
obs-studio
rustup
audacity
pavucontrol
tree
protonup-qt
font-awesome
spotify
neovide
(nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
sugar.sddm-sugar-dark # Name: sugar-dark
tokyo-night # Name: tokyo-night-sddm
pkgs.libsForQt5.qt5.qtgraphicaleffects
];
environment.variables = {
ZANEYOS_VERSION = "2.1";
ZANEYOS = "true";
};
# Extra Portal Configuration
xdg.portal = {
enable = true;
extraPortals = [
pkgs.xdg-desktop-portal-gtk
pkgs.xdg-desktop-portal
];
configPackages = [
pkgs.xdg-desktop-portal-gtk
pkgs.xdg-desktop-portal-hyprland
pkgs.xdg-desktop-portal
];
};
# Services to start
services = {
xserver = {
enable = true;
displayManager.sddm = {
enable = true;
autoNumlock = true;
wayland.enable = true;
theme = "sugar-dark";
};
desktopManager.cinnamon.enable = false;
xkb = {
layout = "us";
variant = "";
};
};
smartd = {
enable = true;
autodetect = true;
};
libinput.enable = true;
fstrim.enable = true;
gvfs.enable = true;
openssh.enable = true;
flatpak.enable = false;
printing.enable = true;
gnome.gnome-keyring.enable = true;
avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
ipp-usb.enable = true;
syncthing = {
enable = false;
user = "${username}";
dataDir = "/home/${username}";
configDir = "/home/${username}/.config/syncthing";
};
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
rpcbind.enable = true;
nfs.server.enable = true;
};
systemd.services.flatpak-repo = {
wantedBy = [ "multi-user.target" ];
path = [ pkgs.flatpak ];
script = ''
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
'';
};
hardware.sane = {
enable = true;
extraBackends = [ pkgs.sane-airscan ];
disabledDefaultBackends = [ "escl" ];
};
# Extra Logitech Support
hardware.logitech.wireless.enable = true;
hardware.logitech.wireless.enableGraphical = true;
# Bluetooth Support
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;
services.blueman.enable = true;
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
# Security / Polkit
security.rtkit.enable = true;
security.polkit.enable = true;
security.polkit.extraConfig = ''
polkit.addRule(function(action, subject) {
if (
subject.isInGroup("users")
&& (
action.id == "org.freedesktop.login1.reboot" ||
action.id == "org.freedesktop.login1.reboot-multiple-sessions" ||
action.id == "org.freedesktop.login1.power-off" ||
action.id == "org.freedesktop.login1.power-off-multiple-sessions"
)
)
{
return polkit.Result.YES;
}
})
'';
security.pam.services.swaylock = {
text = ''
auth include login
'';
};
# Optimization settings and garbage collection automation
nix = {
settings = {
auto-optimise-store = true;
experimental-features = [
"nix-command"
"flakes"
];
substituters = [ "https://hyprland.cachix.org" ];
trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ];
};
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
};
# Virtualization / Containers
virtualisation.libvirtd.enable = true;
virtualisation.podman = {
enable = true;
dockerCompat = true;
defaultNetwork.settings.dns_enabled = true;
};
# OpenGL
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
# Extra Module Options
drivers.amdgpu.enable = true;
drivers.nvidia.enable = false;
drivers.nvidia-prime = {
enable = false;
intelBusID = "";
nvidiaBusID = "";
};
drivers.intel.enable = false;
vm.guest-services.enable = false;
local.hardware-clock.enable = false;
# 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. Its 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 = "23.11"; # Did you read the comment?
}