Start modularizing config

This commit is contained in:
Artemis Tosini 2020-11-16 22:47:50 +00:00
parent 6033c6df4d
commit 59d79d306d
Signed by: artemist
GPG key ID: ADFFE553DCBB831E
11 changed files with 64 additions and 63 deletions

View file

@ -1,7 +1,3 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
@ -11,7 +7,7 @@
./system/current ./system/current
./packages.nix ./packages.nix
./fonts.nix ./fonts.nix
./sets/neovim.nix ./sets/neovim
]; ];
nix = { nix = {
@ -33,9 +29,7 @@
i18n.defaultLocale = "de_DE.UTF-8"; i18n.defaultLocale = "de_DE.UTF-8";
nixpkgs = { nixpkgs.config.allowUnfree = true;
config.allowUnfree = true;
};
time.timeZone = "Etc/UTC"; time.timeZone = "Etc/UTC";
@ -134,10 +128,6 @@
programs = { programs = {
adb.enable = true; adb.enable = true;
java = {
enable = true;
package = pkgs.adoptopenjdk-bin;
};
gnupg.agent = { gnupg.agent = {
enable = true; enable = true;
enableSSHSupport = true; enableSSHSupport = true;

5
sets/cpu/amd.nix Normal file
View file

@ -0,0 +1,5 @@
{ config, pkgs, ... }:
{
hardware.cpu.amd.updateMicrocode = true;
}

8
sets/cpu/intel.nix Normal file
View file

@ -0,0 +1,8 @@
{ config, pkgs, ... }:
{
hardware.cpu.intel.updateMicrocode = true;
environment.systemPackages = with pkgs; [
i7z
];
}

11
sets/gpu/amd.nix Normal file
View file

@ -0,0 +1,11 @@
{ config, pkgs, ... }:
{
hardware.opengl.extraPackages = with pkgs; [
vaapiVdpau
libvdpau-va-gl
rocm-opencl-icd
rocm-runtime
];
environment.systemPackages = [ pkgs.rocm-smi ];
}

11
sets/gpu/intel.nix Normal file
View file

@ -0,0 +1,11 @@
{ config, pkgs, ...}:
{
hardware.opengl.extraPackages = with pkgs; [
intel-media-driver
vaapiIntel
intel-compute-runtime
];
environment.systemPackages = with pkgs; [
intel-gpu-tools
];
}

12
sets/laptop.nix Normal file
View file

@ -0,0 +1,12 @@
{ config, pkgs }:
{
services = {
tlp.enable = true;
upower.enable = true;
};
programs.light.enable = true;
environment.systemPackages = with pkgs; [
config.boot.kernelPackages.cpupower
];
}

View file

@ -1,29 +1,15 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
imports = [ ./boot-config.nix ./secure-boot.nix ./hardware-configuration.nix ]; imports = [
./boot-config.nix
./secure-boot.nix
./hardware-configuration.nix
../../sets/gpu/intel.nix
../../sets/cpu/intel.nix
../../sets/laptop.nix
];
networking.hostName = "rainbowdash"; networking.hostName = "rainbowdash";
hardware = {
cpu.intel.updateMicrocode = true;
opengl.extraPackages = with pkgs; [
intel-media-driver
vaapiIntel
];
};
services = {
tlp.enable = true;
upower.enable = true;
throttled.enable = true;
};
programs.light.enable = true;
environment.systemPackages = with pkgs; [
i7z
linuxPackages.cpupower
];
system.stateVersion = "20.03"; system.stateVersion = "20.03";
} }

View file

@ -5,30 +5,12 @@
./boot-config.nix ./boot-config.nix
./hardware-configuration.nix ./hardware-configuration.nix
../../services/ssh.nix ../../services/ssh.nix
../../sets/gpu/intel.nix
../../sets/cpu/intel.nix
../../sets/laptop.nix
]; ];
networking.hostName = "spike"; networking.hostName = "spike";
services.avahi.publish.enable = true;
hardware = {
cpu.intel.updateMicrocode = true;
opengl.extraPackages = with pkgs; [
intel-media-driver
vaapiIntel
];
};
services = {
avahi.publish.enable = true;
tlp.enable = true;
upower.enable = true;
};
programs.light.enable = true;
environment.systemPackages = with pkgs; [
i7z
linuxPackages.cpupower
];
system.stateVersion = "20.03"; system.stateVersion = "20.03";
} }

View file

@ -7,6 +7,8 @@
./nginx.nix ./nginx.nix
../../services/ssh.nix ../../services/ssh.nix
../../sets/fpga.nix ../../sets/fpga.nix
../../sets/gpu/amd.nix
../../sets/cpu/amd.nix
../../private/starlight.nix ../../private/starlight.nix
]; ];
@ -17,7 +19,7 @@
KERNEL=="eth*", ATTR{address}=="00:0f:53:16:15:9d", NAME="lan10g1" KERNEL=="eth*", ATTR{address}=="00:0f:53:16:15:9d", NAME="lan10g1"
''; '';
networking.networkmanager.enable = lib.mkForce false; networking.networkmanager.enable = false;
networking.bridges.br0 = { networking.bridges.br0 = {
rstp = true; rstp = true;
interfaces = [ "lan10g0" "lan10g1" "enp4s0" ]; interfaces = [ "lan10g0" "lan10g1" "enp4s0" ];
@ -32,12 +34,6 @@
networking.dhcpcd.allowInterfaces = [ "br0" ]; networking.dhcpcd.allowInterfaces = [ "br0" ];
hardware.cpu.amd.updateMicrocode = true; hardware.cpu.amd.updateMicrocode = true;
hardware.opengl.extraPackages = with pkgs; [
vaapiVdpau
libvdpau-va-gl
rocm-opencl-icd
rocm-runtime
];
services = { services = {
tor = { tor = {
enable = true; enable = true;