Modulize the config more.
This commit is contained in:
parent
fd5cc50e0f
commit
e0d51e823a
@ -8,6 +8,10 @@
|
|||||||
./modules/disable-hibernation.nix
|
./modules/disable-hibernation.nix
|
||||||
./modules/dns-over-https.nix
|
./modules/dns-over-https.nix
|
||||||
./modules/nvidia.nix
|
./modules/nvidia.nix
|
||||||
|
./modules/network-manager.nix
|
||||||
|
./modules/esync.nix
|
||||||
|
./modules/ryzenadj.nix
|
||||||
|
./modules/appimages.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Bootloader.
|
# Bootloader.
|
||||||
@ -17,15 +21,15 @@
|
|||||||
# Current lts kernel
|
# Current lts kernel
|
||||||
boot.kernelPackages = pkgs.linuxPackages;
|
boot.kernelPackages = pkgs.linuxPackages;
|
||||||
|
|
||||||
|
# load amdgpu and nouveau at boot
|
||||||
|
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||||
|
|
||||||
# Enable gsp
|
# Enable gsp
|
||||||
# boot.kernelParams = [
|
# boot.kernelParams = [
|
||||||
# "nouveau.config=NvGspRM=1"
|
# "nouveau.config=NvGspRM=1"
|
||||||
# "nouveau.debug=info,VBIOS=info,gsp=debug"
|
# "nouveau.debug=info,VBIOS=info,gsp=debug"
|
||||||
# ];
|
# ];
|
||||||
|
|
||||||
# load amdgpu and nouveau at boot
|
|
||||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
|
||||||
|
|
||||||
# Set the hostname
|
# Set the hostname
|
||||||
networking.hostName = "nixos";
|
networking.hostName = "nixos";
|
||||||
|
|
||||||
@ -35,14 +39,6 @@
|
|||||||
# Allow unfree packages
|
# Allow unfree packages
|
||||||
nixpkgs.config.allowUnfree = true;
|
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.
|
# Set your time zone.
|
||||||
time.timeZone = "Europe/Zagreb";
|
time.timeZone = "Europe/Zagreb";
|
||||||
|
|
||||||
@ -217,16 +213,6 @@
|
|||||||
# Add ~/.local/bin to path
|
# Add ~/.local/bin to path
|
||||||
environment.localBinInPath = true;
|
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
|
# Automatic cleanup and optimization
|
||||||
nix.optimise.automatic = true;
|
nix.optimise.automatic = true;
|
||||||
nix.gc = {
|
nix.gc = {
|
||||||
@ -235,29 +221,6 @@
|
|||||||
options = "--delete-older-than 15d";
|
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
|
# Enable virt manager
|
||||||
virtualisation.libvirtd.enable = true;
|
virtualisation.libvirtd.enable = true;
|
||||||
programs.virt-manager.enable = true;
|
programs.virt-manager.enable = true;
|
||||||
|
11
nixos/modules/appimages.nix
Normal file
11
nixos/modules/appimages.nix
Normal 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
11
nixos/modules/esync.nix
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{ ... }: {
|
||||||
|
# Esync
|
||||||
|
systemd.extraConfig = "DefaultLimitNOFILE=1048576";
|
||||||
|
|
||||||
|
security.pam.loginLimits = [{
|
||||||
|
domain = "*";
|
||||||
|
type = "hard";
|
||||||
|
item = "nofile";
|
||||||
|
value = "1048576";
|
||||||
|
}];
|
||||||
|
}
|
9
nixos/modules/network-manager.nix
Normal file
9
nixos/modules/network-manager.nix
Normal 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;
|
||||||
|
}
|
14
nixos/modules/ryzenadj.nix
Normal file
14
nixos/modules/ryzenadj.nix
Normal 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" ];
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user