split configs

This commit is contained in:
Vinzenz Schroeter 2023-09-09 15:44:15 +02:00
parent 8df61f216e
commit 00fbfd0fef
7 changed files with 153 additions and 117 deletions

View file

@ -10,80 +10,30 @@ with lib; let
in {
imports = [
./home
./gnome.nix
./kde.nix
./desktop
./i18n.nix
./nixpkgs.nix
(modulesPath + "/installer/scan/not-detected.nix")
];
nixpkgs.config = {
allowUnfree = true;
permittedInsecurePackages = [
"electron-12.2.3"
];
};
boot.loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
networking = {
# wireless.enable = true; # Enables wireless support via wpa_supplicant.
# wireless.userControlled.enable = true;
# Enable networking
networkmanager.enable = true;
firewall = {
enable = true;
allowedTCPPortRanges = [
{
# KDE Connect
from = 1714;
to = 1764;
}
];
allowedUDPPortRanges = [
{
# KDE Connect
from = 1714;
to = 1764;
}
];
};
};
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 = "";
config = {
boot.loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
# Enable CUPS to print documents.
printing.enable = true;
networking = {
# wireless.enable = true; # Enables wireless support via wpa_supplicant.
# wireless.userControlled.enable = true;
# Enable networking
networkmanager.enable = true;
firewall.enable = true;
};
# Enable the OpenSSH daemon.
openssh = {
services.openssh = {
enable = true;
settings = {
PermitRootLogin = "no";
@ -91,58 +41,28 @@ in {
KbdInteractiveAuthentication = false;
};
};
};
systemd.extraConfig = ''
DefaultTimeoutStopSec=7s
'';
systemd.extraConfig = ''
DefaultTimeoutStopSec=12s
'';
# Configure console keymap
console.keyMap = "de";
programs = {
zsh.enable = true;
# 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 = {
stateVersion = "22.11";
autoUpgrade.enable = true; # enable auto updates
};
nix.gc = {
automatic = true;
dates = "00:30";
};
programs = {
git = {
enable = true;
package = pkgs.gitFull;
git = {
enable = true;
package = pkgs.gitFull;
};
};
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
environment = {
pathsToLink = ["/share/zsh"];
systemPackages = with pkgs; [
lm_sensors
tldr
ncdu
];
};
zsh.enable = true;
};
environment = {
pathsToLink = ["/share/zsh"];
systemPackages = with pkgs; [
lm_sensors
tldr
ncdu
];
};
}

View file

@ -0,0 +1,64 @@
{
config,
pkgs,
lib,
...
}: let
cfg = config.my.desktop;
in {
imports = [
./gnome.nix
./kde.nix
];
options.my.desktop = {
enable = lib.mkEnableOption "desktop";
};
config = lib.mkIf cfg.enable {
services = {
# Enable the X11 windowing system / wayland depending on DE
xserver.enable = true;
# Enable CUPS to print documents.
printing.enable = true;
};
# 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;
};
programs = {
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
};
};
# unblock kde connect / gsconnect
networking.firewall = {
allowedTCPPortRanges = [
{
# KDE Connect
from = 1714;
to = 1764;
}
];
allowedUDPPortRanges = [
{
# KDE Connect
from = 1714;
to = 1764;
}
];
};
};
}

View file

@ -24,6 +24,8 @@ in {
};
config = lib.mkIf cfg.enable {
my.desktop.enable = true;
services = {
xserver = {
# Enable the GNOME Desktop Environment.

View file

@ -23,6 +23,8 @@ in {
};
config = lib.mkIf cfg.enable {
my.desktop.enable = true;
services = {
# Enable the KDE Plasma Desktop Environment.
xserver = {

View file

@ -133,16 +133,15 @@ in {
userName = "Vinzenz Schroeter";
userEmail = "vinzenz.f.s@gmail.com";
#package = pkgs.gitFull;
#config.credential.helper = "libsecret";
aliases = {
prettylog = "log --pretty=oneline --graph";
};
extraConfig = {
pull.ff = "only";
init.defaultBranch = "main";
merge.tool = "kdiff3";
push.autoSetupRemote = "true";
};
};

28
modules/i18n.nix Normal file
View file

@ -0,0 +1,28 @@
{...}: {
config = {
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 = {
# Configure keymap in X11
layout = "de";
xkbVariant = "";
};
# Configure console keymap
console.keyMap = "de";
};
}

21
modules/nixpkgs.nix Normal file
View file

@ -0,0 +1,21 @@
{...}: {
config = {
nixpkgs.config = {
allowUnfree = true;
permittedInsecurePackages = [
"electron-12.2.3"
];
};
system = {
stateVersion = "22.11";
# enable auto updates
autoUpgrade.enable = true;
};
nix.gc = {
automatic = true;
dates = "00:30";
};
};
}