diff --git a/modules/default.nix b/modules/default.nix index 16df219..759034d 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -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 - ]; }; } diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix new file mode 100644 index 0000000..771dff8 --- /dev/null +++ b/modules/desktop/default.nix @@ -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; + } + ]; + }; + }; +} diff --git a/modules/gnome.nix b/modules/desktop/gnome.nix similarity index 97% rename from modules/gnome.nix rename to modules/desktop/gnome.nix index 3044b0d..8b3c5c0 100644 --- a/modules/gnome.nix +++ b/modules/desktop/gnome.nix @@ -24,6 +24,8 @@ in { }; config = lib.mkIf cfg.enable { + my.desktop.enable = true; + services = { xserver = { # Enable the GNOME Desktop Environment. diff --git a/modules/kde.nix b/modules/desktop/kde.nix similarity index 97% rename from modules/kde.nix rename to modules/desktop/kde.nix index 0faecec..d56f322 100644 --- a/modules/kde.nix +++ b/modules/desktop/kde.nix @@ -23,6 +23,8 @@ in { }; config = lib.mkIf cfg.enable { + my.desktop.enable = true; + services = { # Enable the KDE Plasma Desktop Environment. xserver = { diff --git a/modules/home/vinzenz.nix b/modules/home/vinzenz.nix index 7846eee..2538077 100644 --- a/modules/home/vinzenz.nix +++ b/modules/home/vinzenz.nix @@ -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"; }; }; diff --git a/modules/i18n.nix b/modules/i18n.nix new file mode 100644 index 0000000..3d38ec1 --- /dev/null +++ b/modules/i18n.nix @@ -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"; + }; +} diff --git a/modules/nixpkgs.nix b/modules/nixpkgs.nix new file mode 100644 index 0000000..dc7c9e9 --- /dev/null +++ b/modules/nixpkgs.nix @@ -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"; + }; + }; +}