nixconfig/configuration.nix

550 lines
15 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.

# 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).
#Credit to anyone I got these config files from, I would add it here but its been months
{ inputs, config, lib, pkgs, ... }:
{
environment.etc.nixpkgs.source = inputs.nixpkgs;
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
<home-manager/nixos>
./sunshine.nix
./home-files.nix
#./flatpak.nix
];
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
# Bootloader.
boot.loader.systemd-boot.enable = true;
# boot.loader.grub.enable = true;
# boot.loader.grub.device = "nodev";
# boot.loader.grub.useOSProber = true;
boot.loader.systemd-boot.configurationLimit = 15;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "insertpclinux"; # Define your hostname.
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "America/New_York";
# 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;
services.xserver.videoDrivers = ["nvidia"];
# Enable the KDE Plasma Desktop Environment.
services.xserver.displayManager.sddm.enable = false;
services.xserver.desktopManager.plasma5.enable = false;
services.greetd.enable = true;
programs.regreet.enable = true;
services.xrdp.enable = false;
services.xrdp.defaultWindowManager = "startplasma-x11";
virtualisation.docker = {
enable = true;
extraOptions = ''
--insecure-registry "kuberound.internal:5000"
'';
};
#nixpkgs.overlays = [ (self: super: (let
# patched_pkgs = import inputs.nixpkgs_patched {
# inherit (self) system;
# config.allowUnfree = true;
# };
# in {
# linuxPackages = patched_pkgs.linuxPackages;
# })) ];
#boot.kernelPackages = pkgs.linuxPackages;
hardware.nvidia = {
# Modesetting is needed most of the time
modesetting.enable = true;
# Enable power management (do not disable this unless you have a reason to).
# Likely to cause problems on laptops and with screen tearing if disabled.
powerManagement.enable = true;
# Use the open source version of the kernel module ("nouveau")
# Note that this offers much lower performance and does not
# support all the latest Nvidia GPU features.
# You most likely don't want this.
# Only available on driver 515.43.04+
open = false;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.production;
};
# Configure keymap in X11
services.xserver = {
layout = "us";
xkbVariant = "";
};
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
sound.enable = true;
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.
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.settings.auto-optimise-store = true;
system.autoUpgrade.enable = false;
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 10d";
};
#programs.zsh.enable = true;
virtualisation.libvirtd.enable = true;
services.flatpak.enable = true;
users.users.insert = {
isNormalUser = true;
description = "insert";
extraGroups = [ "networkmanager" "wheel" "input" "docker" "libvirtd" ];
#shell = pkgs.zsh;
packages = with pkgs; [
firefox
kate
];
};
programs.waybar = {
enable = true;
package = pkgs.waybar.overrideAttrs (oldAttrs: {
mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ];
});
#config = {
# modules = [{module = "wlr/workspace"};];
#};
};
services.flatpak.packages = [
"flathub:app/dev.lizardbyte.app.Sunshine//stable"
"flathub:app/org.godotengine.Godot//stable"
"flathub:app/org.filezillaproject.Filezilla//stable"
];
services.flatpak.remotes = {
"flathub" = "https://dl.flathub.org/repo/flathub.flatpakrepo";
"flathub-beta" = "https://dl.flathub.org/beta-repo/flathub-beta.flatpakrepo";
};
age.identityPaths = [ "/home/insert/.ssh/id_rsa" ];
age.secrets.email = {
file = ./secrets/email.age;
owner = "insert";
group = "users";
};
home-manager.users.insert= { pkgs, ... }: {
home.packages = [
pkgs.git
pkgs.fluffychat
pkgs.cinny-desktop
pkgs.libsForQt5.lightly
pkgs.pfetch
pkgs.git-credential-oauth
pkgs.wayvnc
pkgs.android-tools
pkgs.gnome.eog
pkgs.libsForQt5.gwenview
pkgs.libsForQt5.qtstyleplugins
pkgs.libsForQt5.qt5ct
pkgs.oh-my-zsh
pkgs.zsh
pkgs.kubectl
pkgs.kubernetes-helm
pkgs.vscodium
#pkgs.atool
#pkgs.httpie
pkgs.webcord
pkgs.pika-backup
pkgs.tigervnc
pkgs.syncthing
pkgs.zsh-syntax-highlighting
pkgs.zsh-history-substring-search
pkgs.kitty
pkgs.grim
pkgs.slurp
pkgs.prismlauncher
pkgs.glfw-wayland-minecraft
];
services.syncthing.enable = true;
# programs.zsh.oh-my-zsh.enable = true;
#programs.waybar = {
#enable = true;
#package = pkgs.waybar.overrideAttrs (oldAttrs: {
#mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ];
#});
#config = {
# modules = [{module = "wlr/workspace"};];
#};
#}
gtk = {
enable = true;
iconTheme = {
name = "Papirus-Dark";
package = pkgs.papirus-icon-theme;
};
cursorTheme = {
name = "Catppuccin-Frappe-Blue-Cursors";
package = pkgs.catppuccin-cursors.frappeBlue;
size = 24;
};
theme = {
name = "Catppuccin-Frappe-Standard-Mauve-Dark";
package = pkgs.catppuccin-gtk.override {
accents = [ "mauve" ];
size = "standard";
#tweaks = [ "black" ];
variant = "frappe";
};
};
gtk3.extraConfig = {
Settings = ''
gtk-application-prefer-dark-theme=1
'';
};
gtk4.extraConfig = {
Settings = ''
gtk-application-prefer-dark-theme=1
'';
};
};
programs.nnn = {
enable = true;
#plugins = { "launch", "imgview" };
plugins.src = (pkgs.fetchFromGitHub {
owner = "jarun";
repo = "nnn";
rev = "v4.9";
sha256 = "sha256-Hpc8YaJeAzJoEi7aJ6DntH2VLkoR6ToP6tPYn3llR7k=";
}) + "/plugins";
plugins.mappings = {
l = "launch";
v = "imgview";
g = "getplugs";
};
};
accounts.email = {
accounts.insert = {
address = "insert@insertapp.net";
gpg = {
key = "A70775C389ACF105";
signByDefault = true;
};
imap.host = "imap.purelymail.com";
imap.port = 993;
primary = true;
realName = "Insert";
smtp = {
host = "smtp.purelymail.com";
port = 465;
};
passwordCommand = "cat ${config.age.secrets.email.path}";
userName = "insert@insertapp.net";
#notmuch.enable = true;
thunderbird.enable = true;
};
};
#programs.notmuch.enable = true;
programs.himalaya.enable = false;
programs.thunderbird = {
enable = true;
profiles.insert = {
#name = "Insert";
isDefault = true;
withExternalGnupg = false;
settings = {"mail.openpgp.alternative_gpg_path" = "/run/current-system/sw/bin/gpg-agent";};
};
};
programs.librewolf.enable = true;
programs.git = {
enable = true;
userName = "insert";
userEmail = "insert@insertapp.net";
signing = {
key = "A70775C389ACF105";
signByDefault = true;
};
};
programs.git-credential-oauth.enable = true;
programs.kitty = {
enable = true;
theme = "Catppuccin-Frappe";
settings = {
font_family = "Monocraft Nerd Font";
};
};
programs.zsh = {
enable = true;
shellAliases = {
update = "sudo nixos-rebuild switch --flake /home/insert/Documents/nixos# -v --impure --upgrade --recreate-lock-file";
update-locked = "sudo nixos-rebuild switch --flake /home/insert/Documents/nixos# -v --impure";
garbage = "nix-collect-garbage";
};
initExtra = ''
source ~/.p10k.zsh
export TERM=xterm-256color
PF_INFO="ascii title os kernel uptime pkgs memory wm de palette" pfetch
'';
plugins = [
{name = "powerlevel10k";src = pkgs.zsh-powerlevel10k;file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";}
];
syntaxHighlighting.enable = true;
historySubstringSearch.enable = true;
autosuggestion.enable = true;
oh-my-zsh = {
enable = true;
plugins = [ "git" "kubectl" ];
#theme = "powerlevel10k/powerlevel10k";
};
};
home.stateVersion = "23.05";
};
security.polkit.enable = true;
# Enable automatic login for the user.
services.xserver.displayManager.autoLogin.enable = false;
services.xserver.displayManager.autoLogin.user = "insert";
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
fonts.fontDir.enable = true;
fonts.packages = with pkgs; [
monocraft
];
security.pki.certificateFiles = [
/home/insert/Documents/nextcloud/nextcloudinternal.pem
/home/insert/Documents/personal-vaultwarden/cert.pem
];
# List packages installed in system profile. To search, run:
# $ nix search wget
programs.nix-ld.enable = true;
environment.systemPackages = [
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# wget
pkgs.tailscale
pkgs.wayland
pkgs.docker-compose
#pkgs.sway
inputs.agenix.packages."${pkgs.system}".default
pkgs.vlc
#pkgs.hyprland
pkgs.wl-clipboard # wl-copy and wl-paste for copy/paste from stdin / stdout
pkgs.bemenu # wayland clone of dmenu
pkgs.mako # notification system developed by swaywm maintainer
#pkgs.eww-wayland
pkgs.wofi
pkgs.swww
pkgs.nfs-utils
#pkgs.waybar
pkgs.libnotify
pkgs.polkit_gnome
pkgs.libsForQt5.breeze-icons
pkgs.libsForQt5.dolphin
pkgs.glib
pkgs.pinentry
pkgs.adoptopenjdk-bin
#inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland
pkgs.gnome.nautilus
pkgs.libsForQt5.ark
];
services.tailscale.enable = true;
services.gvfs.enable = true;
programs.steam.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
#pinentryFlavor = "gtk2";
};
services.pcscd.enable = true;
#programs.sway = {
# enable = true;
# wrapperFeatures.gtk = true;
# extraOptions = [
# "--unsupported-gpu"
# ];
#};
services.earlyoom = {
enable = true;
freeSwapThreshold = 5;
freeMemThreshold = 8;
enableNotifications = true;
extraArgs = [
"-g" "--avoid '^(X|hypr.*|kitty|wayland)$'"
"--prefer '^(electron|librewolf|firefox|java|minecraft.*)$'"
];
};
services.rpcbind.enable = true; # needed for NFS
systemd.mounts = [{
type = "nfs";
#mountConfig = {
# Options = "noatime";
#};
what = "kubbernetter-5:/var/mnt/md0/personal/randomfiles";
where = "/mnt/NAS";
}
{
type = "nfs";
#mountConfig = {
# Options = "noatime";
#};
what = "kubbernetter-5:/var/mnt/md0/personal/pc-backups";
where = "/mnt/NAS-backup";
}];
systemd.automounts = [{
wantedBy = [ "multi-user.target" ];
#automountConfig = {
# TimeoutIdleSec = "600";
#};
where = "/mnt/NAS";
}
{
wantedBy = [ "multi-user.target" ];
#automountConfig = {
# TimeoutIdleSec = "600";
#};
where = "/mnt/NAS-backup";
}];
systemd = {
user.services.polkit-gnome-authentication-agent-1 = {
description = "polkit-gnome-authentication-agent-1";
wantedBy = [ "graphical-session.target" ];
wants = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
};
systemd.user.services.waybar.enable = false;
xdg.portal = { enable = true; extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; };
#xdg.portal = { enable = true; extraPortals = [ inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland ]; };
#xdg.portal = { enable = true; };
programs.hyprland = {
enable = true;
#enableNvidiaPatches = true;
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
};
#programs.nnn.enable = false;
#programs.hyprland.enable = true;
#programs.hyprland.enableNvidiaPatches = true;
# 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:
services.sunshine.enable = true;
# Enable the OpenSSH daemon.
services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
#networking.firewall.enable = false;
#I am so, so, so very sorry
networking.firewall.enable = true;
networking.firewall.checkReversePath = "loose";
networking.firewall.allowedUDPPortRanges = [
{ from = 0; to = 65535; }
{ from = 0; to = 65535; }
];
networking.firewall.allowedTCPPortRanges = [
{ from = 0; to = 65535; }
{ from = 0; to = 65535; }
];
# 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?
}