2024-05-14 08:44:34 +02:00
|
|
|
|
{
|
|
|
|
|
config,
|
|
|
|
|
pkgs,
|
|
|
|
|
host,
|
|
|
|
|
inputs,
|
|
|
|
|
username,
|
2024-05-15 00:53:36 +02:00
|
|
|
|
options,
|
2024-05-14 08:44:34 +02:00
|
|
|
|
...
|
|
|
|
|
}:
|
|
|
|
|
|
2024-05-14 20:04:27 +02:00
|
|
|
|
let
|
|
|
|
|
inherit (import ./variables.nix) browser;
|
|
|
|
|
in
|
2024-05-14 08:44:34 +02:00
|
|
|
|
{
|
|
|
|
|
imports = [
|
|
|
|
|
./hardware.nix
|
|
|
|
|
./users.nix
|
2024-05-14 20:34:02 +02:00
|
|
|
|
../../modules/amd-drivers.nix
|
2024-05-14 20:50:28 +02:00
|
|
|
|
../../modules/nvidia-drivers.nix
|
2024-05-15 00:19:56 +02:00
|
|
|
|
../../modules/nvidia-prime-drivers.nix
|
2024-05-14 22:38:14 +02:00
|
|
|
|
../../modules/intel-drivers.nix
|
2024-05-14 21:01:31 +02:00
|
|
|
|
../../modules/vm-guest-services.nix
|
2024-05-15 00:19:56 +02:00
|
|
|
|
../../modules/local-hardware-clock.nix
|
2024-05-14 08:44:34 +02:00
|
|
|
|
];
|
|
|
|
|
|
2024-05-15 00:53:36 +02:00
|
|
|
|
# Kernel
|
|
|
|
|
boot.kernelPackages = pkgs.linuxPackages;
|
|
|
|
|
# boot.kernelPackages = pkgs.linuxPackages_zen;
|
|
|
|
|
|
2024-05-14 08:44:34 +02:00
|
|
|
|
# Bootloader.
|
|
|
|
|
boot.loader.systemd-boot.enable = true;
|
|
|
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
2024-05-14 20:04:27 +02:00
|
|
|
|
boot.kernel.sysctl = {
|
|
|
|
|
"vm.max_map_count" = 2147483642;
|
|
|
|
|
};
|
2024-05-14 09:42:14 +02:00
|
|
|
|
boot.tmp.useTmpfs = false;
|
|
|
|
|
boot.tmp.tmpfsSize = "30%";
|
2024-05-14 20:34:02 +02:00
|
|
|
|
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'';
|
|
|
|
|
};
|
2024-05-14 09:42:14 +02:00
|
|
|
|
|
|
|
|
|
# This is for OBS Virtual Cam Support - v4l2loopback setup
|
|
|
|
|
boot.kernelModules = [ "v4l2loopback" ];
|
|
|
|
|
boot.extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
|
2024-05-14 08:44:34 +02:00
|
|
|
|
|
|
|
|
|
# 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;
|
2024-05-15 00:19:56 +02:00
|
|
|
|
networking.hostName = "${host}";
|
|
|
|
|
networking.timeServers = options.networking.timeServers.default ++ [ "pool.ntp.org" ];
|
2024-05-14 08:44:34 +02:00
|
|
|
|
|
|
|
|
|
# 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";
|
|
|
|
|
};
|
|
|
|
|
|
2024-05-14 20:04:27 +02:00
|
|
|
|
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 Configuration
|
|
|
|
|
programs.steam = {
|
|
|
|
|
enable = true;
|
|
|
|
|
gamescopeSession.enable = true;
|
|
|
|
|
remotePlay.openFirewall = true;
|
|
|
|
|
dedicatedServer.openFirewall = true;
|
|
|
|
|
};
|
2024-05-14 08:44:34 +02:00
|
|
|
|
|
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
|
|
2024-05-14 09:42:14 +02:00
|
|
|
|
users = {
|
|
|
|
|
mutableUsers = true;
|
|
|
|
|
};
|
|
|
|
|
|
2024-05-15 01:36:40 +02:00
|
|
|
|
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
|
|
|
|
|
git
|
|
|
|
|
cmatrix
|
|
|
|
|
lolcat
|
|
|
|
|
neofetch
|
|
|
|
|
htop
|
|
|
|
|
btop
|
|
|
|
|
libvirt
|
|
|
|
|
lxqt.lxqt-policykit
|
|
|
|
|
lm_sensors
|
|
|
|
|
unzip
|
|
|
|
|
unrar
|
|
|
|
|
libnotify
|
|
|
|
|
eza
|
|
|
|
|
v4l-utils
|
|
|
|
|
ydotool
|
|
|
|
|
wl-clipboard
|
|
|
|
|
socat
|
|
|
|
|
cowsay
|
2024-05-15 20:39:49 +02:00
|
|
|
|
ripgrep
|
2024-05-15 01:36:40 +02:00
|
|
|
|
lsd
|
|
|
|
|
lshw
|
|
|
|
|
pkg-config
|
|
|
|
|
meson
|
|
|
|
|
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
|
|
|
|
|
rofi-wayland
|
|
|
|
|
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
|
|
|
|
|
];
|
2024-05-15 00:19:56 +02:00
|
|
|
|
|
2024-05-14 09:42:14 +02:00
|
|
|
|
environment.variables = {
|
2024-05-14 20:04:27 +02:00
|
|
|
|
ZANEYOS_VERSION = "2.0";
|
2024-05-14 09:42:14 +02:00
|
|
|
|
};
|
|
|
|
|
|
2024-05-14 20:50:28 +02:00
|
|
|
|
# Services to start
|
2024-05-15 00:19:56 +02:00
|
|
|
|
services = {
|
|
|
|
|
xserver = {
|
|
|
|
|
enable = true;
|
|
|
|
|
displayManager.sddm = {
|
|
|
|
|
enable = true;
|
|
|
|
|
autoNumlock = true;
|
|
|
|
|
wayland.enable = true;
|
|
|
|
|
theme = "sugar-dark";
|
|
|
|
|
};
|
|
|
|
|
desktopManager.cinnamon.enable = true;
|
|
|
|
|
xkb = {
|
|
|
|
|
layout = "us";
|
|
|
|
|
variant = "";
|
|
|
|
|
};
|
2024-05-14 09:42:14 +02:00
|
|
|
|
};
|
2024-05-15 00:19:56 +02:00
|
|
|
|
libinput.enable = true;
|
|
|
|
|
openssh.enable = true;
|
2024-05-15 00:53:36 +02:00
|
|
|
|
flatpak.enable = false;
|
2024-05-15 00:19:56 +02:00
|
|
|
|
printing.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;
|
2024-05-14 22:38:14 +02:00
|
|
|
|
};
|
2024-05-15 00:53:36 +02:00
|
|
|
|
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
|
|
|
|
|
'';
|
|
|
|
|
};
|
2024-05-14 21:01:31 +02:00
|
|
|
|
hardware.sane = {
|
|
|
|
|
enable = true;
|
|
|
|
|
extraBackends = [ pkgs.sane-airscan ];
|
|
|
|
|
disabledDefaultBackends = [ "escl" ];
|
|
|
|
|
};
|
2024-05-15 00:19:56 +02:00
|
|
|
|
hardware.logitech.wireless.enable = true;
|
|
|
|
|
hardware.logitech.wireless.enableGraphical = true;
|
2024-05-14 20:50:28 +02:00
|
|
|
|
# Enable sound with pipewire.
|
|
|
|
|
sound.enable = true;
|
|
|
|
|
hardware.pulseaudio.enable = false;
|
|
|
|
|
security.rtkit.enable = true;
|
|
|
|
|
|
|
|
|
|
# Security / Polkit
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
'';
|
2024-05-14 09:42:14 +02:00
|
|
|
|
|
|
|
|
|
# Optimization settings and garbage collection automation
|
|
|
|
|
nix = {
|
|
|
|
|
settings = {
|
|
|
|
|
auto-optimise-store = true;
|
2024-05-14 20:04:27 +02:00
|
|
|
|
experimental-features = [
|
|
|
|
|
"nix-command"
|
|
|
|
|
"flakes"
|
2024-05-14 09:42:14 +02:00
|
|
|
|
];
|
2024-05-14 20:04:27 +02:00
|
|
|
|
substituters = [ "https://hyprland.cachix.org" ];
|
|
|
|
|
trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ];
|
2024-05-14 09:42:14 +02:00
|
|
|
|
};
|
|
|
|
|
gc = {
|
|
|
|
|
automatic = true;
|
|
|
|
|
dates = "weekly";
|
|
|
|
|
options = "--delete-older-than 7d";
|
|
|
|
|
};
|
|
|
|
|
};
|
2024-05-14 08:44:34 +02:00
|
|
|
|
|
2024-05-15 00:19:56 +02:00
|
|
|
|
# Virtualization / Containers
|
2024-05-14 20:04:27 +02:00
|
|
|
|
virtualisation.libvirtd.enable = true;
|
2024-05-15 00:19:56 +02:00
|
|
|
|
virtualisation.podman = {
|
|
|
|
|
enable = true;
|
|
|
|
|
dockerCompat = true;
|
|
|
|
|
defaultNetwork.settings.dns_enabled = true;
|
|
|
|
|
};
|
2024-05-14 20:04:27 +02:00
|
|
|
|
|
|
|
|
|
# OpenGL
|
|
|
|
|
hardware.opengl = {
|
|
|
|
|
enable = true;
|
|
|
|
|
driSupport = true;
|
|
|
|
|
driSupport32Bit = true;
|
|
|
|
|
};
|
2024-05-14 08:44:34 +02:00
|
|
|
|
|
2024-05-14 20:34:02 +02:00
|
|
|
|
# Extra Module Options
|
|
|
|
|
drivers.amdgpu.enable = true;
|
2024-05-14 20:50:28 +02:00
|
|
|
|
drivers.nvidia.enable = false;
|
2024-05-15 00:19:56 +02:00
|
|
|
|
drivers.nvidia-prime = {
|
|
|
|
|
enable = false;
|
|
|
|
|
intelBusID = "";
|
|
|
|
|
nvidiaBusID = "";
|
|
|
|
|
};
|
2024-05-14 22:38:14 +02:00
|
|
|
|
drivers.intel.enable = false;
|
2024-05-14 21:01:31 +02:00
|
|
|
|
vm.guest-services.enable = false;
|
2024-05-15 00:19:56 +02:00
|
|
|
|
local.hardware-clock.enable = false;
|
2024-05-14 20:34:02 +02:00
|
|
|
|
|
2024-05-14 08:44:34 +02:00
|
|
|
|
# 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 = "23.11"; # Did you read the comment?
|
|
|
|
|
}
|