Added tools to manage hard linking

This commit is contained in:
rasmus-kirk
2024-03-07 09:54:17 +01:00
parent cf3362a67b
commit 17866268ef
+23 -1
View File
@@ -6,6 +6,14 @@
}:
with lib; let
cfg = config.nixarr;
list-unlinked = pkgs.writeShellApplication {
name = "list-unlinked";
runtimeInputs = with pkgs; [util-linux];
text = ''
find "$1" -type f -links 1 -exec du -h {} + | sort -h
'';
};
in {
imports = [
./jellyfin
@@ -56,6 +64,15 @@ in {
'';
};
mediaUsers = mkOption {
type = with types; listOf str;
default = [];
example = [ "user" ];
description = ''
Extra users to add to the media group.
'';
};
mediaDir = mkOption {
type = types.path;
default = "/data/media";
@@ -147,7 +164,7 @@ in {
];
users.groups = {
media = {};
media.members = cfg.mediaUsers;
streamer = {};
torrenter = {};
};
@@ -180,6 +197,11 @@ in {
"d '${cfg.mediaDir}/torrents/readarr' 0755 torrenter media - -"
];
environment.systemPackages = with pkgs; [
jdupes
list-unlinked
];
# TODO: wtf to do about openports
vpnnamespaces.wg = {
enable = cfg.vpn.enable ;