diff --git a/Makefile b/Makefile index 1567ac8..af2f963 100644 --- a/Makefile +++ b/Makefile @@ -9,13 +9,11 @@ hp0: scp -C ./hp0/* hp0: scp -C ./modules/* hp0: scp -C ./scripts/* hp0: - scp -C ./nix_switch.bash hp0: hp3: scp -C ./hp3/* hp3: scp -C ./modules/* hp3: scp -C ./scripts/* hp3: - scp -C ./nix_switch.bash hp3: # # end \ No newline at end of file diff --git a/hp0/configuration.nix b/hp0/configuration.nix index 1f774f7..d5bf847 100644 --- a/hp0/configuration.nix +++ b/hp0/configuration.nix @@ -27,9 +27,11 @@ ./hosts.nix ./firewall.nix ./il8n.nix - ./systemdSystem.nix + #./systemdSystem.nix ./systemPackages.nix ./home-manager.nix + #./prometheus.nix + #./grafana.nix ]; # Bootloader. @@ -89,7 +91,7 @@ # this value at the release version of the first install of this system. # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "23.11"; # Did you read the comment? + system.stateVersion = "24.05"; # Did you read the comment? # virtualisation.libvirtd.enable = true; # programs.virt-manager.enable = true; diff --git a/hp0/hardware-configuration.nix b/hp0/hardware-configuration.nix index fedeb1f..0f0208f 100644 --- a/hp0/hardware-configuration.nix +++ b/hp0/hardware-configuration.nix @@ -14,19 +14,17 @@ boot.extraModulePackages = [ ]; fileSystems."/" = - { device = "/dev/disk/by-uuid/2d466236-2a60-448a-8d1f-eb6f06f9a3fb"; + { device = "/dev/disk/by-uuid/1b9937be-2d96-4cfc-b8b4-eefebea96006"; fsType = "ext4"; }; fileSystems."/boot" = - { device = "/dev/disk/by-uuid/0126-0D03"; + { device = "/dev/disk/by-uuid/6E73-1390"; fsType = "vfat"; options = [ "fmask=0022" "dmask=0022" ]; }; - swapDevices = - [ { device = "/dev/disk/by-uuid/8b35fd91-a490-42f3-845b-27f2856c175e"; } - ]; + swapDevices = [ ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's @@ -34,7 +32,7 @@ # with explicit per-interface declarations with `networking.interfaces..useDHCP`. networking.useDHCP = lib.mkDefault true; # networking.interfaces.eno1.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp2s0f0u10.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; diff --git a/hp3/configuration.nix b/hp3/configuration.nix index ad671d2..38aecb8 100644 --- a/hp3/configuration.nix +++ b/hp3/configuration.nix @@ -27,9 +27,11 @@ ./hosts.nix ./firewall.nix ./il8n.nix - ./systemdSystem.nix + #./systemdSystem.nix ./systemPackages.nix ./home-manager.nix + #./prometheus.nix + #./grafana.nix ]; # Bootloader. @@ -89,7 +91,7 @@ # this value at the release version of the first install of this system. # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "23.11"; # Did you read the comment? + system.stateVersion = "24.05"; # Did you read the comment? # virtualisation.libvirtd.enable = true; # programs.virt-manager.enable = true; diff --git a/hp3/hardware-configuration.nix b/hp3/hardware-configuration.nix index 4175b2e..9f914b6 100644 --- a/hp3/hardware-configuration.nix +++ b/hp3/hardware-configuration.nix @@ -14,18 +14,18 @@ boot.extraModulePackages = [ ]; fileSystems."/" = - { device = "/dev/disk/by-uuid/f228ac2a-53f3-474a-a1da-b97f07048893"; + { device = "/dev/disk/by-uuid/21e4f4e0-b8ec-4024-839f-820af51a27ec"; fsType = "ext4"; }; fileSystems."/boot" = - { device = "/dev/disk/by-uuid/43B1-1B2C"; + { device = "/dev/disk/by-uuid/CC67-5B9D"; fsType = "vfat"; options = [ "fmask=0022" "dmask=0022" ]; }; swapDevices = - [ { device = "/dev/disk/by-uuid/a9e009c6-ad85-44e5-ad69-4496fba37d5b"; } + [ { device = "/dev/disk/by-uuid/a6da1204-1444-4e5a-a27f-b4cc64d7f320"; } ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking diff --git a/modules/grafana.nix b/modules/grafana.nix new file mode 100644 index 0000000..d5e8870 --- /dev/null +++ b/modules/grafana.nix @@ -0,0 +1,10 @@ +{ config, pkgs, ... }: +{ + # https://xeiaso.net/blog/prometheus-grafana-loki-nixos-2020-11-20/ + services.grafana = { + enable = true; + #domain = "grafana.pele"; + #port = 2342; + #addr = "127.0.0.1"; + }; +} \ No newline at end of file diff --git a/modules/prometheus.nix b/modules/prometheus.nix new file mode 100644 index 0000000..b504d46 --- /dev/null +++ b/modules/prometheus.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: +{ + services.prometheus = { + enable = true; + port = 9000; + # https://github.com/NixOS/nixpkgs/blob/nixos-24.05/nixos/modules/services/monitoring/prometheus/exporters.nix + enabledCollectors = [ "systemd" ]; + }; +} \ No newline at end of file diff --git a/modules/systemdSystem.nix b/modules/systemdSystem.nix index 92f23c1..5b04c17 100644 --- a/modules/systemdSystem.nix +++ b/modules/systemdSystem.nix @@ -5,10 +5,10 @@ # https://discourse.nixos.org/t/overriding-modifying-systemd-unit-file/45621/7 # https://mynixos.com/nixpkgs/options/systemd - systemd.extraConfig = "CPUAffinity=2-7"; + systemd.extraConfig = "CPUAffinity=4-7"; #https://mynixos.com/options/systemd.user - systemd.user.extraConfig = "CPUAffinity=2-7"; + systemd.user.extraConfig = "CPUAffinity=4-7"; # create your own service # https://discourse.nixos.org/t/how-to-use-toplevel-overrides-for-systemd/12501 } \ No newline at end of file diff --git a/modules/wireless.nix b/modules/wireless.nix index b03aa69..7c02b5e 100644 --- a/modules/wireless.nix +++ b/modules/wireless.nix @@ -3,7 +3,7 @@ { networking.wireless = { enable = true; # Enables wireless support via wpa_supplicant. - environmentFile = "/home/das/wireless.env"; + #environmentFile = "/home/das/wireless.env"; networks."devices".psk = "performance"; #networks."devices".psk = "@PSK_DEVICES@"; extraConfig = "ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel"; diff --git a/nix_switch.bash b/scripts/nix_switch.bash old mode 100644 new mode 100755 similarity index 76% rename from nix_switch.bash rename to scripts/nix_switch.bash index 87c50b6..cd21e4c --- a/nix_switch.bash +++ b/scripts/nix_switch.bash @@ -1,7 +1,6 @@ -#!/run/current-system/sw/bin/bash +#!/usr/bin/bash # sudo cp ./*.nix /etc/nixos/ sudo nixos-rebuild switch - #sudo ln -s /run/current-system/sw/bin/bash /usr/bin/bash \ No newline at end of file diff --git a/scripts/pin_nic_irqs.bash b/scripts/pin_nic_irqs.bash index 4ca245b..7d51971 100755 --- a/scripts/pin_nic_irqs.bash +++ b/scripts/pin_nic_irqs.bash @@ -20,6 +20,8 @@ # 95: 0 0 0 0 3 0 0 0 IR-PCI-MSIX-0000:03:00.0 9-edge iwlwifi:exception # grep iwlwifi /proc/interrupts | awk '{ print $1 }' | sed -e 's/://' +CORES="0-3" + echo "starting to pin" echo "BEFORE" echo "grep iwlwifi /proc/interrupts" @@ -28,8 +30,8 @@ grep iwlwifi /proc/interrupts for i in {86..95} do echo "Loop:${i}" - echo "echo 0-1 > /proc/irq/${i}/smp_affinity_list" - echo 0-1 > /proc/irq/"${i}"/smp_affinity_list + echo "echo ${CORES} > /proc/irq/${i}/smp_affinity_list" + echo "${CORES}" > /proc/irq/"${i}"/smp_affinity_list echo "cat /proc/irq/${i}/smp_affinity_list" cat /proc/irq/"${i}"/smp_affinity_list done @@ -41,5 +43,5 @@ grep iwlwifi /proc/interrupts #[das@hp0:~]$ grep eno /proc/interrupts # 83: 0 0 0 0 0 0 0 0 IR-PCI-MSIX-0000:05:00.0 0-edge eno1 -echo "echo 0-1 > /proc/irq/83/smp_affinity_list" -echo 0-1 > /proc/irq/83/smp_affinity_list +echo "echo ${CORES} > /proc/irq/83/smp_affinity_list" +echo "${CORES}" > /proc/irq/83/smp_affinity_list diff --git a/scripts/setup_bash_sym_link.bash b/scripts/setup_bash_sym_link.bash new file mode 100755 index 0000000..96ed699 --- /dev/null +++ b/scripts/setup_bash_sym_link.bash @@ -0,0 +1,3 @@ +#!/run/current-system/sw/bin/bash +# +sudo ln -s /run/current-system/sw/bin/bash /usr/bin/bash \ No newline at end of file diff --git a/scripts/start_flent_client.bash b/scripts/start_flent_client.bash new file mode 100755 index 0000000..6a60e14 --- /dev/null +++ b/scripts/start_flent_client.bash @@ -0,0 +1,3 @@ +#!/usr/bin/bash + +netserver \ No newline at end of file diff --git a/scripts/start_flent_server.bash b/scripts/start_flent_server.bash new file mode 100755 index 0000000..a73b055 --- /dev/null +++ b/scripts/start_flent_server.bash @@ -0,0 +1,3 @@ +#!/usr/bin/bash + +/usr/local/bin/iperf -c 172.16.40.130 --interval 1 --time 30 -e -w 4M --tcp-write-prefetch 128K \ No newline at end of file diff --git a/scripts/start_iperf_client.bash b/scripts/start_iperf_client.bash new file mode 100755 index 0000000..a73b055 --- /dev/null +++ b/scripts/start_iperf_client.bash @@ -0,0 +1,3 @@ +#!/usr/bin/bash + +/usr/local/bin/iperf -c 172.16.40.130 --interval 1 --time 30 -e -w 4M --tcp-write-prefetch 128K \ No newline at end of file