211 lines
4.6 KiB
Nix
211 lines
4.6 KiB
Nix
{
|
|
pkgs,
|
|
userName,
|
|
...
|
|
}: {
|
|
# Enable flakes for NixOS
|
|
nix.settings.experimental-features = ["nix-command" "flakes"];
|
|
|
|
# Utilize systemd-boot
|
|
boot.loader.systemd-boot.enable = true;
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
# Install and enable common graphics drivers
|
|
hardware.opengl = {
|
|
# driSupport = true;
|
|
extraPackages = with pkgs; [
|
|
mesa
|
|
libvdpau-va-gl
|
|
libva
|
|
libva-utils
|
|
intel-vaapi-driver # for Intel
|
|
intel-media-driver # for Intel
|
|
rocm-opencl-icd # for AMD
|
|
];
|
|
};
|
|
|
|
# For systems with AMD graphics, this enables Vulkan on 32-bit applications
|
|
# For 64-bit application, however, Vulkan is enabled by default
|
|
# hardware.graphics.driSupport32Bit = true;
|
|
|
|
# For systems with AMD graphics, enable AMDVLK
|
|
#hardware.graphics = {
|
|
# extraPackages = with pkgs; [
|
|
# amdvlk
|
|
# ];
|
|
# extraPackages32 = with pkgs; [
|
|
# driversi686Linux
|
|
# ];
|
|
#};
|
|
|
|
# Enable Bluetooth if present
|
|
hardware.bluetooth.enable = true;
|
|
|
|
# Set your timezone
|
|
time.timeZone = "America/Detroit";
|
|
|
|
# Enable Pipewire (sound)
|
|
services.pipewire = {
|
|
enable = true;
|
|
pulse.enable = true;
|
|
};
|
|
|
|
# Enable touchpad
|
|
services.libinput.enable = true;
|
|
|
|
# Install packages to be installed system-wide
|
|
environment.systemPackages = with pkgs; [
|
|
vim
|
|
neovim
|
|
git
|
|
wireguard-tools
|
|
podman
|
|
buildah
|
|
podman-tui
|
|
podman-compose
|
|
podman-desktop
|
|
toolbox
|
|
grim
|
|
slurp
|
|
playerctl
|
|
light
|
|
brightnessctl
|
|
firefox
|
|
wttrbar
|
|
cliphist
|
|
xivlauncher
|
|
patchelf
|
|
];
|
|
|
|
# Install system-wide fonts
|
|
fonts.packages = with pkgs; [
|
|
noto-fonts
|
|
noto-fonts-cjk
|
|
noto-fonts-emoji
|
|
liberation_ttf
|
|
monaspace
|
|
nerdfonts
|
|
];
|
|
|
|
# Set the EDITOR global environment variable to neovim
|
|
environment.variables.EDITOR = "nvim";
|
|
|
|
# Enable OpenSSH
|
|
services.openssh.enable = true;
|
|
|
|
# Enable keyring
|
|
services.gnome.gnome-keyring.enable = true;
|
|
|
|
# Enable GnuPG
|
|
programs.gnupg.agent = {
|
|
enable = true;
|
|
enableSSHSupport = true;
|
|
};
|
|
|
|
# Enable SUID wrappers (some programs need them)
|
|
programs.mtr.enable = true;
|
|
|
|
# Enable Polkit
|
|
security.polkit.enable = true;
|
|
|
|
# Enable power management
|
|
powerManagement = {
|
|
enable = true;
|
|
powertop.enable = false; # TODO: to be enabled on laptops
|
|
cpuFreqGovernor = "performace";
|
|
};
|
|
|
|
# Enable Steam and open various firewall ports when applicable
|
|
programs.steam = {
|
|
enable = true;
|
|
remotePlay.openFirewall = true;
|
|
localNetworkGameTransfers.openFirewall = true;
|
|
};
|
|
|
|
# Enable gamemode (gamemode, gamemoded, gamemoderun) when needed
|
|
programs.gamemode.enable = true;
|
|
|
|
# Enable gamescope (compositor) when needed
|
|
programs.gamescope.enable = true;
|
|
|
|
# Enable dconf
|
|
programs.dconf.enable = true;
|
|
|
|
# Add username to groups "wheel" and "video" - more may be added here later
|
|
users.users.${userName}.extraGroups = ["wheel" "video" "gamemode" "podman" "network"];
|
|
|
|
# XDG stuff
|
|
xdg = {
|
|
portal = {
|
|
enable = true;
|
|
wlr.enable = true;
|
|
config = {
|
|
common = {
|
|
default = [
|
|
"wlr"
|
|
];
|
|
};
|
|
};
|
|
xdgOpenUsePortal = true;
|
|
extraPortals = with pkgs; [
|
|
xdg-desktop-portal-wlr
|
|
xdg-desktop-portal-gtk
|
|
];
|
|
};
|
|
};
|
|
|
|
# Firewall stuff not allowed in common user and network creation
|
|
networking.firewall.enable = true; # VERY important, do not touch
|
|
networking.firewall.allowedTCPPorts = [];
|
|
networking.firewall.allowedUDPPorts = [];
|
|
networking.networkmanager.enable = true; # Linux tool for managing network connections
|
|
|
|
# Enable Flatpak (app containerization)
|
|
# services.flatpak.enable = true;
|
|
services.flatpak = {
|
|
enable = true;
|
|
remotes = [
|
|
{
|
|
name = "flathub";
|
|
location = "https://dl.flathub.org/repo/flathub.flatpakrepo";
|
|
}
|
|
];
|
|
packages = [
|
|
"com.github.tchx84.Flatseal"
|
|
"com.slack.Slack"
|
|
"info.beyondallreason.bar"
|
|
"io.dbeaver.DBeaverCommunity"
|
|
"io.openrct2.OpenRCT2"
|
|
"md.obsidian.Obsidian"
|
|
"org.prismlauncher.PrismLauncher"
|
|
"sh.cider.Cider"
|
|
];
|
|
update = {
|
|
auto = {
|
|
enable = true;
|
|
onCalendar = "weekly";
|
|
};
|
|
};
|
|
};
|
|
|
|
# Enable Podman (OCI containers)
|
|
virtualisation.podman = {
|
|
enable = true;
|
|
dockerSocket.enable = true;
|
|
defaultNetwork.settings.dns_enabled = true;
|
|
};
|
|
|
|
services.shairport-sync = {
|
|
enable = pkgs.stdenv.isLinux;
|
|
openFirewall = pkgs.stdenv.isLinux;
|
|
arguments = "-v -o pw";
|
|
};
|
|
|
|
# users.users."${userName}" = {
|
|
# group = "${userName}";
|
|
# isNormalUser = true;
|
|
# };
|
|
|
|
system.stateVersion = "24.05";
|
|
}
|