dotfiles/entropy/nixos/configuration.nix

410 lines
10 KiB
Nix
Raw Normal View History

2020-12-21 14:13:39 +00:00
# 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).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
# include and configure R
./modules/r.nix
# python with modules
./modules/python.nix
2021-05-18 12:09:48 +00:00
# Wayland
./modules/sway.nix
# old i3 compositor
# ./modules/i3.nix
2021-10-14 14:15:27 +00:00
./modules/backup.nix
2020-12-21 14:13:39 +00:00
];
# set up LUKS discovery
boot.initrd.luks.devices.cryptlvm.device = "/dev/disk/by-uuid/f382cd01-9048-4b1b-8a73-48e1f61e6c08";
# make the screen usable
#hardware.video.hidpi.enable = true;
2021-03-29 08:15:23 +00:00
#services.xserver.dpi = 180;
2020-12-21 14:13:39 +00:00
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# enable powertop for saving power
#powerManagement.powertop.enable = true;
networking.hostName = "entropy"; # Define your hostname.
2021-10-14 14:15:27 +00:00
networking.wireless = {
enable = true; # Enables wireless support via wpa_supplicant.
interfaces = [ "wlp0s20f3" ];
};
2020-12-21 14:13:39 +00:00
# Set your time zone.
time.timeZone = "Europe/Berlin";
# geoclue2 does not yield a location at home, so I'll make the manual configuration the default
# location.provider = "geoclue2";
location.provider = "manual";
# using the location of the cafe ascii should be good enough
location.latitude = 51.0250869;
location.longitude = 13.7210005;
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config
# replicates the default behaviour.
networking.useDHCP = false;
networking.interfaces.enp0s31f6.useDHCP = true;
2021-03-29 08:15:23 +00:00
# USB-C dock
networking.interfaces.enp0s20f0u2u1.useDHCP = true;
2020-12-21 14:13:39 +00:00
networking.interfaces.wlp0s20f3.useDHCP = true;
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
nixpkgs.config = {
# enable hardware-accelerated graphics
packageOverrides = pkgs: {
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
# add nixpkgs for unstable package sources
#unstable = import <nixpkgs> {
#config = config.nixpkgs.config;
#};
};
# allow unfree licenced packges
allowUnfree = true;
};
hardware.opengl = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver # LIBVA_DRIVER_NAME=iHD
vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
vaapiVdpau
libvdpau-va-gl
];
};
2020-12-21 14:13:39 +00:00
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
console = {
#font = "Lat2-Terminus16";
font = "${pkgs.terminus_font}/share/consolefonts/ter-u28n.psf.gz";
keyMap = pkgs.lib.mkForce "uk";
};
# use the xkb-config from the X server
console.useXkbConfig = true;
# Configure keymap in X11
services.xserver.layout = "gb";
services.xserver.xkbOptions = "eurosign:e,ctrl:nocaps,compose:prsc";
2021-05-18 12:09:48 +00:00
# enable touchpad support
2020-12-21 14:13:39 +00:00
services.xserver.libinput.enable = true;
# Enable CUPS to print documents.
services.printing.enable = true;
services.printing.drivers = [
pkgs.gutenprint
pkgs.epson-escpr
];
# set up my printer at home
hardware.printers.ensurePrinters = [
{
description = "My private printer";
deviceUri = "https://192.168.178.30:631/ipp/print";
location = "Home";
model = "epson-inkjet-printer-escpr/Epson-XP-322_323_325_Series-epson-escpr-en.ppd";
name = "Home";
}
];
# setup the printers at work
#hardware.printers.ensurePrinters = [
#{
#description = "CC printer";
#deviceUri = "";
#location = "BAR/III51";
#model = "Ricoh-MP_C307_PS.ppd";
#name = "CC_small";
#}
#{
#description = "PD printer (A3)";
#deviceUri = "";
#location = "BAR/III71B";
#model = "Ricoh-MP_C3004_PS.ppd";
#name = "PD_Chair";
#}
#];
# Enable sound.
sound.enable = true;
# configure pulseaudio to work with bluetooth headsets using aptx
hardware.pulseaudio = {
enable = true;
extraModules = [ pkgs.pulseaudio-modules-bt ];
# the full package is necessary for BT support
package = pkgs.pulseaudioFull;
# switch to bluetooth automatically if they are connected
extraConfig = "
load-module module-switch-on-connect
load-module module-bluetooth-policy auto_switch=2
";
};
2021-05-18 13:01:16 +00:00
nixpkgs.config.pulseaudio = true;
# enable bluetooth in general and add a simple tool for connecting devices
hardware.bluetooth = {
enable = true;
package = pkgs.bluezFull;
# enable A2DP
2021-10-14 14:15:27 +00:00
settings = {
2021-03-29 08:15:23 +00:00
General = {
Enable = "Source,Sink,Media";
Disable = "Socket";
};
};
};
services.blueman.enable = true;
2020-12-21 14:13:39 +00:00
# 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.
users.users.felix = {
createHome = true;
isNormalUser = true;
extraGroups = [ "wheel" "video" "audio" "dialout" ]; # wheel: Enable sudo for the user.
2020-12-21 14:13:39 +00:00
group = "users";
home = "/home/felix";
shell = pkgs.fish;
};
# allow user felix to run openconnect without password
security.sudo.extraRules = [
{
users = [ "felix" ];
commands = [
{ command = "${pkgs.openconnect}/bin/openconnect"; options = [ "NOPASSWD" ]; }
];
}
];
2021-05-18 12:09:48 +00:00
## enable fingerprint reader
#services.fprintd.enable = true;
#security.pam.services.login.fprintAuth = true;
##security.pam.services.xscreensaver.fprintAuth = true;
#security.pam.services.sudo.fprintAuth = true;
2020-12-21 14:13:39 +00:00
# set up virtualization with virtualbox
virtualisation.virtualbox.host.enable = true;
# I'm gonna keep this disabled for the sake of my sanity
# virtualisation.virtualbox.host.enableExtensionPack = true;
users.extraGroups.vboxusers.members = [ "felix" ];
2021-10-14 14:15:27 +00:00
# enable docker on-demand
virtualisation.docker.enable = true;
virtualisation.docker.enableOnBoot = false;
users.extraGroups.docker.members = [ "felix" ];
# add overlay for the LF IDE
#nixpkgs.overlays = [
#(self: super: {
#lingua-franca-ide = super.callPackage ./overlays/lf-eclipse.nix { };
#})
#];
2020-12-21 14:13:39 +00:00
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
2021-03-29 08:15:23 +00:00
## basic command line tooling
2020-12-21 14:13:39 +00:00
wget
vim
2021-10-14 14:15:27 +00:00
emacs
2020-12-21 14:13:39 +00:00
w3m
htop
bat
lsd
ripgrep
sshfs
ncdu
tldr
unzip
ncat
2021-04-23 09:57:47 +00:00
bind
inetutils
usbutils
screen
2021-04-23 09:57:47 +00:00
moreutils
file
2021-03-29 08:15:23 +00:00
## audio management
pavucontrol
2021-03-29 08:15:23 +00:00
## password management
2020-12-21 14:13:39 +00:00
pass
pinentry-curses
2021-10-14 14:15:27 +00:00
## admin foo
ansible
2021-03-29 08:15:23 +00:00
## mail
2020-12-21 14:13:39 +00:00
isync
msmtp
neomutt urlview
notmuch
2021-03-29 08:15:23 +00:00
## programming languages and compilers
2020-12-21 14:13:39 +00:00
rustup
cargo-flamegraph
cargo-watch
2020-12-21 14:13:39 +00:00
# python3
stack
2021-10-14 14:15:27 +00:00
haskell-language-server
2020-12-21 14:13:39 +00:00
gcc
2021-03-29 08:15:23 +00:00
binutils-unwrapped
2020-12-21 14:13:39 +00:00
gnumake
cmake
2021-03-29 08:15:23 +00:00
gdb
2021-10-14 14:15:27 +00:00
ccls
2021-03-29 08:15:23 +00:00
valgrind
heaptrack
2021-10-14 14:15:27 +00:00
#lingua-franca-ide
2021-03-29 08:15:23 +00:00
## I heard you like man pages?
2020-12-21 14:13:39 +00:00
man-pages
2021-03-29 08:15:23 +00:00
## git and friends
2020-12-21 14:13:39 +00:00
git
gitAndTools.delta
gitAndTools.gitui
2021-10-14 14:15:27 +00:00
## GitHub actions
act
2021-03-29 08:15:23 +00:00
## terminal, browsers, text editing
2020-12-21 14:13:39 +00:00
kitty
vscodium
eclipses.eclipse-platform
2020-12-21 14:13:39 +00:00
typora
2021-05-18 12:09:48 +00:00
firefox-wayland
2021-10-14 14:15:27 +00:00
# torbrowser
#next
2021-04-23 09:57:47 +00:00
rstudio
2021-03-29 08:15:23 +00:00
## time tracking
2020-12-21 14:13:39 +00:00
watson
2021-03-29 08:15:23 +00:00
## file managers
2020-12-21 14:13:39 +00:00
ranger
xfce.thunar
2021-03-29 08:15:23 +00:00
## document viewers
2020-12-21 14:13:39 +00:00
mupdf
pdfpc
zathura
2021-03-29 08:15:23 +00:00
## PDF manipulation
podofo
poppler_utils
2021-03-29 08:15:23 +00:00
## image manipulation
gimp
inkscape
libheif
2021-03-29 08:15:23 +00:00
## LaTeX
2020-12-21 14:13:39 +00:00
texlive.combined.scheme-full
2021-03-29 08:15:23 +00:00
## the eternal pain continues
2020-12-21 14:13:39 +00:00
libreoffice-fresh
2021-03-29 08:15:23 +00:00
## video and media applications
2020-12-21 14:13:39 +00:00
zoom-us
teams
2020-12-21 14:13:39 +00:00
youtube-dl
mpv
streamlink
2020-12-21 14:13:39 +00:00
ffmpeg-full
musikcube
2021-03-29 08:15:23 +00:00
## messenger
slack
2020-12-21 14:13:39 +00:00
tdesktop
signal-desktop
2021-10-14 14:15:27 +00:00
weechat
2021-03-29 08:15:23 +00:00
## networking
2020-12-21 14:13:39 +00:00
openconnect
2021-10-14 14:15:27 +00:00
## maybe screensharing???
pipewire
xdg-desktop-portal-wlr
2020-12-21 14:13:39 +00:00
];
2021-10-14 14:15:27 +00:00
#services.emacs.enable = true;
2020-12-21 14:13:39 +00:00
# install fonts
fonts.fonts = with pkgs; [
font-awesome
2021-05-18 13:01:16 +00:00
fira
2020-12-21 14:13:39 +00:00
fira-code
fira-code-symbols
2021-10-14 14:15:27 +00:00
iosevka
2020-12-21 14:13:39 +00:00
roboto
roboto-mono
roboto-slab
open-sans
2020-12-21 14:13:39 +00:00
overpass
(nerdfonts.override {
2021-05-18 13:01:16 +00:00
fonts = [ "FiraCode" "DroidSansMono" "Hack" "SourceCodePro" "RobotoMono" "Ubuntu" "UbuntuMono" ];
2020-12-21 14:13:39 +00:00
})
];
# 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;
# };
programs.fish.enable = true;
programs.vim.defaultEditor = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
pinentryFlavor = "curses";
};
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
services.udev.packages = [ pkgs.libu2f-host ];
# for SAMBA file shares
services.gvfs.enable = true;
# allow brightness control
services.illum.enable = true;
# enable OpenVPN for connecting to the TUD network
services.openvpn.servers.tud = {
config = '' config /home/felix/.config/vpn/TUD.ovpn '';
autoStart = false; #true;
updateResolvConf = true;
};
# periodic automated mail fetching
systemd.user.services.mailfetch = {
enable = true;
2021-10-14 14:15:27 +00:00
description = "Automatically fetches new mails.";
wantedBy = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
Restart = "always";
RestartSec = "60";
};
path = with pkgs; [ bash notmuch isync ];
script = ''
mbsync -a && /home/felix/.config/neomutt/notmuch-hook.sh
'';
};
2020-12-21 14:13:39 +00:00
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# 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).
2021-10-14 14:15:27 +00:00
system.stateVersion = "21.05"; # Did you read the comment?
2020-12-21 14:13:39 +00:00
}