Fixed if statement. Added separate disk-spindown file.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
|
||||
### --> SnapRAID disks research
|
||||
contentDiskMounts = lib.attrsets.attrNames (
|
||||
lib.attrsets.filterAttrs (name: value: lib.strings.hasPrefix "/mnt/content-" name) config.fileSystems
|
||||
@@ -14,15 +13,8 @@ let
|
||||
{ i = 0; }
|
||||
contentDiskMounts;
|
||||
### SnapRAID disks research <--
|
||||
|
||||
### --> Spindown disks
|
||||
hardDrives = [ ${DISK_ID_LIST[@]} ];
|
||||
### Spindown disks <--
|
||||
in
|
||||
|
||||
|
||||
|
||||
|
||||
### --> MergerFS setup
|
||||
{
|
||||
fileSystems."/mnt/data-storage" = {
|
||||
@@ -40,8 +32,6 @@ in
|
||||
};
|
||||
### MergerFS setup <--
|
||||
|
||||
|
||||
|
||||
### --> SnapRAID setup
|
||||
services.snapraid = {
|
||||
enable = true;
|
||||
@@ -51,22 +41,4 @@ in
|
||||
};
|
||||
### SnapRAID setup <--
|
||||
|
||||
|
||||
|
||||
### --> Disk spindown
|
||||
systemd.services.hd-idle = {
|
||||
description = "External HD spin down daemon";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart =
|
||||
let
|
||||
idleTime = toString 1800;
|
||||
hardDriveParameter = lib.strings.concatMapStringsSep " " (x: "-a ${x} -i ${idleTime}") hardDrives;
|
||||
in
|
||||
"${pkgs.hd-idle}/bin/hd-idle -i 0 ${hardDriveParameter}";
|
||||
};
|
||||
};
|
||||
### Disk spindown <--
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
### --> Disk spindown
|
||||
systemd.services.hd-idle = {
|
||||
description = "External HD spin down daemon";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart =
|
||||
let
|
||||
idleTime = toString 1800;
|
||||
hardDriveParameter = lib.strings.concatMapStringsSep " " (x: "-a ${x} -i ${idleTime}") hardDrives;
|
||||
in
|
||||
"${pkgs.hd-idle}/bin/hd-idle -i 0 ${hardDriveParameter}";
|
||||
};
|
||||
};
|
||||
### Disk spindown <--
|
||||
Reference in New Issue
Block a user