add systemd timers, add beets config, add smb share
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
./modules/nfs.nix
|
./modules/nfs.nix
|
||||||
./modules/navidrome.nix
|
./modules/navidrome.nix
|
||||||
./modules/slskd.nix
|
./modules/slskd.nix
|
||||||
|
./modules/smb.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
nix.settings.experimental-features = [
|
nix.settings.experimental-features = [
|
||||||
@@ -58,6 +59,7 @@
|
|||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
};
|
};
|
||||||
boot.zfs.forceImportRoot = false;
|
boot.zfs.forceImportRoot = false;
|
||||||
|
services.zfs.autoScrub.enable = true;
|
||||||
|
|
||||||
swapDevices = [ ];
|
swapDevices = [ ];
|
||||||
|
|
||||||
@@ -87,6 +89,7 @@
|
|||||||
shell = pkgs.fish;
|
shell = pkgs.fish;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.tailscale.enable = true;
|
||||||
services.rsync.enable = true;
|
services.rsync.enable = true;
|
||||||
programs.nh.enable = true;
|
programs.nh.enable = true;
|
||||||
programs.neovim.enable = true;
|
programs.neovim.enable = true;
|
||||||
@@ -117,5 +120,33 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.timers."bc-wishlist-scraper" = {
|
||||||
|
wantedBy = [ "timers.target" ];
|
||||||
|
timerConfig = {
|
||||||
|
OnCalendar = "daily";
|
||||||
|
Unit = "bc-wishlist-scraper.service";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services."bc-wishlist-scraper" = {
|
||||||
|
script = ''
|
||||||
|
${pkgs.bash}/bin/bash /home/user/bc-wishlist-scraper/run.sh
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.user.timers."scdl" = {
|
||||||
|
wantedBy = [ "timers.target" ];
|
||||||
|
timerConfig = {
|
||||||
|
OnCalendar = "daily";
|
||||||
|
Unit = "scdl.service";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.user.services."scdl" = {
|
||||||
|
script = ''
|
||||||
|
cd ~/Music/scdl && ${pkgs.scdl}/bin/scdl me -f -c --download-archive archive.txt
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
system.stateVersion = "26.05";
|
system.stateVersion = "26.05";
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+49
-8
@@ -7,11 +7,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1784725727,
|
"lastModified": 1784789275,
|
||||||
"narHash": "sha256-J5+C9wsO0lhDyUalQzfplDbRjyHDYeEH5+9sdyXtwa8=",
|
"narHash": "sha256-cgRTWuG+u1tBPhm01JrId2k0Bni09phVJ1Q0BZlRd7M=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "041a999e8c1c5b731913855909e68d30ca69b8e0",
|
"rev": "3b0e6bbd65869af1beadf5963a99befc179d209f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -22,24 +22,65 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1784667253,
|
"lastModified": 1784843119,
|
||||||
"narHash": "sha256-35bjWl+VasRT9qKxLhZsoKBxjkyUtiwfxYOuvsZbCX0=",
|
"narHash": "sha256-KUklz9QgWKgBxWXA2UOO2bFHe96ioAuDU5kdhPNR+4A=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "3247a2b07cc6751f9aaa1012fea55be69e6f1fe0",
|
"rev": "fac37c4c352c6ae34578df70dd833cfd7dfca131",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"ref": "pull/544340/head",
|
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixpkgs-patch-filetote": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"narHash": "sha256-GqEjefb2EZNMsTWPDqqnjrjk7G9UEn+7OID03eLHyaM=",
|
||||||
|
"type": "file",
|
||||||
|
"url": "https://github.com/NixOS/nixpkgs/pull/543082.diff"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "file",
|
||||||
|
"url": "https://github.com/NixOS/nixpkgs/pull/543082.diff"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs-patch-slskd": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"narHash": "sha256-QRija0sHZY/w4bS/c1LWcckPL5zYK7QFnR7OV3zfrvE=",
|
||||||
|
"type": "file",
|
||||||
|
"url": "https://github.com/NixOS/nixpkgs/pull/544340.diff"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "file",
|
||||||
|
"url": "https://github.com/NixOS/nixpkgs/pull/544340.diff"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs-patcher": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1781789965,
|
||||||
|
"narHash": "sha256-ZRlWPq2Qms6KbesJrj7cUe2GN7s8BZISfp9ZbrCi2x0=",
|
||||||
|
"owner": "gepbird",
|
||||||
|
"repo": "nixpkgs-patcher",
|
||||||
|
"rev": "d2abed2b94b7955e05b4e2e8a9b8ac45597ecf94",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "gepbird",
|
||||||
|
"repo": "nixpkgs-patcher",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs",
|
||||||
|
"nixpkgs-patch-filetote": "nixpkgs-patch-filetote",
|
||||||
|
"nixpkgs-patch-slskd": "nixpkgs-patch-slskd",
|
||||||
|
"nixpkgs-patcher": "nixpkgs-patcher"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,10 +1,19 @@
|
|||||||
{
|
{
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs?ref=pull/544340/head";
|
nixpkgs.url = "github:NixOS/nixpkgs";
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager";
|
url = "github:nix-community/home-manager";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
nixpkgs-patcher.url = "github:gepbird/nixpkgs-patcher";
|
||||||
|
nixpkgs-patch-slskd = {
|
||||||
|
url = "https://github.com/NixOS/nixpkgs/pull/544340.diff";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
nixpkgs-patch-filetote = {
|
||||||
|
url = "https://github.com/NixOS/nixpkgs/pull/543082.diff";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
@@ -12,13 +21,17 @@
|
|||||||
self,
|
self,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
home-manager,
|
home-manager,
|
||||||
}:
|
nixpkgs-patch-slskd,
|
||||||
|
nixpkgs-patch-filetote,
|
||||||
|
nixpkgs-patcher
|
||||||
|
}@inputs:
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixosConfigurations.nixos-music = nixpkgs.lib.nixosSystem {
|
nixosConfigurations.nixos-music = nixpkgs-patcher.lib.nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
|
specialArgs = inputs;
|
||||||
modules = [
|
modules = [
|
||||||
./configuration.nix
|
./configuration.nix
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
{ pkgs, ...}:
|
||||||
|
{
|
||||||
|
programs.beets.enable = true;
|
||||||
|
|
||||||
|
# programs.beets.package = pkgs.beets.override {
|
||||||
|
# pluginOverrides = {
|
||||||
|
# filetote = {
|
||||||
|
# enable = true;
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
|
||||||
|
programs.beets.settings = {
|
||||||
|
directory = "/home/user/Music/Tracks";
|
||||||
|
|
||||||
|
plugins = [ "fetchart" "badfiles" "edit" "fish" "hook" ];
|
||||||
|
|
||||||
|
import = {
|
||||||
|
copy = false;
|
||||||
|
move = true;
|
||||||
|
autotag = false;
|
||||||
|
write = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
paths = {
|
||||||
|
default = "$albumartist/$album/$track. $artist - $title";
|
||||||
|
};
|
||||||
|
|
||||||
|
fetchart = {
|
||||||
|
auto = true;
|
||||||
|
sources = [ "filesystem" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
badfiles = {
|
||||||
|
check_on_import = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
hook = {
|
||||||
|
hooks = [
|
||||||
|
{
|
||||||
|
event = "item_imported";
|
||||||
|
command = "echo test";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,5 +1,9 @@
|
|||||||
{pkgs, ... }:
|
{pkgs, ... }:
|
||||||
{
|
{
|
||||||
|
imports = [
|
||||||
|
./beets.nix
|
||||||
|
];
|
||||||
|
|
||||||
home.username = "user";
|
home.username = "user";
|
||||||
home.homeDirectory = "/home/user";
|
home.homeDirectory = "/home/user";
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
|
{lib, ...}:
|
||||||
|
|
||||||
{
|
{
|
||||||
services.navidrome = {
|
services.navidrome = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
user = "user";
|
||||||
settings = {
|
settings = {
|
||||||
MusicFolder = "/media/music";
|
MusicFolder = "/home/user/Music";
|
||||||
PlaylistsPath = "Playlists";
|
PlaylistsPath = "Playlists";
|
||||||
Address = "0.0.0.0";
|
Address = "0.0.0.0";
|
||||||
ScanSchedule = "@every 24h";
|
ScanSchedule = "@every 24h";
|
||||||
@@ -10,4 +13,8 @@
|
|||||||
Scanner.PurgeMissing = "always";
|
Scanner.PurgeMissing = "always";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.services.navidrome.serviceConfig = {
|
||||||
|
ProtectHome = lib.mkForce false;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
services.samba = {
|
||||||
|
enable = true;
|
||||||
|
openFirewall = true;
|
||||||
|
settings = {
|
||||||
|
global = {
|
||||||
|
"workgroup" = "WORKGROUP";
|
||||||
|
"server string" = "smbnix";
|
||||||
|
"security" = "user";
|
||||||
|
"interfaces" = "lo eno1 tailscale0";
|
||||||
|
"hosts allow" = "192.168.132.0/24 100.64.0.0/10 127.0.0.1 localhost";
|
||||||
|
"hosts deny" = "0.0.0.0/0";
|
||||||
|
"guest account" = "nobody";
|
||||||
|
};
|
||||||
|
"Music" = {
|
||||||
|
"path" = "/media/music";
|
||||||
|
"browseable" = "yes";
|
||||||
|
"read only" = "no";
|
||||||
|
"guest ok" = "no";
|
||||||
|
"valid users" = "user";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
+4
-1
@@ -14,7 +14,10 @@
|
|||||||
nodejs
|
nodejs
|
||||||
gomi
|
gomi
|
||||||
slskd
|
slskd
|
||||||
sops
|
bun
|
||||||
|
croc
|
||||||
|
mp3val
|
||||||
|
flac
|
||||||
(python314.withPackages(ps: with ps; [ requests python-dotenv ]))
|
(python314.withPackages(ps: with ps; [ requests python-dotenv ]))
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user