Skip to content

Commit

Permalink
power-meter
Browse files Browse the repository at this point in the history
  • Loading branch information
Czichy committed Dec 5, 2024
1 parent daf24eb commit e06732d
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 4 deletions.
2 changes: 1 addition & 1 deletion globals.nix
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ in {
# IBKR Flex Downloader
hosts.HL-3-RZ-IBKR-01.id = 15;
# Power Meter
hosts.HL-3-RZ-POWER-01.id = 19;
hosts.HL-3-RZ-POWER-01.id = 32;
# |------------------------------------| #
hosts.HL-1-MRZ-HOST-02.id = 20;
# AdguardHome
Expand Down
6 changes: 3 additions & 3 deletions hosts/HL-1-MRZ-HOST-01/guests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@
}
// mkMicrovm "ibkr-flex" "HL-3-RZ-IBKR-01" "enp4s0" "02:01:27:ff:ed:77" "vlan40" {
}
// mkMicrovm "powermeter" "HL-3-RZ-POWER-01" "enp4s0" "02:02:27:f1:ed:77" "vlan40" {
enableStorageDataset = true;
}
# // mkMicrovm "powermeter" "HL-3-RZ-POWER-01" "enp4s0" "02:02:27:f1:ed:77" "vlan40" {
# enableStorageDataset = true;
# }
);
};
}
3 changes: 3 additions & 0 deletions hosts/HL-1-MRZ-HOST-03/guests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@
// mkMicrovm "unifi" "HL-3-RZ-UNIFI-01" "servers" "02:01:27:11:7f:17" "vlan40" {
enableStorageDataset = true;
}
// mkMicrovm "powermeter" "HL-3-RZ-POWER-01" "enp4s0" "02:02:27:f1:ed:77" "vlan40" {
enableStorageDataset = true;
}
);
};
}
82 changes: 82 additions & 0 deletions hosts/HL-1-MRZ-HOST-03/guests/powermeter.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
inputs,
pkgs,
hostName,
...
}:
# let
# |----------------------------------------------------------------------| #
# |----------------------------------------------------------------------| #
# in
{
# microvm.mem = 512;
# microvm.vcpu = 1;
# microvm.shares = [
# {
# # On the host
# source = "/shared/shares/users/christian/Trading/TWS_Flex_Reports";
# # In the MicroVM
# mountPoint = "/TWS_Flex_Reports";
# tag = "flex";
# proto = "virtiofs";
# }
# ];

networking.hostName = hostName;

# |----------------------------------------------------------------------| #
users = {
users.power = {
isSystemUser = true;
group = "power";
};
groups.power = {};
};
# |----------------------------------------------------------------------| #
# age.secrets = {
# ibkrFlexToken = {
# symlink = true;
# file = secretsPath + "/hosts/HL-1-MRZ-HOST-01/guests/ibkr-flex/token.age";
# mode = "0600";
# owner = "root";
# };
# };
# age.secrets.ibkr-flex-hc-ping = {
# file = secretsPath + "/hosts/HL-4-PAZ-PROXY-01/healthchecks-ping.age";
# mode = "440";
# owner = "root";
# };
# ------------------------------
# | SYSTEM PACKAGES |
# ------------------------------
# environment.systemPackages = with pkgs; [
# pkg-config
# inputs.power-meter.packages.${pkgs.system}.power-meter
# ];
# |----------------------------------------------------------------------| #
# systemd.timers."ibkr-flex-download" = {
# wantedBy = ["timers.target"];
# timerConfig = {
# Perisistent = true;
# OnCalendar = "Mon..Fri 23:30";
# Unit = "ibkr-flex-download.service";
# };
# };

# systemd.services."ibkr-flex-download" = {
# serviceConfig = {
# Type = "simple";
# User = "root";
# ExecStart = "${download-ibkr-flex}/bin/ibkr-flex-download";
# };
# };

# |----------------------------------------------------------------------| #
environment.persistence."/persist".files = [
"/etc/ssh/ssh_host_rsa_key"
"/etc/ssh/ssh_host_rsa_key.pub"
];
# |----------------------------------------------------------------------| #
systemd.network.enable = true;
system.stateVersion = "24.05";
}

0 comments on commit e06732d

Please sign in to comment.