diff --git a/modules/default.nix b/modules/default.nix index 059da43..9eca715 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -8,15 +8,21 @@ ./greetd.nix ./home-manager.nix ./hyprland.nix + ./logind.nix + ./mullvad.nix + ./neovim.nix ./networking.nix ./nix.nix ./piper.nix ./pipewire.nix + ./resolved.nix ./starship.nix ./stylix.nix + ./systemd.nix ./thunar.nix ./user.nix ./virtualization.nix ./vmware.nix + ./zram.nix ]; } diff --git a/modules/logind.nix b/modules/logind.nix new file mode 100644 index 0000000..8b32ecb --- /dev/null +++ b/modules/logind.nix @@ -0,0 +1,9 @@ +{ + services.logind = { + # Don't suspend on lid close + lidSwitch = "ignore"; + + # Don't shutdown when power button is short-pressed + extraConfig = "HandlePowerKey=ignore"; + }; +} diff --git a/modules/mullvad.nix b/modules/mullvad.nix new file mode 100644 index 0000000..1826fab --- /dev/null +++ b/modules/mullvad.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: + +{ + services.mullvad-vpn = { + enable = true; + enableExcludeWrapper = false; + }; + + environment.systemPackages = with pkgs; [ + mullvad-vpn + ]; +} diff --git a/modules/neovim.nix b/modules/neovim.nix new file mode 100644 index 0000000..215faa3 --- /dev/null +++ b/modules/neovim.nix @@ -0,0 +1,8 @@ +{ + programs.neovim.enable = true; + + environment.sessionVariables = { + EDITOR = "nvim"; + VISUAL = "nvim"; + }; +} diff --git a/modules/resolved.nix b/modules/resolved.nix new file mode 100644 index 0000000..3d53bbc --- /dev/null +++ b/modules/resolved.nix @@ -0,0 +1,4 @@ +{ + # Don't use link-local multicast name resolution + services.resolved.llmnr = "false"; +} diff --git a/modules/systemd.nix b/modules/systemd.nix new file mode 100644 index 0000000..3898bb6 --- /dev/null +++ b/modules/systemd.nix @@ -0,0 +1,9 @@ +{ + systemd = { + # Limit shutdown wait time to 10 seconds + extraConfig = "DefaultTimeoutStopSec=10s"; + + # Don't wait for an internet connection before obtaining a graphical interface + services.NetworkManager-wait-online.enable = false; + }; +} diff --git a/modules/zram.nix b/modules/zram.nix new file mode 100644 index 0000000..68d3151 --- /dev/null +++ b/modules/zram.nix @@ -0,0 +1,4 @@ +{ + # Use zram for swap + zramSwap.enable = true; # Swap +} diff --git a/src/main.nix b/src/main.nix index 7ee95de..68e4f03 100644 --- a/src/main.nix +++ b/src/main.nix @@ -28,7 +28,6 @@ let VARIABLES = import ./variables.nix; in { hardware.opengl.driSupport32Bit = true; - programs.neovim.enable = true; environment.systemPackages = with pkgs; [ hypr-contrib.packages."${VARIABLES.system}".grimblast nix-gaming.packages."${VARIABLES.system}".osu-stable @@ -40,7 +39,6 @@ let VARIABLES = import ./variables.nix; in { slade typespeed osu-lazer-bin - mullvad-vpn pass treefmt jamesdsp @@ -127,8 +125,6 @@ let VARIABLES = import ./variables.nix; in { ]; environment.sessionVariables = { - EDITOR = "nvim"; - VISUAL = "nvim"; GIT_DISCOVERY_ACROSS_FILESYSTEM = "1"; FZF_DEFAULT_OPTS = "--height 40% --reverse --border --color=16"; NODE_OPTIONS = "--max_old_space_size=16384"; @@ -137,25 +133,7 @@ let VARIABLES = import ./variables.nix; in { environment.defaultPackages = [ ]; system.stateVersion = VARIABLES.stateVersion; - systemd.extraConfig = "DefaultTimeoutStopSec=10s"; # Prevent hanging on shutdown - services.logind.lidSwitch = "ignore"; # Don't suspend on lid close - - # Don't shutdown when power button is short-pressed - services.logind.extraConfig = "HandlePowerKey=ignore"; - time.timeZone = "${VARIABLES.timezone}"; # Timezone - services.resolved.llmnr = "false"; - - systemd.services.NetworkManager-wait-online.enable = false; - - # mullvad-vpn - services.mullvad-vpn = { - enable = true; - enableExcludeWrapper = false; - }; - networking.firewall.allowedTCPPorts = [ 11918 ]; - - zramSwap.enable = true; # Swap }