nix/container/Hdd.nix

47 lines
931 B
Nix
Raw Normal View History

2024-06-09 23:35:53 +03:00
# ISSUE: Broken, can't read/write sda device.
2024-06-14 02:58:39 +03:00
{ container, pkgs, ... } @args: let
2024-06-09 23:35:53 +03:00
cfg = container.config.hdd;
in {
systemd.tmpfiles.rules = container.mkContainerDir cfg [
"data"
];
containers.hdd = container.mkContainer cfg {
# bindMounts = let
# attachDrive = hostPath: {
# inherit hostPath;
# isReadOnly = false;
# };
# in {
# "/opt/scrutiny" = {
# hostPath = "${cfg.storage}/data";
# isReadOnly = false;
# };
# "/dev/sda" = attachDrive "/dev/sda";
# };
# allowedDevices = [
# {
# modifier = "rwm";
# node = "/dev/sda";
# }
# ];
# additionalCapabilities = [ "CAP_SYS_ADMIN" ];
2024-06-14 02:58:39 +03:00
config = { ... }: container.mkContainerConfig cfg {
2024-06-09 23:35:53 +03:00
environment.systemPackages = with pkgs; [ smartmontools ];
services.scrutiny = {
enable = true;
settings.web = {
listen = {
host = cfg.address;
port = cfg.port;
};
};
};
};
};
}