Files
frank-nix/hosts/shared/nixos-pc.nix
T

384 lines
7.2 KiB
Nix

{
pkgs,
lib,
inputs,
...
}:
{
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
systemd-boot.configurationLimit = 10;
timeout = 0;
};
consoleLogLevel = 3;
kernelParams = [
"quiet"
"rd.udev.log_level=3"
"rd.systemd.show_status=auto"
];
initrd = {
verbose = false;
};
kernelModules = [
"ntsync"
];
plymouth = {
enable = true;
theme = "bgrt";
};
};
fonts = {
fontconfig = {
enable = true;
subpixel.rgba = "none";
hinting.style = "slight";
};
};
services = {
flatpak = {
packages = [
{
appId = "com.github.dynobo.normcap";
origin = "flathub";
}
{
appId = "com.usebottles.bottles";
origin = "flathub";
}
{
appId = "io.github.ungoogled_software.ungoogled_chromium";
origin = "flathub";
}
{
appId = "org.gtk.Gtk3theme.Breeze";
origin = "flathub";
}
{
appId = "io.mpv.Mpv";
origin = "flathub";
}
];
};
# Configures snapshots for home subvolume.
# Requires /home/.snapshots subvolume to function.
snapper = {
snapshotInterval = "hourly";
cleanupInterval = "1d";
configs = {
home = {
SUBVOLUME = "/home";
TIMELINE_CREATE = true;
TIMELINE_CLEANUP = true;
TIMELINE_LIMIT_HOURLY = "10";
TIMELINE_LIMIT_DAILY = "7";
TIMELINE_LIMIT_WEEKLY = "2";
TIMELINE_LIMIT_MONTHLY = "0";
TIMELINE_LIMIT_YEARLY = "0";
BACKGROUND_COMPARISON = "yes";
NUMBER_CLEANUP = "no";
NUMBER_MIN_AGE = "1800";
NUMBER_LIMIT = "50";
NUMBER_LIMIT_IMPORTANT = "10";
EMPTY_PRE_POST_CLEANUP = "yes";
EMPTY_PRE_POST_MIN_AGE = "1800";
};
};
};
# Enable KMSCON DRM TTY.
kmscon = {
enable = true;
config = {
hwAccel = true;
term = "xterm-256color";
font-name = "Hack Nerd Font Mono";
};
};
# Configure pipewire. Disables 32Bit ALSA since it causes build errors
# and is largely vestigial.
pipewire = {
enable = true;
pulse.enable = true;
alsa.enable = true;
alsa.support32Bit = lib.mkForce false;
};
openssh.enable = true;
affinity-thumbnailer.enable = true;
# Enables m(ulticast)DNS (a.k.a. Bonjour) support.
avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
};
networking = {
wireless.enable = true;
networkmanager.enable = true;
networkmanager.plugins = with pkgs; [ networkmanager-openvpn ];
firewall = {
trustedInterfaces = [
"virbr0"
"br0"
];
allowedTCPPortRanges = [
{
from = 1714;
to = 1764;
} # KDE Connect
];
allowedUDPPortRanges = [
{
from = 1714;
to = 1764;
} # KDE Connect
];
allowedTCPPorts = [ 22 ];
};
};
time.timeZone = "America/New_York";
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocales = [
"ja_JP.UTF-8/UTF-8"
];
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";
};
};
security.rtkit.enable = true;
programs = {
gnupg.agent = {
enable = true;
pinentryPackage = pkgs.pinentry-qt;
};
nix-ld = {
enable = true;
libraries = with pkgs; [
stdenv.cc.cc.lib
openssl
zlib
icu
curl
libxcrypt-legacy
gcc
pkg-config
busybox
libdrm
mesa
libxkbcommon
fontconfig
libglvnd
freetype
libxcb
libx11
libice
libsm
libxcursor
libxrandr
libxft
skia
dotnet-sdk
dotnet-runtime
dotnet-runtime_8
dotnet-runtime_10
];
};
bash = {
enable = true;
interactiveShellInit = ''
eval "$(jump shell)"
bind -x '"\eOQ": clear;fastfetch'
'';
};
starship = {
enable = true;
settings = {
character = {
success_symbol = "[λ](bold green)";
error_symbol = "[λ](bold red)";
};
};
};
ssh.startAgent = true;
firefox.enable = true;
thunderbird.enable = true;
appimage = {
enable = true;
binfmt = true;
};
neovim = {
enable = true;
defaultEditor = true;
vimAlias = true;
configure = {
customRC = ''
set nocompatible
set backspace=indent,eol,start
set tabstop=2
set shiftwidth=2
set expandtab
'';
packages.myPlugins = with pkgs.vimPlugins; {
start = [
vim-lastplace
vim-nix
];
opt = [ ];
};
};
};
};
virtualisation = {
docker.enable = true;
};
users.users.frank = {
isNormalUser = true;
description = "Frank LoTurco";
extraGroups = [
"networkmanager"
"wheel"
"moonshine"
"input"
"video"
"docker"
"uinput"
];
};
nixpkgs = {
config.allowUnfree = true;
# Fix msitools compiling and failing it's test-suite.
overlays = [
(final: prev: {
msitools = prev.msitools.overrideAttrs (old: {
doCheck = false;
});
})
inputs.affinity-nix.overlays.default
];
};
nix = {
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
optimise = {
automatic = true;
dates = "weekly";
};
settings = {
experimental-features = [
"nix-command"
"flakes"
];
use-xdg-base-directories = true;
};
};
environment = {
systemPackages = with pkgs; [
wget
dnsmasq
guestfs-tools
unrar
p7zip
btrfs-assistant
nil
bash-language-server
nerd-fonts.hack
jump
weather
kdePackages.kfind
desktop-file-utils
openjdk
openjdk17
openjdk25
tmux
zathura
hunspell
hunspellDicts.en_US
hyphenDicts.en_US
affinity-v3
libreoffice-qt
qimgv
fastfetch
vorta
distrobox
devenv
ripgrep
inputs.appimage-manager.packages.${pkgs.stdenv.hostPlatform.system}.default
inputs.gloomberb.packages.${pkgs.stdenv.hostPlatform.system}.default
inputs.pi.packages.${pkgs.stdenv.hostPlatform.system}.default
(python3.withPackages (
python-pkgs: with python-pkgs; [
requests
pandas
]
))
(callPackage ../../packages/heidisql/package.nix { })
];
shellAliases = import ../../features/aliases.nix { inherit pkgs; };
sessionVariables = import ../../features/xdg.nix { inherit pkgs; };
};
system.stateVersion = "26.05";
}