forked from extern/nix-config
nix: Continue modularization of system modules
This commit is contained in:
parent
e60f7000b0
commit
07bbb996e5
14
modules/boot.nix
Normal file
14
modules/boot.nix
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
boot.loader = {
|
||||
systemd-boot = {
|
||||
enable = true;
|
||||
editor = false;
|
||||
configurationLimit = 10;
|
||||
};
|
||||
|
||||
timeout = 0;
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
|
||||
boot.tmp.useTmpfs = true;
|
||||
}
|
@ -1,10 +1,15 @@
|
||||
{
|
||||
imports = [
|
||||
./boot.nix
|
||||
./dual-function-keys.nix
|
||||
./fish.nix
|
||||
./fonts.nix
|
||||
./gamemode.nix
|
||||
./greetd.nix
|
||||
./home-manager.nix
|
||||
./hyprland.nix
|
||||
./networking.nix
|
||||
./nix.nix
|
||||
./piper.nix
|
||||
./pipewire.nix
|
||||
./starship.nix
|
||||
@ -12,5 +17,6 @@
|
||||
./thunar.nix
|
||||
./user.nix
|
||||
./virtualization.nix
|
||||
./vmware.nix
|
||||
];
|
||||
}
|
||||
|
18
modules/gamemode.nix
Normal file
18
modules/gamemode.nix
Normal file
@ -0,0 +1,18 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.gamemode = {
|
||||
enable = true;
|
||||
settings = {
|
||||
general = {
|
||||
renice = 10;
|
||||
igpu_power_threshold = -1;
|
||||
};
|
||||
|
||||
custom = {
|
||||
start = "${pkgs.libnotify}/bin/notify-send 'Note' 'gamemode started from host.'";
|
||||
end = "${pkgs.libnotify}/bin/notify-send 'Note' 'gamemode ended from host.";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
17
modules/home-manager.nix
Normal file
17
modules/home-manager.nix
Normal file
@ -0,0 +1,17 @@
|
||||
let VARIABLES = import ../src/variables.nix; in {
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
|
||||
sharedModules = [{
|
||||
home.stateVersion = VARIABLES.stateVersion;
|
||||
}];
|
||||
|
||||
users = {
|
||||
user = {
|
||||
home.username = VARIABLES.username;
|
||||
home.homeDirectory = "/home/${VARIABLES.username}";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
28
modules/networking.nix
Normal file
28
modules/networking.nix
Normal file
@ -0,0 +1,28 @@
|
||||
let VARIABLES = import ../src/variables.nix; in {
|
||||
networking = {
|
||||
hostName = VARIABLES.hostname;
|
||||
|
||||
networkmanager = {
|
||||
enable = true;
|
||||
wifi.macAddress = "random";
|
||||
ethernet.macAddress = "random";
|
||||
|
||||
unmanaged = [ "interface-name:ve-*" ];
|
||||
};
|
||||
|
||||
useHostResolvConf = true;
|
||||
|
||||
nat = {
|
||||
enable = true;
|
||||
internalInterfaces = [ "ve-+" ];
|
||||
externalInterface = "wg-mullvad";
|
||||
|
||||
forwardPorts = [
|
||||
{
|
||||
destination = "192.168.100.11:80";
|
||||
sourcePort = 11918;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
15
modules/nix.nix
Normal file
15
modules/nix.nix
Normal file
@ -0,0 +1,15 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
nix = {
|
||||
package = pkgs.nixFlakes;
|
||||
|
||||
settings = {
|
||||
experimental-features = [ "nix-command" "flakes" "repl-flake" ];
|
||||
auto-optimise-store = true;
|
||||
|
||||
substituters = ["https://nix-gaming.cachix.org"];
|
||||
trusted-public-keys = ["nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="];
|
||||
};
|
||||
};
|
||||
}
|
10
modules/vmware.nix
Normal file
10
modules/vmware.nix
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
virtualisation.vmware.host = {
|
||||
enable = true;
|
||||
extraConfig = /* config */ ''
|
||||
# Enable 3D acceleration on the host
|
||||
mks.gl.allowUnsupportedDrivers = "TRUE"
|
||||
mks.vk.allowUnsupportedDevices = "TRUE"
|
||||
'';
|
||||
};
|
||||
}
|
97
src/main.nix
97
src/main.nix
@ -26,49 +26,11 @@ let VARIABLES = import ./variables.nix; in {
|
||||
i18n.defaultLocale = VARIABLES.defaultLocale;
|
||||
i18n.supportedLocales = VARIABLES.supportedLocales;
|
||||
|
||||
# nix
|
||||
nix.package = pkgs.nixFlakes;
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" "repl-flake" ];
|
||||
nix.settings.auto-optimise-store = true;
|
||||
|
||||
nix.settings = {
|
||||
substituters = ["https://nix-gaming.cachix.org"];
|
||||
trusted-public-keys = ["nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="];
|
||||
};
|
||||
|
||||
hardware.opengl.driSupport32Bit = true;
|
||||
|
||||
boot.loader = {
|
||||
systemd-boot = {
|
||||
enable = true;
|
||||
editor = false;
|
||||
configurationLimit = 10;
|
||||
};
|
||||
|
||||
timeout = 0;
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
|
||||
boot.tmp.useTmpfs = true;
|
||||
|
||||
programs.neovim.enable = true;
|
||||
programs.npm.enable = true;
|
||||
|
||||
programs.gamemode = {
|
||||
enable = true;
|
||||
settings = {
|
||||
general = {
|
||||
renice = 10;
|
||||
igpu_power_threshold = -1;
|
||||
};
|
||||
|
||||
custom = {
|
||||
start = "${pkgs.libnotify}/bin/notify-send 'Note' 'gamemode started from host.'";
|
||||
end = "${pkgs.libnotify}/bin/notify-send 'Note' 'gamemode ended from host.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
hypr-contrib.packages."${VARIABLES.system}".grimblast
|
||||
nix-gaming.packages."${VARIABLES.system}".osu-stable
|
||||
@ -177,18 +139,6 @@ let VARIABLES = import ./variables.nix; in {
|
||||
environment.defaultPackages = [ ];
|
||||
system.stateVersion = VARIABLES.stateVersion;
|
||||
|
||||
# home-manager
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
|
||||
sharedModules = [
|
||||
{
|
||||
home.stateVersion = VARIABLES.stateVersion;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
systemd.extraConfig = "DefaultTimeoutStopSec=10s"; # Prevent hanging on shutdown
|
||||
services.logind.lidSwitch = "ignore"; # Don't suspend on lid close
|
||||
|
||||
@ -197,28 +147,6 @@ let VARIABLES = import ./variables.nix; in {
|
||||
|
||||
time.timeZone = "${VARIABLES.timezone}"; # Timezone
|
||||
|
||||
# user
|
||||
|
||||
home-manager.users.user = {
|
||||
home.username = VARIABLES.username;
|
||||
home.homeDirectory = "/home/${VARIABLES.username}";
|
||||
};
|
||||
|
||||
# networking
|
||||
networking = {
|
||||
hostName = VARIABLES.hostname;
|
||||
|
||||
networkmanager = {
|
||||
enable = true;
|
||||
wifi.macAddress = "random";
|
||||
ethernet.macAddress = "random";
|
||||
|
||||
unmanaged = [ "interface-name:ve-*" ];
|
||||
};
|
||||
|
||||
useHostResolvConf = true;
|
||||
};
|
||||
|
||||
services.resolved.llmnr = "false";
|
||||
|
||||
systemd.services.NetworkManager-wait-online.enable = false;
|
||||
@ -231,30 +159,5 @@ let VARIABLES = import ./variables.nix; in {
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 11918 ];
|
||||
|
||||
networking = {
|
||||
nat = {
|
||||
enable = true;
|
||||
internalInterfaces = [ "ve-+" ];
|
||||
externalInterface = "wg-mullvad";
|
||||
|
||||
forwardPorts = [
|
||||
{
|
||||
destination = "192.168.100.11:80";
|
||||
sourcePort = 11918;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
virtualisation.vmware.host = {
|
||||
enable = true;
|
||||
extraConfig = /* config */ ''
|
||||
# Enable 3D acceleration on the host
|
||||
mks.gl.allowUnsupportedDrivers = "TRUE"
|
||||
mks.vk.allowUnsupportedDevices = "TRUE"
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
zramSwap.enable = true; # Swap
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user