diff --git a/hive.nix b/hive.nix index 11aea6e..9f6861b 100644 --- a/hive.nix +++ b/hive.nix @@ -31,6 +31,17 @@ in }; }; + yodaTuxHeadless = { name, nodes, ... }: { + # Import the per-host configuration file. + imports = [ ./hosts/${name}/configuration.nix ]; + + deployment = { + # Local deployment. + allowLocalDeployment = true; + targetHost = null; + }; + }; + yodaTab = { name, nodes, ... }: { # Import the per-host configuration file. imports = [ ./hosts/${name}/configuration.nix ]; diff --git a/hosts/yodaTux/configuration.nix b/hosts/yodaTux/configuration.nix index 3922c88..a09de12 100644 --- a/hosts/yodaTux/configuration.nix +++ b/hosts/yodaTux/configuration.nix @@ -3,6 +3,7 @@ imports = [ ./hardware-configuration.nix + ./host-specific.nix ../../modules/tuxedo-rs.nix ../../modules/gpu-amd.nix @@ -23,8 +24,6 @@ # - `reboot` # - Related: https://unix.stackexchange.com/a/667997 - #./benchmark.nix - ../../modules/base.nix ../../modules/base-efi-systemd.nix ../../modules/xdg.nix @@ -86,16 +85,4 @@ ../../modules/docker.nix ../../modules/docker-pushrm.nix ]; - - networking.hostName = "yodaTux"; - boot.initrd.luks.devices."luks-ea7099e3-320d-4eb3-a4c3-9910a9af817b".allowDiscards = true; - yoda.btrfsFileSystems = ["/"]; - #yoda.btrfsMounts = yoda.btrfsFileSystems; - - # Systemd Journal entry: - # S Sat Sep 23 16:11:52 2023 p4 kernel: TSC found unstable after boot, most likely due to broken BIOS. Use 'tsc=unstable'. - boot.kernelParams = [ "tsc=unstable" ]; - - # Most users should never change this value after the initial install, for any reason, even if you've upgraded your system to a new NixOS release. - system.stateVersion = "23.05"; } diff --git a/hosts/yodaTux/host-specific.nix b/hosts/yodaTux/host-specific.nix new file mode 100644 index 0000000..ae207c0 --- /dev/null +++ b/hosts/yodaTux/host-specific.nix @@ -0,0 +1,14 @@ +{ config, pkgs, ... }: +{ + networking.hostName = "yodaTux"; + boot.initrd.luks.devices."luks-ea7099e3-320d-4eb3-a4c3-9910a9af817b".allowDiscards = true; + yoda.btrfsFileSystems = ["/"]; + #yoda.btrfsMounts = yoda.btrfsFileSystems; + + # Systemd Journal entry: + # S Sat Sep 23 16:11:52 2023 p4 kernel: TSC found unstable after boot, most likely due to broken BIOS. Use 'tsc=unstable'. + boot.kernelParams = [ "tsc=unstable" ]; + + # Most users should never change this value after the initial install, for any reason, even if you've upgraded your system to a new NixOS release. + system.stateVersion = "23.05"; +} diff --git a/hosts/yodaTuxHeadless/configuration.nix b/hosts/yodaTuxHeadless/configuration.nix new file mode 100644 index 0000000..94e5b07 --- /dev/null +++ b/hosts/yodaTuxHeadless/configuration.nix @@ -0,0 +1,18 @@ +{ config, pkgs, lib, ... }: +{ + imports = [ + ./hardware-configuration.nix + ./host-specific.nix + #../../modules/tuxedo-rs.nix + #../../modules/gpu-amd.nix + + ../../modules/base.nix + ../../modules/base-efi-systemd.nix + ../../modules/headless.nix + + ./cpu-fixed-frequency.nix + ../../modules/java.nix + ]; + + boot.kernelPackages = pkgs.linuxPackages_latest; +} diff --git a/hosts/yodaTuxHeadless/cpu-fixed-frequency.nix b/hosts/yodaTuxHeadless/cpu-fixed-frequency.nix new file mode 100644 index 0000000..cc5a314 --- /dev/null +++ b/hosts/yodaTuxHeadless/cpu-fixed-frequency.nix @@ -0,0 +1,29 @@ +{ config, pkgs, lib, ... }: +{ + # + # Pin CPU frequency + # + + # https://unix.stackexchange.com/a/265611 + # See current speed of each core: + # watch -n.1 "grep \"^[c]pu MHz\" /proc/cpuinfo" + # + # https://wiki.archlinux.org/title/CPU_frequency_scaling#Userspace_tools + + # Gnome uses power-profiles-daemon wich conflicts with tlp. + # https://discourse.nixos.org/t/cant-enable-tlp-when-upgrading-to-21-05/13435/3 + services.power-profiles-daemon.enable = false; + + services.tlp = { + enable = true; + + # https://linrunner.de/tlp/settings/processor.html + settings = { + CPU_SCALING_MIN_FREQ_ON_AC = 1400000; + CPU_SCALING_MAX_FREQ_ON_AC = 1400000; + + # Probably useless whenn setting fixed CPU freq above. + CPU_BOOST_ON_AC = 0; + }; + }; +} diff --git a/hosts/yodaTuxHeadless/hardware-configuration.nix b/hosts/yodaTuxHeadless/hardware-configuration.nix new file mode 120000 index 0000000..7b60cde --- /dev/null +++ b/hosts/yodaTuxHeadless/hardware-configuration.nix @@ -0,0 +1 @@ +../yodaTux/hardware-configuration.nix \ No newline at end of file diff --git a/hosts/yodaTuxHeadless/host-specific.nix b/hosts/yodaTuxHeadless/host-specific.nix new file mode 120000 index 0000000..85d9470 --- /dev/null +++ b/hosts/yodaTuxHeadless/host-specific.nix @@ -0,0 +1 @@ +../yodaTux/host-specific.nix \ No newline at end of file