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,18 +10,13 @@ with lib; let
in { in {
imports = [ imports = [
./home ./home
./gnome.nix ./desktop
./kde.nix ./i18n.nix
./nixpkgs.nix
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
nixpkgs.config = { config = {
allowUnfree = true;
permittedInsecurePackages = [
"electron-12.2.3"
];
};
boot.loader = { boot.loader = {
systemd-boot.enable = true; systemd-boot.enable = true;
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;
@ -34,56 +29,11 @@ in {
# Enable networking # Enable networking
networkmanager.enable = true; networkmanager.enable = true;
firewall = { firewall.enable = true;
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 = "";
};
# Enable CUPS to print documents.
printing.enable = true;
# Enable the OpenSSH daemon. # Enable the OpenSSH daemon.
openssh = { services.openssh = {
enable = true; enable = true;
settings = { settings = {
PermitRootLogin = "no"; PermitRootLogin = "no";
@ -91,49 +41,18 @@ in {
KbdInteractiveAuthentication = false; KbdInteractiveAuthentication = false;
}; };
}; };
};
systemd.extraConfig = '' systemd.extraConfig = ''
DefaultTimeoutStopSec=7s DefaultTimeoutStopSec=12s
''; '';
# 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 = {
stateVersion = "22.11";
autoUpgrade.enable = true; # enable auto updates
};
nix.gc = {
automatic = true;
dates = "00:30";
};
programs = { programs = {
zsh.enable = true;
git = { git = {
enable = true; enable = true;
package = pkgs.gitFull; 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
};
zsh.enable = true;
}; };
environment = { environment = {
@ -145,4 +64,5 @@ in {
ncdu 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 { config = lib.mkIf cfg.enable {
my.desktop.enable = true;
services = { services = {
xserver = { xserver = {
# Enable the GNOME Desktop Environment. # Enable the GNOME Desktop Environment.

View file

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

View file

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