nixos-configuration/machines/common.nix

191 lines
4.1 KiB
Nix
Raw Normal View History

2022-02-15 15:44:40 +01:00
inputs:
2022-02-18 12:13:34 +01:00
{ config, lib, pkgs, ... }: {
2022-02-15 15:44:40 +01:00
nix = {
2022-02-18 17:12:39 +01:00
package = pkgs.nixUnstable;
2022-02-15 15:44:40 +01:00
extraOptions = ''
experimental-features = nix-command flakes
'';
2022-02-18 17:12:39 +01:00
binaryCaches = lib.mkForce [
"https://cache.nixos.org/"
"https://nix-community.cachix.org"
];
binaryCachePublicKeys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
#settings = {
#substituters = lib.mkForce [
#"https://cache.nixos.org/"
#"https://nix-community.cachix.org"
#];
#trusted-public-keys = [
#"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
#];
#};
2022-02-18 12:13:34 +01:00
# nix shell and nix build should use the same channel as the flake
registry.nixpkgs.flake = inputs.nixpkgs;
2022-02-15 15:44:40 +01:00
};
nixpkgs.config.allowUnfree = true;
networking = {
networkmanager.enable = true;
};
i18n.defaultLocale = "en_GB.UTF-8";
time.timeZone = "Europe/Berlin";
sound.enable = true;
hardware = {
2022-02-18 17:12:39 +01:00
# TODO: remove
enableAllFirmware = true;
2022-02-15 15:44:40 +01:00
pulseaudio = {
2022-02-18 12:13:34 +01:00
# TODO: pipewire
2022-02-18 17:12:39 +01:00
enable = true;
2022-02-15 15:44:40 +01:00
# stop mumble from muting other processes
extraConfig = "unload-module module-role-cork";
};
opengl = {
enable = true;
2022-02-18 17:12:39 +01:00
# driSupport = true;
2022-02-15 15:44:40 +01:00
driSupport32Bit = true;
};
};
services = {
2022-10-09 12:19:48 +02:00
# yubikey smartcard mode
pcscd.enable = true;
2022-02-15 15:44:40 +01:00
dbus.packages = with pkgs; [ gcr ];
2022-10-09 12:19:48 +02:00
# for u2f stick and yubikey
udev.packages = with pkgs; [ libu2f-host yubikey-personalization ];
2022-02-18 17:12:39 +01:00
davfs2.enable = true;
2022-02-15 15:44:40 +01:00
unbound.enable = true;
udisks2.enable = true;
# Enable CUPS to print documents.
printing.enable = true;
pipewire = {
2022-02-18 17:12:39 +01:00
enable = false;
2022-02-15 15:44:40 +01:00
pulse.enable = true;
};
# required for nextcloud
gnome.gnome-keyring.enable = true;
# faster entropy generation
haveged.enable = true;
2022-02-18 17:12:39 +01:00
mullvad-vpn.enable = true;
2022-02-15 15:44:40 +01:00
xserver = {
enable = true;
layout = "eu";
xkbOptions = "caps:escape";
displayManager = {
defaultSession = "none+i3";
lightdm.enable = true;
};
windowManager.i3 = {
enable = true;
extraPackages = with pkgs; [
dmenu
rofi
i3status
i3lock
i3blocks
];
};
};
};
2022-02-18 17:12:39 +01:00
2022-02-15 15:44:40 +01:00
systemd.tmpfiles.rules = [
"L+ /lib64/ld-linux-x86-64.so.2 - - - - ${pkgs.glibc}/lib64/ld-linux-x86-64.so.2"
2022-02-15 15:44:40 +01:00
];
environment.systemPackages = with pkgs; [
2022-11-09 20:17:18 +01:00
alacritty
2022-02-15 15:44:40 +01:00
arandr
git
keepassxc
lxappearance
2022-02-18 17:12:39 +01:00
mullvad-vpn
2022-02-15 15:44:40 +01:00
networkmanagerapplet
nextcloud-client
pavucontrol
termite
vim
2022-02-18 17:12:39 +01:00
wget
2022-02-15 15:44:40 +01:00
which
xfce.thunar
xfce.thunar-volman
gvfs
2022-10-09 12:19:48 +02:00
# yubikey packages
yubikey-manager-qt
yubikey-personalization-gui
yubioath-desktop
2022-02-15 15:44:40 +01:00
];
virtualisation = {
docker = {
enable = true;
};
# podman = {
# enable = true;
# dockerCompat = true;
# dockerSocket.enable = true;
# };
# lxd.enable = true;
# virtualbox.host.enable = true;
# virtualbox.host.enableExtensionPack = true;
};
programs = {
# enable zsh globally
zsh.enable = true;
gnupg.agent = {
enable = true;
enableSSHSupport = true;
pinentryFlavor = "curses";
};
};
environment.sessionVariables = {
XKB_DEFAULT_OPTIONS = "caps:escape";
XKB_DEFAULT_LAYOUT = "eu";
};
# required for i3
environment.pathsToLink = [ "/libexec" ]; # links /libexec from derivations to /run/current-system/sw
fonts = {
enableDefaultFonts = true;
fonts = with pkgs; [
2022-03-15 11:29:42 +01:00
font-awesome
2022-02-15 15:44:40 +01:00
nerdfonts
2022-03-15 11:29:42 +01:00
noto-fonts
2022-02-15 15:44:40 +01:00
noto-fonts-cjk
noto-fonts-emoji
powerline-fonts
2022-03-15 11:29:42 +01:00
material-icons
2022-02-15 15:44:40 +01:00
];
fontconfig = {
defaultFonts = {
2022-02-18 18:29:01 +01:00
monospace = [ "JetBrainsMono Nerd Font" "Noto Color Emoji" "FontAwesome" ];
sansSerif = [ "JetBrainsMono Nerd Font" "Noto Color Emoji" "FontAwesome" ];
serif = [ "JetBrainsMono Nerd Font" "Noto Color Emoji" "FontAwesome" ];
2022-02-15 15:44:40 +01:00
};
};
2022-02-18 12:13:34 +01:00
};
2022-10-09 12:19:48 +02:00
# generate login settings
# ykman otp chalresp --touch --generate 2
security.pam.yubico = {
enable = true;
# debug = true;
mode = "challenge-response";
};
2022-02-15 15:44:40 +01:00
}