Modulize the config more.

This commit is contained in:
CronyAkatsuki 2024-03-17 17:18:40 +01:00
parent fd5cc50e0f
commit e0d51e823a
5 changed files with 52 additions and 44 deletions

View File

@ -8,6 +8,10 @@
./modules/disable-hibernation.nix
./modules/dns-over-https.nix
./modules/nvidia.nix
./modules/network-manager.nix
./modules/esync.nix
./modules/ryzenadj.nix
./modules/appimages.nix
];
# Bootloader.
@ -17,15 +21,15 @@
# Current lts kernel
boot.kernelPackages = pkgs.linuxPackages;
# load amdgpu and nouveau at boot
boot.initrd.kernelModules = [ "amdgpu" ];
# Enable gsp
# boot.kernelParams = [
# "nouveau.config=NvGspRM=1"
# "nouveau.debug=info,VBIOS=info,gsp=debug"
# ];
# load amdgpu and nouveau at boot
boot.initrd.kernelModules = [ "amdgpu" ];
# Set the hostname
networking.hostName = "nixos";
@ -35,14 +39,6 @@
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# Enable networking
networking.networkmanager.enable = true;
# Set iwd as wifi backend
networking.wireless.iwd.enable = true;
networking.networkmanager.wifi.backend = "iwd";
networking.networkmanager.wifi.powersave = false;
# Set your time zone.
time.timeZone = "Europe/Zagreb";
@ -217,16 +213,6 @@
# Add ~/.local/bin to path
environment.localBinInPath = true;
# Allow appimages to run manually
boot.binfmt.registrations.appimage = {
wrapInterpreterInShell = false;
interpreter = "${pkgs.appimage-run}/bin/appimage-run";
recognitionType = "magic";
offset = 0;
mask = "\\xff\\xff\\xff\\xff\\x00\\x00\\x00\\x00\\xff\\xff\\xff";
magicOrExtension = "\\x7fELF....AI\\x02";
};
# Automatic cleanup and optimization
nix.optimise.automatic = true;
nix.gc = {
@ -235,29 +221,6 @@
options = "--delete-older-than 15d";
};
# Set power settings for my laptop cpu
systemd.services.ryzenadj = {
enable = true;
description = "Set my ryzen cpu power.";
serviceConfig = {
Type = "oneshot";
ExecStart = toString (pkgs.writeShellScript "ryzenadj-setup" ''
${pkgs.ryzenadj}/bin/ryzenadj --stapm-limit 35000 --fast-limit 35000 --slow-limit 35000 --slow-time 60 --stapm-time 1000 --tctl-temp 90 --vrmmax-current 65000
'');
};
wantedBy = [ "default.target" ];
};
# Esync
systemd.extraConfig = "DefaultLimitNOFILE=1048576";
security.pam.loginLimits = [{
domain = "*";
type = "hard";
item = "nofile";
value = "1048576";
}];
# Enable virt manager
virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = true;

View File

@ -0,0 +1,11 @@
{ pkgs, ... }: {
# Allow appimages to run manually
boot.binfmt.registrations.appimage = {
wrapInterpreterInShell = false;
interpreter = "${pkgs.appimage-run}/bin/appimage-run";
recognitionType = "magic";
offset = 0;
mask = "\\xff\\xff\\xff\\xff\\x00\\x00\\x00\\x00\\xff\\xff\\xff";
magicOrExtension = "\\x7fELF....AI\\x02";
};
}

11
nixos/modules/esync.nix Normal file
View File

@ -0,0 +1,11 @@
{ ... }: {
# Esync
systemd.extraConfig = "DefaultLimitNOFILE=1048576";
security.pam.loginLimits = [{
domain = "*";
type = "hard";
item = "nofile";
value = "1048576";
}];
}

View File

@ -0,0 +1,9 @@
{ ... }: {
# Enable networking
networking.networkmanager.enable = true;
# Set iwd as wifi backend
networking.wireless.iwd.enable = true;
networking.networkmanager.wifi.backend = "iwd";
networking.networkmanager.wifi.powersave = false;
}

View File

@ -0,0 +1,14 @@
{ pkgs, ... }: {
# Set power settings for my laptop cpu
systemd.services.ryzenadj = {
enable = true;
description = "Set my ryzen cpu power.";
serviceConfig = {
Type = "oneshot";
ExecStart = toString (pkgs.writeShellScript "ryzenadj-setup" ''
${pkgs.ryzenadj}/bin/ryzenadj --stapm-limit 35000 --fast-limit 35000 --slow-limit 35000 --slow-time 60 --stapm-time 1000 --tctl-temp 90 --vrmmax-current 65000
'');
};
wantedBy = [ "default.target" ];
};
}