From 9b60bc19886fac43ab8e25334c2b7a2533c72efb Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 24 Sep 2023 13:04:45 +0200 Subject: [PATCH] move config to better places --- modules/desktop/default.nix | 14 +----- modules/desktop/gaming.nix | 9 +++- modules/users/default.nix | 80 ++++++++++++++++++---------------- modules/users/vinzenz-home.nix | 1 + 4 files changed, 53 insertions(+), 51 deletions(-) diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index d8f88b5..a7bbc6f 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -4,7 +4,7 @@ lib, ... }: let - cfg = config.my.desktop; + isEnabled = config.my.desktop.enable; in { imports = [ ./gnome.nix @@ -14,10 +14,7 @@ in { options.my.desktop.enable = lib.mkEnableOption "desktop"; - config = lib.mkIf cfg.enable { - home-manager.useUserPackages = true; - home-manager.useGlobalPkgs = true; - + config = lib.mkIf isEnabled { services = { # Enable the X11 windowing system / wayland depending on DE xserver.enable = true; @@ -49,11 +46,6 @@ in { programs = { git.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 - }; }; # unblock kde connect / gsconnect @@ -89,8 +81,6 @@ in { }; environment = { - pathsToLink = ["/share/zsh"]; - systemPackages = with pkgs; [ lm_sensors ]; diff --git a/modules/desktop/gaming.nix b/modules/desktop/gaming.nix index 8b9cd34..f179765 100644 --- a/modules/desktop/gaming.nix +++ b/modules/desktop/gaming.nix @@ -17,7 +17,6 @@ in { wineWowPackages.stagingFull wineWowPackages.fonts winetricks - steam (lutris.override { extraPkgs = pkgs: [ @@ -28,5 +27,13 @@ in { ]; }) ]; + + 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 + }; + }; }; } diff --git a/modules/users/default.nix b/modules/users/default.nix index 6e33607..bc0f0c0 100644 --- a/modules/users/default.nix +++ b/modules/users/default.nix @@ -23,47 +23,51 @@ in { ]; config = lib.mkIf enableHomeManager { - home-manager.sharedModules = [ - # set stateVersion - {home.stateVersion = "22.11";} - # make nano the default editor - { - home = { - sessionVariables.EDITOR = "nano"; - file.".nanorc".text = lib.mkDefault '' - set linenumbers - set mouse - ''; - }; - } - # command line niceness - { - programs = { - command-not-found.enable = true; - dircolors.enable = true; + home-manager = { + useUserPackages = true; + useGlobalPkgs = true; + sharedModules = [ + # set stateVersion + {home.stateVersion = "22.11";} + # make nano the default editor + { + home = { + sessionVariables.EDITOR = "nano"; + file.".nanorc".text = lib.mkDefault '' + set linenumbers + set mouse + ''; + }; + } + # command line niceness + { + programs = { + command-not-found.enable = true; + dircolors.enable = true; - zsh = { - enable = true; - enableSyntaxHighlighting = true; - enableAutosuggestions = true; - enableVteIntegration = true; - }; - }; - } - # common git config - { - programs = { - git = { - enable = true; - extraConfig.init.defaultBranch = "main"; + zsh = { + enable = true; + enableSyntaxHighlighting = true; + enableAutosuggestions = true; + enableVteIntegration = true; + }; }; + } + # common git config + { + programs = { + git = { + enable = true; + extraConfig.init.defaultBranch = "main"; + }; - gh = { - enable = true; - enableGitCredentialHelper = true; + gh = { + enable = true; + enableGitCredentialHelper = true; + }; }; - }; - } - ]; + } + ]; + }; }; } diff --git a/modules/users/vinzenz-home.nix b/modules/users/vinzenz-home.nix index 351fcd8..0477049 100644 --- a/modules/users/vinzenz-home.nix +++ b/modules/users/vinzenz-home.nix @@ -70,6 +70,7 @@ aliases = { prettylog = "log --pretty=oneline --graph"; + spring-clean = "!git branch --merged | xargs -n 1 -r git branch -d"; }; extraConfig = {