nixos-configuration/common.nix

145 lines
2.8 KiB
Nix
Raw Normal View History

2023-04-04 21:13:03 +02:00
{
config,
pkgs,
2023-09-02 14:54:30 +02:00
modulesPath,
2023-04-04 21:13:03 +02:00
...
}: {
imports = [
# enable home manager
<home-manager/nixos>
2023-09-02 14:53:25 +02:00
(modulesPath + "/installer/scan/not-detected.nix")
2023-04-04 21:13:03 +02:00
];
2023-08-26 22:37:34 +02:00
nixpkgs.config = {
allowUnfree = true;
permittedInsecurePackages = [
"electron-12.2.3"
];
};
2023-04-04 21:13:03 +02:00
2023-04-04 22:02:28 +02:00
boot.loader = {
systemd-boot.enable = true;
2023-08-27 13:28:13 +02:00
efi.canTouchEfiVariables = true;
2023-04-04 21:13:03 +02:00
};
networking = {
# wireless.enable = true; # Enables wireless support via wpa_supplicant.
# wireless.userControlled.enable = true;
2023-04-04 21:13:03 +02:00
# Enable networking
networkmanager.enable = true;
firewall = {
enable = true;
allowedTCPPortRanges = [
{
# KDE Connect
2023-04-04 21:13:03 +02:00
from = 1714;
to = 1764;
}
2023-04-04 21:13:03 +02:00
];
allowedUDPPortRanges = [
{
# KDE Connect
2023-04-04 21:13:03 +02:00
from = 1714;
to = 1764;
}
2023-04-04 21:13:03 +02:00
];
};
};
time.timeZone = "Europe/Berlin";
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
};
services = {
xserver = {
# Enable the X11 windowing system / wayland depending on DE
enable = true;
# Configure keymap in X11
layout = "de";
xkbVariant = "";
};
# Enable CUPS to print documents.
printing.enable = true;
# Enable the OpenSSH daemon.
openssh = {
enable = true;
2023-08-27 20:24:57 +02:00
settings = {
PermitRootLogin = "no";
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
};
2023-04-04 21:13:03 +02:00
};
2023-09-03 18:17:07 +02:00
flatpak.enable = true;
2023-04-04 21:13:03 +02:00
};
2023-09-01 17:36:49 +02:00
systemd.extraConfig = ''
DefaultTimeoutStopSec=7s
'';
2023-04-04 21:13:03 +02:00
# Configure console keymap
console.keyMap = "de";
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
system = {
2023-09-02 14:53:25 +02:00
stateVersion = "22.11";
autoUpgrade.enable = true; # enable auto updates
2023-04-04 21:13:03 +02:00
};
nix.gc = {
automatic = true;
dates = "00:30";
};
2023-08-26 22:37:34 +02:00
programs = {
git = {
enable = true;
package = pkgs.gitFull;
};
2023-04-04 21:13:03 +02:00
2023-08-26 22:37:34 +02:00
steam = {
enable = true;
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
};
zsh.enable = true;
};
2023-08-26 17:29:01 +02:00
environment = {
pathsToLink = ["/share/zsh"];
2023-09-03 16:48:01 +02:00
systemPackages = with pkgs; [
lm_sensors
tldr
];
2023-08-26 17:29:01 +02:00
};
2023-04-04 21:13:03 +02:00
}