nixconfig/configuration.nix

344 lines
9.7 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.
/home/insert/Documents/nixos/hardware-configuration.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;
# 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;
# 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"
'';
};
# 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;
services.flatpak.enable = true;
users.users.insert = {
isNormalUser = true;
description = "insert";
extraGroups = [ "networkmanager" "wheel" "input" "docker" "libvirtd" ];
#shell = pkgs.zsh;
};
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 = /home/insert/Documents/nixos/secrets/email.age;
owner = "insert";
group = "users";
};
#home-manager.users.insert= { pkgs, ... }: {
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
];
# 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"
# ];
#};
environment.etc."greetd/regreet.toml".text = lib.mkForce ''[background]
path = "/home/insert/Documents/cat-background/background.png"
fit = "Fill"
[GTK]
# Whether to use the dark theme
application_prefer_dark_theme = true
# Cursor theme name
#cursor_theme_name = "Adwaita"
# Font name and size
font_name = "Monocraft 20"
# Icon theme name
icon_theme_name = "Breeze Dark"
# GTK theme name
#theme_name = "Adwaita"
'';
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?
}