dotfiles/.config/configuration.nix

418 lines
11 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
2021-03-23 17:38:39 +00:00
let
2021-04-06 15:35:09 +00:00
my-python3-packages = python3-packages: with python3-packages; [
2021-03-23 17:38:39 +00:00
pip setuptools
z3
requests
beautifulsoup4
tkinter
lxml
pyside2
markdown
psutil
scipy
numpy
pillow
2021-03-23 17:38:39 +00:00
];
2021-04-06 15:35:09 +00:00
#my-python2-packages = python2-packages: with python2-packages; [
# pip setuptools
# cython
# pygame
# numpy
# pillow
# pyopengl
# pyopengl-accelerate
#];
python3-with-my-packages = pkgs.python3.withPackages my-python3-packages;
#python2-with-my-packages = pkgs.python2.withPackages my-python2-packages;
2021-04-06 15:35:09 +00:00
linuxPackages = pkgs.linuxPackages_5_10;
mpvPlus = pkgs.mpv-with-scripts.override {
scripts = [ pkgs.mpvScripts.mpris ];
};
microsoftErgonomicKeyboard = pkgs.callPackage /home/arne/nixpkgs/microsoft-ergonomic-keyboard { kernel = linuxPackages.kernel; };
2021-03-23 17:38:39 +00:00
in
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
nix.autoOptimiseStore = true;
2021-03-23 17:38:39 +00:00
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
2021-04-06 15:35:09 +00:00
boot.kernelPackages = linuxPackages;
#boot.kernelPatches = [
# {
# name = "fixup MS keyboard";
# patch = /home/arne/src/linux-5.10.62/0001-change-it.patch;
# }
#];
boot.extraModulePackages = [ config.boot.kernelPackages.v4l2loopback microsoftErgonomicKeyboard ];
boot.kernelModules = [ "v4l2loopback" "nct6775" "hid_microsoft_ergonomic" ];
boot.kernelParams = [ "mitigations=off" "amdgpu.noretry=0" ];
2021-03-23 17:38:39 +00:00
boot.kernel.sysctl = {
# enable Alt+SysRq commands
"kernel.sysrq" = 1;
"vm.swappiness" = 1;
"net.ipv4.ip_forward" = 1;
# silence kernel warning
"fs.suid_dumpable" = 0;
};
# disable coredumps
systemd.coredump.extraConfig = ''
Storage=none
'';
security.pam.loginLimits = [
{ domain = "*"; item = "core"; type = "hard"; value = "0"; }
];
# /tmp should be a tmpfs
boot.tmpOnTmpfs = true;
hardware.cpu.amd.updateMicrocode = true;
hardware.mcelog.enable = true;
2021-03-23 17:38:39 +00:00
services.fstrim.enable = true;
services.journald.extraConfig = "SystemMaxUse=100M";
#hardware.bluetooth.enable = true;
2021-03-23 17:38:39 +00:00
networking.useDHCP = false;
networking.interfaces.enp39s0.useDHCP = true;
#networking.interfaces.enp42s0f3u2.useDHCP = false;
#networking.interfaces.enp42s0f3u2.proxyARP = true;
#networking.interfaces.enp42s0f3u2.ipv4.routes = [
# {
# address = "10.0.0.0";
# prefixLength = 24;
# }
#];
#networking.interfaces.enp42s0f3u2.ipv4.addresses = [
# {
# address = "10.0.0.1";
# prefixLength = 24;
# }
#];
2021-03-23 17:38:39 +00:00
networking.hostName = "nixOS";
#networking.hosts = {
# "10.0.0.2" = [ "arne-ThinkPad-T410" ];
#};
2021-03-23 17:38:39 +00:00
networking.firewall.logRefusedConnections = false;
networking.firewall.rejectPackets = true;
networking.firewall.allowedTCPPorts = [ 12783 12975 25565 ];
2021-04-06 15:35:09 +00:00
networking.firewall.allowedTCPPortRanges = [
# KDE Connect
{ from = 1714; to = 1764; }
];
2021-03-23 17:38:39 +00:00
networking.firewall.allowedUDPPorts = [ 12975 ];
2021-04-06 15:35:09 +00:00
networking.firewall.allowedUDPPortRanges = [
# KDE Connect
{ from = 1714; to = 1764; }
];
2021-03-23 17:38:39 +00:00
# Or disable the firewall altogether.
#networking.firewall.enable = false;
security.sudo.extraConfig = ''
Defaults insults
Defaults timestamp_timeout=10
2021-03-23 17:38:39 +00:00
'';
time.timeZone = "Europe/Berlin";
i18n.defaultLocale = "de_DE.UTF-8";
console = {
keyMap = "dvorak";
};
environment.sessionVariables = {
XDG_CONFIG_HOME = "$HOME/.config";
XDG_CACHE_HOME = "$HOME/.cache";
XDG_DATA_HOME = "$HOME/.local/share";
2021-04-06 15:35:09 +00:00
KDEHOME = "$HOME/.config/kde";
KDESYCOCA = "$HOME/.cache/kdesycoca";
2021-03-23 17:38:39 +00:00
KDE_HOME_READONLY = "1";
KDE_UTF8_FILENAMES = "1";
2021-04-06 15:35:09 +00:00
ANDROID_SDK_HOME = "$HOME/.cache";
GRADLE_USER_HOME = "$HOME/.cache/gradle";
XCOMPOSECACHE = "$HOME/.cache/X11/xcompose";
2021-03-23 17:38:39 +00:00
};
environment.extraInit = ''
export XAUTHORITY=/tmp/Xauthority
[ -e ~/.Xauthority ] && mv -f ~/.Xauthority "$XAUTHORITY"
'';
environment.etc = {
"zshenv.local" = {
text = ''
ZDOTDIR=$HOME/.config/zsh
'';
mode = "0444";
};
"sysconfig/lm_sensors".text = ''
HWMON_MODULES="nct6775"
'';
#"adobe/mms.cfg".text = ''
# AllowListUrlPattern=*://kongregate.com
# AllowListUrlPattern=*://*.kongregate.com
#'';
};
services.xserver.enable = true;
services.xserver.enableCtrlAltBackspace = true;
services.xserver.libinput.enable = true;
#services.xserver.libinput.accelProfile = "flat";
services.xserver.layout = "dvorak-custom";
services.xserver.extraLayouts = {
dvorak-custom = {
description = "Dvorak customized";
languages = [ "eng" ];
symbolsFile = /home/arne/.config/dvorak-custom;
};
};
services.xserver.autoRepeatDelay = 183;
services.xserver.autoRepeatInterval = 33;
2021-03-23 17:38:39 +00:00
services.xserver.displayManager.sddm.enable = true;
services.xserver.displayManager.job.logToJournal = true;
2021-03-23 17:38:39 +00:00
services.xserver.desktopManager.plasma5.enable = true;
xdg.portal.enable = true;
xdg.portal.gtkUsePortal = true;
2021-03-23 17:38:39 +00:00
fonts.enableDefaultFonts = true;
fonts.fonts = with pkgs; [
noto-fonts-emoji
liberation_ttf
cozette
font-awesome
2021-03-23 17:38:39 +00:00
];
2021-04-06 15:35:09 +00:00
virtualisation.docker.enable = true;
virtualisation.docker.logDriver = "journald";
#virtualisation.anbox.enable = true;
2021-03-23 17:38:39 +00:00
# services.printing.enable = true;
services.trilium-server.enable = true;
#services.trilium-server.dataDir = "/home/arne/.local/share/trilium-sync-server-data";
#services.trilium-server.host = "192.168.178.21";
services.trilium-server.port = 12783;
2021-03-23 17:38:39 +00:00
services.boinc.enable = true;
services.vnstat.enable = true;
services.gitlab-runner.enable = true;
services.gitlab-runner.services = {
shell = {
registrationConfigFile = "/home/arne/Documents/gitlab-runner-registration";
executor = "shell";
buildsDir = "/tmp/builds_dir";
2021-03-23 17:38:39 +00:00
};
#shell2 = {
# registrationConfigFile = "/home/arne/Documents/gitlab-runner-registration-kv";
# executor = "shell";
#};
2021-03-23 17:38:39 +00:00
};
services.openvpn.servers = {
kit-split = {
config = ''
config /home/arne/Documents/KIT/kit-split.ovpn
'';
autoStart = false;
};
kit = {
config = ''
config /home/arne/Documents/KIT/kit.ovpn
'';
autoStart = false;
};
};
# services.logmein-hamachi.enable = true;
sound.enable = false;
#hardware.pulseaudio.enable = false;
#hardware.pulseaudio.support32Bit = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# this does not exist (yet?)
#pulse.support32Bit = 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;
};
2021-03-23 17:38:39 +00:00
hardware.opengl.enable = true;
hardware.opengl.driSupport = true;
hardware.opengl.driSupport32Bit = true;
hardware.opengl.extraPackages = with pkgs; [ amdvlk vaapiVdpau libvdpau-va-gl ];
hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [ libva ];
users.users.arne = {
isNormalUser = true;
extraGroups = [ "wheel" "docker" "adbusers" "wireshark" "audio" ];
2021-03-23 17:38:39 +00:00
shell = pkgs.zsh;
};
nixpkgs.config = {
allowUnfreePredicate = pkg: builtins.elem (pkgs.lib.getName pkg) [
"minecraft-launcher"
"steam"
"steam-original"
"steam-runtime"
"mathematica"
"idea-ultimate"
"android-studio-stable"
];
packageOverrides = super: let self = super.pkgs; in {
2021-04-06 15:35:09 +00:00
maven = super.maven.override {
jdk = super.pkgs.jdk11;
};
# remove openssl/curl
rustup = super.rustup.overrideAttrs (attrs: rec {
buildInputs = [ super.pkgs.zlib ];
cargoBuildFlags = [ "--no-default-features --features no-self-update,reqwest-backend,reqwest-rustls-tls" ];
doCheck = false;
2021-03-23 17:38:39 +00:00
});
};
};
2021-04-06 15:35:09 +00:00
programs.steam.enable = true;
2021-03-23 17:38:39 +00:00
programs.zsh.enable = true;
programs.zsh.enableGlobalCompInit = false;
programs.zsh.interactiveShellInit = ''
source ${pkgs.nix-index}/etc/profile.d/command-not-found.sh
'';
programs.command-not-found.enable = false;
2021-03-23 17:38:39 +00:00
programs.adb.enable = true;
programs.wireshark.enable = true;
programs.wireshark.package = pkgs.wireshark;
programs.gnupg.agent = {
2021-03-23 17:38:39 +00:00
enable = true;
enableSSHSupport = false;
2021-03-23 17:38:39 +00:00
pinentryFlavor = "qt";
};
# do not show unlock prompt on login
security.pam.services.sddm.enableKwallet = lib.mkOverride 0 false;
2021-03-23 17:38:39 +00:00
environment.systemPackages = with pkgs; [
# standard utilities
coreutils
gzip
manpages
dnsutils
vim htop curl wget file zsh git git-branchless
2021-03-23 17:38:39 +00:00
tree killall
# premium utilities
jq tmux
ripgrep
ripgrep-all
p7zip
iotop
img2pdf
pdftk
exa
2021-03-23 17:38:39 +00:00
fd
zoxide
fzf
entr
oxipng
ffmpeg_4
# programming environments
#geckodriver
2021-04-06 15:35:09 +00:00
#python2-with-my-packages
python3-with-my-packages
jdk8
#visualvm
2021-03-23 17:38:39 +00:00
rustup
cargo-outdated cargo-edit
#jupyter
2021-03-23 17:38:39 +00:00
vscodium
jetbrains.idea-ultimate
2021-04-06 15:35:09 +00:00
#androidStudioPackages.stable
#nodejs
gcc10 gnumake cmake
llvmPackages_11.bintools
# cplex
key
2021-03-23 17:38:39 +00:00
# CLI applications
lynx
droidcam
sqlite
borgbackup
nix-tree rnix-hashes
#gallery-dl
yt-dlp
#plantuml
#tectonic
2021-04-06 15:35:09 +00:00
docker-compose
qemu
graphviz
2021-03-23 17:38:39 +00:00
# GUI applications
sqlitebrowser
(gimp-with-plugins.override { plugins = [ gimpPlugins.gmic ]; })
2021-03-23 17:38:39 +00:00
firefox
thunderbird
ungoogled-chromium
2021-03-23 17:38:39 +00:00
keepassxc
josm
#anki
2021-03-23 17:38:39 +00:00
tor-browser-bundle-bin
mathematica
gparted
trilium-desktop
qdirstat
filelight
libreoffice-fresh
qbittorrent
tdesktop
alacritty
okular akregator kwalletmanager gwenview ark kcalc kcolorchooser kompare k3b kcharselect kmag
plasma5Packages.kruler
2021-03-23 17:38:39 +00:00
kdeconnect
plasma-vault
ksshaskpass
notepadqq
mpvPlus
2021-03-23 17:38:39 +00:00
#xorg.xkbcomp
2021-03-23 17:38:39 +00:00
xorg.xrandr
#evtest
2021-03-23 17:38:39 +00:00
lm_sensors
xclip
ntfs3g
cryptsetup pinentry-qt
cdrkit
vnstat
aspellDicts.de
hunspellDicts.de-de
2021-04-06 15:35:09 +00:00
#texlive.combined.scheme-full
linuxPackages.perf
2021-03-23 17:38:39 +00:00
perf-tools
smartmontools
#libfaketime
#afl
2021-03-23 17:38:39 +00:00
2021-04-06 15:35:09 +00:00
# Games
2021-03-23 17:38:39 +00:00
multimc
#minecraft
2021-04-06 15:35:09 +00:00
#logmein-hamachi
2021-03-23 17:38:39 +00:00
update-resolv-conf # for OpenVPN configs
# List of packages to get on demand
#wineWowPackages.full
#winetricks
2021-03-23 17:38:39 +00:00
];
# 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 = "20.09"; # Did you read the comment?
}