nixos-config/configuration.nix

172 lines
3.1 KiB
Nix

{ config, pkgs, lib, ... }:
{
nixpkgs.config.allowUnfree = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.loader = {
timeout = 5;
efi.canTouchEfiVariables = true;
grub = {
efiSupport = true;
device = "nodev";
configurationLimit = 5;
useOSProber = true;
theme = pkgs.sleek-grub-theme.override {
withBanner = "welcome to ${config.networking.hostName}";
withStyle = "dark";
};
};
};
powerManagement = {
enable = true;
powertop.enable = true;
};
services.acpid = {
enable = true;
logEvents = true;
};
services.logind = {
lidSwitch = "suspend-then-hibernate";
extraConfig = ''
HandlePowerKey=suspend-then-hibernate
IdleAction=suspend-then-hibernate
'';
};
services.fwupd.enable = true;
services.gnome.gnome-keyring.enable = true;
services.resolved.enable = true;
networking.networkmanager = {
enable = true;
wifi = {
backend = "iwd";
powersave = true;
};
};
services.upower = {
enable = true;
percentageCritical = 5;
criticalPowerAction = "HybridSleep";
};
programs = {
zsh.enable = true;
gphoto2.enable = true;
};
virtualisation.docker.enable = true;
time.timeZone = "Europe/Berlin";
services.timesyncd.enable = true;
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = lib.mkDefault "ter-u24n";
keyMap = "de-latin1-nodeadkeys";
packages = with pkgs; [ terminus_font ];
earlySetup = true;
};
fonts.packages = with pkgs; [
(nerdfonts.override { fonts = [ "DejaVuSansMono" "NerdFontsSymbolsOnly" ]; })
dejavu_fonts
fira-code
];
hardware = {
opengl.enable = true;
sane = {
enable = true;
extraBackends = [ pkgs.sane-airscan ];
};
};
security = {
polkit.enable = true;
rtkit.enable = true;
pam.services.swaylock = { };
pam.yubico = {
enable = true;
mode = "challenge-response";
id = [ "23664350" ];
control = "sufficient";
};
};
environment.systemPackages = with pkgs; [
neovim
git
];
environment.pathsToLink = [ "/share/zsh" ];
xdg.portal = {
enable = true;
wlr.enable = true;
extraPortals = [
pkgs.xdg-desktop-portal-wlr
pkgs.xdg-desktop-portal-gtk
];
config = {
common = {
default = [ "wlr" "gtk" ];
};
};
};
services.udev.packages = [ pkgs.yubikey-personalization ];
services.pipewire = {
enable = true;
wireplumber.enable = true;
pulse.enable = true;
};
services.openssh = {
enable = true;
settings.X11Forwarding = true;
};
services.udisks2.enable = true;
services.printing = {
enable = true;
};
services.avahi = {
enable = true;
nssmdns = true;
};
nix = {
package = pkgs.nixFlakes;
extraOptions = ''
experimental-features = nix-command flakes
keep-outputs = true
keep-derivations = true
'';
settings.auto-optimise-store = true;
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
};
system.stateVersion = "22.05";
}