From 7deac83d33f854daf7e83c24e0b291ced8c538f0 Mon Sep 17 00:00:00 2001 From: HotaruBlaze Date: Sun, 31 May 2026 10:44:55 +0000 Subject: [PATCH] a --- hosts/blade/default.nix | 7 +++---- hosts/blade/power-plan.nix | 22 ++++++++++++++++++++++ modules/common.nix | 1 - modules/common/incus.nix | 3 +++ modules/common/persisting.nix | 31 ------------------------------- modules/common/users.nix | 2 +- 6 files changed, 29 insertions(+), 37 deletions(-) create mode 100644 hosts/blade/power-plan.nix delete mode 100644 modules/common/persisting.nix diff --git a/hosts/blade/default.nix b/hosts/blade/default.nix index e94c4d5..c5be6a4 100644 --- a/hosts/blade/default.nix +++ b/hosts/blade/default.nix @@ -7,11 +7,8 @@ ... }: { - imports = [ - ../../common/incus.nix - ]; deployment = { - targetHost = "192.168.1.69"; + targetHost = "192.168.1.70"; targetPort = 22; targetUser = "phoenix"; buildOnTarget = true; @@ -24,7 +21,9 @@ imports = [ ./hardware-configuration.nix ../../modules/common.nix + ../../modules/common/incus.nix ./networking.nix ./users.nix + ./power-plan.nix ]; } diff --git a/hosts/blade/power-plan.nix b/hosts/blade/power-plan.nix new file mode 100644 index 0000000..b1db2eb --- /dev/null +++ b/hosts/blade/power-plan.nix @@ -0,0 +1,22 @@ +{ + name, + nodes, + pkgs, + lib, + inputs, + ... +}: +{ + services.power-profiles-daemon.enable = true; + + powerManagement.powertop.enable = true; + + # boot.kernelParams = [ + # "pcie_aspm=force" + # ]; + + environment.systemPackages = with pkgs; [ + powertop + turbostat + ]; +} \ No newline at end of file diff --git a/modules/common.nix b/modules/common.nix index fc6cdb8..dca178a 100644 --- a/modules/common.nix +++ b/modules/common.nix @@ -7,6 +7,5 @@ ./common/services.nix ./common/networking.nix ./common/system.nix - ./common/persisting.nix ]; } diff --git a/modules/common/incus.nix b/modules/common/incus.nix index c1b3584..1b78852 100644 --- a/modules/common/incus.nix +++ b/modules/common/incus.nix @@ -74,4 +74,7 @@ }; }; }; + networking.nftables.enable = true; + users.users.phoenix.extraGroups = ["incus-admin"]; + networking.firewall.trustedInterfaces = [ "incusbr*" "internalbr0" ]; } diff --git a/modules/common/persisting.nix b/modules/common/persisting.nix deleted file mode 100644 index 4e88325..0000000 --- a/modules/common/persisting.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - persisting = { - enable = true; - - # Default directories to persist - directories = [ - { - path = "/persist"; - target = "/persist"; - options = [ "defaults" "bind" ]; - } - { - path = "/var/log"; - target = "/var/log"; - options = [ "defaults" "bind" ]; - } - { - path = "/var/lib"; - target = "/var/lib"; - options = [ "defaults" "bind" ]; - } - ]; - }; - - # Ensure persist directory exists - systemd.tmpfiles.rules = [ - "d /persist 0755 root root - -" - ]; -} diff --git a/modules/common/users.nix b/modules/common/users.nix index 7d82edd..894d18c 100644 --- a/modules/common/users.nix +++ b/modules/common/users.nix @@ -21,7 +21,7 @@ security.sudo.extraRules = [ { - users = [ "phoenix" ]; + users = [ "phoenix" "deploy" ]; commands = [ { command = "ALL";