Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 4 additions & 2 deletions hp0/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@
./hosts.nix
./firewall.nix
./il8n.nix
./systemdSystem.nix
#./systemdSystem.nix
./systemPackages.nix
./home-manager.nix
#./prometheus.nix
#./grafana.nix
];

# Bootloader.
Expand Down Expand Up @@ -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;
Expand Down
10 changes: 4 additions & 6 deletions hp0/hardware-configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,25 @@
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
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.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;
Expand Down
6 changes: 4 additions & 2 deletions hp3/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@
./hosts.nix
./firewall.nix
./il8n.nix
./systemdSystem.nix
#./systemdSystem.nix
./systemPackages.nix
./home-manager.nix
#./prometheus.nix
#./grafana.nix
];

# Bootloader.
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions hp3/hardware-configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions modules/grafana.nix
Original file line number Diff line number Diff line change
@@ -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";
};
}
9 changes: 9 additions & 0 deletions modules/prometheus.nix
Original file line number Diff line number Diff line change
@@ -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" ];
};
}
4 changes: 2 additions & 2 deletions modules/systemdSystem.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion modules/wireless.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
3 changes: 1 addition & 2 deletions nix_switch.bash → scripts/nix_switch.bash
100644 → 100755
Original file line number Diff line number Diff line change
@@ -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
10 changes: 6 additions & 4 deletions scripts/pin_nic_irqs.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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
3 changes: 3 additions & 0 deletions scripts/setup_bash_sym_link.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/run/current-system/sw/bin/bash
#
sudo ln -s /run/current-system/sw/bin/bash /usr/bin/bash
3 changes: 3 additions & 0 deletions scripts/start_flent_client.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/bash

netserver
3 changes: 3 additions & 0 deletions scripts/start_flent_server.bash
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions scripts/start_iperf_client.bash
Original file line number Diff line number Diff line change
@@ -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