nix: Continue modularization

This commit is contained in:
Donovan Glover 2023-06-19 05:13:04 -04:00
parent 72bd18dcfc
commit 83b6ce6e2d
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
8 changed files with 52 additions and 22 deletions

View File

@ -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
];
}

9
modules/logind.nix Normal file
View File

@ -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";
};
}

12
modules/mullvad.nix Normal file
View File

@ -0,0 +1,12 @@
{ pkgs, ... }:
{
services.mullvad-vpn = {
enable = true;
enableExcludeWrapper = false;
};
environment.systemPackages = with pkgs; [
mullvad-vpn
];
}

8
modules/neovim.nix Normal file
View File

@ -0,0 +1,8 @@
{
programs.neovim.enable = true;
environment.sessionVariables = {
EDITOR = "nvim";
VISUAL = "nvim";
};
}

4
modules/resolved.nix Normal file
View File

@ -0,0 +1,4 @@
{
# Don't use link-local multicast name resolution
services.resolved.llmnr = "false";
}

9
modules/systemd.nix Normal file
View File

@ -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;
};
}

4
modules/zram.nix Normal file
View File

@ -0,0 +1,4 @@
{
# Use zram for swap
zramSwap.enable = true; # Swap
}

View File

@ -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
}