config/hosts/desktop/configuration.nix

503 lines
12 KiB
Nix
Raw Normal View History

2023-12-28 21:33:09 -08:00
#<BS> Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{
2024-09-27 14:29:46 -07:00
self,
2024-05-20 17:25:29 -07:00
inputs,
2024-01-05 21:00:41 -08:00
config,
pkgs,
...
}: {
2024-01-29 02:01:12 -08:00
nixpkgs.config.allowUnfree = true;
2024-10-02 19:36:49 -07:00
services.avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
2024-07-28 01:35:02 -07:00
programs._1password.enable = true;
programs._1password-gui = {
enable = true;
# Certain features, including CLI integration and system authentication support,
# require enabling PolKit integration on some desktop environments (e.g. Plasma).
polkitPolicyOwners = ["nmarks"];
};
2024-06-23 05:22:07 -07:00
services.blueman.enable = true;
hardware.bluetooth.enable = true;
2024-07-21 14:44:08 -07:00
services = {
2024-07-21 14:43:30 -07:00
ratbagd.enable = true;
};
2024-07-12 19:49:34 -07:00
programs.noisetorch.enable = true;
2024-10-11 09:23:38 -07:00
xdg.portal = {
enable = true;
extraPortals = with pkgs; [xdg-desktop-portal-gtk];
};
2024-09-30 10:06:37 -07:00
# systemd.timers.duckdns = {
# wantedBy = ["timers.target"];
# timerConfig = {
# OnBootSec = "5m";
# OnUnitActiveSec = "5m";
# Unit = "duckdns.service";
# };
# };
# systemd.services.duckdns = {
# enable = true;
# script = ''echo url="https://www.duckdns.org/update?domains=pathfinder2e&token=9c1ffa47-7496-4975-ba2b-a6928b28c500&ip=" | ${pkgs.curl}/bin/curl -v -k -o ~/.duckdns/duck.log -K -'';
# serviceConfig = {
# Type = "oneshot";
# User = "nmarks";
# };
# };
#
# services.foundryvtt = {
# enable = true;
# hostName = "pathfinder2.duckdns.org";
# proxySSL = true;
# proxyPort = 443;
# package = inputs.foundryvtt.packages.${pkgs.system}.foundryvtt_11;
# };
#
# services.cloudflared = {
# enable = true;
# # user = "nmarks";
# # tunnels = {
# # "b407af0f-5168-4a79-a9f4-fe99e52990dd" = {
# # credentialsFile = "${config.users.users.nmarks.home}/.cloudflared/b407af0f-5168-4a79-a9f4-fe99e52990dd.json";
# # default = "http_status:404";
# # };
# # };
# };
#
# services.caddy = {
# enable = true;
#
# # virtualHosts."10.154.1.147".extraConfig = ''
# # tls internal
# # reverse_proxy localhost:30000
# # encode zstd gzip
# # '';
#
# # virtualHosts."10.154.1.105".extraConfig = ''
# # tls internal
# # reverse_proxy localhost:30000
# # encode zstd gzip
# # '';
# #
# # virtualHosts."pathfinder2e.duckdns.org".extraConfig = ''
# # reverse_proxy localhost:30000
# # encode zstd gzip
# # '';
# virtualHosts."pathfinder2e.duckdns.org".extraConfig = ''
# reverse_proxy localhost:30000
# '';
#
# # extraConfig = ''
# # pathfinder2e.duckdns.org {
# # # PROXY ALL REQUEST TO PORT 30000
# # reverse_proxy localhost:30000
# # encode zstd gzip
# # }
# # '';
# };
2024-04-16 00:52:21 -07:00
2024-02-06 03:10:55 -08:00
services.flatpak.enable = true;
2024-05-19 07:52:27 -07:00
virtualisation.docker.enable = true;
2024-01-05 21:00:41 -08:00
nix.settings.experimental-features = ["nix-command" "flakes"];
2024-07-16 23:51:41 -07:00
nix.settings = {
substituters = [
"https://nix-community.cachix.org"
"https://cache.nixos.org/"
"https://cuda-maintainers.cachix.org"
2024-09-27 14:29:46 -07:00
"https://cosmic.cachix.org/"
2024-07-16 23:51:41 -07:00
];
trusted-public-keys = [
"cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
2024-09-27 14:29:46 -07:00
"cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE="
2024-07-16 23:51:41 -07:00
];
};
2023-12-28 21:33:09 -08:00
programs.hyprland.enable = true;
2024-01-05 21:00:41 -08:00
programs.fish.enable = true;
2024-01-17 06:35:02 -08:00
services.tailscale.enable = true;
2024-02-04 02:53:15 -08:00
services.keyd = {
enable = true;
2024-02-04 02:54:22 -08:00
keyboards = {
default = {
settings = {
2024-02-04 02:56:51 -08:00
main = {
capslock = "escape";
};
2024-02-04 02:54:22 -08:00
};
};
2024-02-04 02:53:15 -08:00
};
};
2024-01-27 23:46:57 -08:00
virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = true;
2024-02-13 15:32:01 -08:00
systemd.targets = {
sleep.enable = false;
suspend.enable = false;
hibernate.enable = false;
hybrid-sleep.enable = false;
};
2024-09-27 14:29:46 -07:00
programs.nh = {
enable = true;
clean.enable = true;
clean.extraArgs = "--keep-since 4d --keep 3";
flake = "/home/nmarks/.dotfiles";
};
2024-01-05 21:00:41 -08:00
fonts.packages = with pkgs; [
(nerdfonts.override {fonts = ["FiraCode" "Iosevka"];})
];
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
2024-10-08 20:31:32 -07:00
# inputs.foundryvtt.nixosModules.foundryvtt
2024-01-05 21:00:41 -08:00
];
2023-12-28 21:33:09 -08:00
# Enable OpenGL
2024-06-21 06:12:48 -07:00
hardware.graphics = {
2023-12-28 21:33:09 -08:00
enable = true;
};
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = {
2024-06-23 04:29:19 -07:00
forceFullCompositionPipeline = true;
2023-12-28 21:33:09 -08:00
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
powerManagement.enable = false;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
2024-01-05 21:00:41 -08:00
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
2023-12-28 21:33:09 -08:00
# Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting.
open = false;
# Enable the Nvidia settings menu,
2024-01-05 21:00:41 -08:00
# accessible via `nvidia-settings`.
2023-12-28 21:33:09 -08:00
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
2024-09-27 14:29:46 -07:00
package = config.boot.kernelPackages.nvidiaPackages.beta;
2024-03-21 19:09:28 -07:00
#Fixes a glitch
nvidiaPersistenced = true;
#Required for amdgpu and nvidia gpu pairings
# modesetting.enable = true;
prime = {
# offload.enable = true;
#sync.enable = true;
amdgpuBusId = "PCI:0f:00.0";
nvidiaBusId = "PCI:01:00.0";
};
2023-12-28 21:33:09 -08:00
};
# Bootloader.
#boot.loader.systemd-boot.enable = true;
#boot.loader.efi.canTouchEfiVariables = true;
boot.loader = {
2024-01-19 06:39:07 -08:00
systemd-boot.enable = true;
2024-01-05 21:00:41 -08:00
efi = {
canTouchEfiVariables = true;
2023-12-28 21:33:09 -08:00
# assuming /boot is the mount point of the EFI partition in NixOS (as the installation section recommends).
efiSysMountPoint = "/boot";
2024-01-05 21:00:41 -08:00
};
2024-01-19 06:39:07 -08:00
# grub = {
# enable = true;
# device = "/dev/sdb1";
# theme = pkgs.nixos-grub2-theme;
# useOSProber = true;
# };
2023-12-28 21:33:09 -08:00
};
2024-09-27 14:29:46 -07:00
boot.supportedFilesystems = ["ntfs"];
2023-12-28 21:33:09 -08: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
# Set your time zone.
time.timeZone = "America/Los_Angeles";
# 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";
};
# Enable the X11 windowing system.
services.xserver.enable = true;
# Enable the KDE Plasma Desktop Environment.
2024-06-21 06:12:48 -07:00
services.displayManager.sddm.enable = true;
services.desktopManager.plasma6.enable = true;
2023-12-28 21:33:09 -08:00
2024-09-27 14:29:46 -07:00
# services.desktopManager.cosmic.enable = true;
# services.displayManager.cosmic-greeter.enable = true;
2023-12-28 21:33:09 -08:00
# Configure keymap in X11
services.xserver = {
2024-06-21 06:12:48 -07:00
xkb.layout = "us";
xkb.variant = "";
2023-12-28 21:33:09 -08:00
};
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
2024-09-27 14:29:46 -07:00
#sound.enable = true;
#hardware.pulseaudio.enable = false;
2023-12-28 21:33:09 -08:00
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.
2024-01-05 21:00:41 -08:00
users.defaultUserShell = pkgs.fish;
2023-12-28 21:33:09 -08:00
users.users.nmarks = {
isNormalUser = true;
description = "Natalie Marks";
2024-05-19 07:53:04 -07:00
extraGroups = ["networkmanager" "wheel" "docker"];
2024-01-17 06:35:02 -08:00
# openssh.authorizedKeys.keyFiles = ["~/.ssh/id_ed25519.pub"];
2023-12-28 21:33:09 -08:00
packages = with pkgs; [
firefox
kate
vim
kitty
2024-01-05 21:00:41 -08:00
lua-language-server
2024-01-17 06:35:02 -08:00
texlive.combined.scheme-full
2024-01-29 02:01:12 -08:00
steam-run
2024-01-05 21:00:41 -08:00
# thunderbird
2023-12-28 21:33:09 -08:00
];
};
2024-01-05 21:00:41 -08:00
2023-12-28 21:33:09 -08:00
programs.neovim = {
2024-01-05 21:00:41 -08:00
enable = true;
defaultEditor = true;
};
2023-12-28 21:33:09 -08:00
environment.variables.EDITOR = "nvim";
2024-06-23 05:26:40 -07:00
programs.steam = {
enable = true;
package = with pkgs; steam.override {extraPkgs = pkgs: [attr];};
};
2023-12-28 21:33:09 -08:00
# Allow unfree packages
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
2024-01-05 21:00:41 -08:00
fish
2023-12-28 21:33:09 -08:00
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
wget
git
2024-01-05 21:00:41 -08:00
unzip
ripgrep
2024-04-09 00:56:48 -07:00
clang
2024-01-05 21:00:41 -08:00
fd
cargo
python3
python311Packages.pynvim
python311Packages.pip
steam
ruby
julia
xclip
nodePackages.npm
go
2024-01-17 06:35:02 -08:00
tailscale
2024-01-19 05:08:56 -08:00
ethtool
2024-01-19 06:10:58 -08:00
grub2
2024-09-27 14:29:46 -07:00
2024-10-11 09:23:38 -07:00
xdg-desktop-portal-gtk
2024-09-27 14:29:46 -07:00
wineWowPackages.waylandFull
wineWowPackages.stable
2023-12-28 21:33:09 -08:00
];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
2024-01-05 21:00:41 -08:00
programs.mtr.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
2023-12-28 21:33:09 -08:00
# List services that you want to enable:
# Enable the OpenSSH daemon.
services.openssh.enable = true;
2024-04-17 15:04:04 -07:00
programs.kdeconnect.enable = true;
2024-01-17 06:35:02 -08:00
networking = {
hostName = "nixos"; # Define your hostname.
# wireless.enable = true; # Enables wireless support via wpa_supplicant.
networkmanager.enable = true;
firewall = {
2024-04-16 01:47:15 -07:00
allowedTCPPorts = [22 80 443];
2024-04-17 15:04:04 -07:00
#KDE Connect
# allowedTCPPortRanges = [
# {
# from = 1714;
# to = 1764;
# }
# ];
# allowedUDPPortRanges = [
# {
# from = 1714;
# to = 1764;
# }
# ];
2024-01-17 06:35:02 -08:00
enable = true;
};
2024-01-19 06:46:26 -08:00
interfaces.enp11s0.wakeOnLan = {
enable = true;
2024-01-19 06:48:10 -08:00
policy = ["magic"];
2024-01-19 06:46:26 -08:00
};
2024-01-17 06:35:02 -08:00
};
2024-01-29 01:54:02 -08:00
programs.nix-ld.enable = true;
# "minimum" amount of libraries needed for most games to run without steam-run
programs.nix-ld.libraries = with pkgs; [
# common requirement for several games
stdenv.cc.cc.lib
# from https://github.com/NixOS/nixpkgs/blob/nixos-23.05/pkgs/games/steam/fhsenv.nix#L72-L79
xorg.libXcomposite
xorg.libXtst
xorg.libXrandr
xorg.libXext
xorg.libX11
xorg.libXfixes
libGL
libva
# from https://github.com/NixOS/nixpkgs/blob/nixos-23.05/pkgs/games/steam/fhsenv.nix#L124-L136
fontconfig
freetype
xorg.libXt
xorg.libXmu
libogg
libvorbis
SDL
SDL2_image
glew110
libdrm
libidn
tbb
zlib
2024-03-11 05:38:35 -07:00
alsa-lib
at-spi2-atk
at-spi2-core
atk
cairo
cups
curl
dbus
expat
fontconfig
freetype
fuse3
gdk-pixbuf
glib
gtk3
icu
libGL
libappindicator-gtk3
libdrm
libglvnd
libnotify
libpulseaudio
libunwind
libusb1
libuuid
libxkbcommon
libxml2
mesa
nspr
nss
openssl
pango
pipewire
stdenv.cc.cc
systemd
vulkan-loader
xorg.libX11
xorg.libXScrnSaver
xorg.libXcomposite
xorg.libXcursor
xorg.libXdamage
xorg.libXext
xorg.libXfixes
xorg.libXi
xorg.libXrandr
xorg.libXrender
xorg.libXtst
xorg.libxcb
xorg.libxkbfile
xorg.libxshmfence
zlib
2024-01-29 01:54:02 -08:00
];
2023-12-28 21:33:09 -08:00
# Open ports in the firewall.
# 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.05"; # Did you read the comment?
}