Compare commits
2 Commits
master
...
ff2f0e8bcc
Author | SHA1 | Date | |
---|---|---|---|
ff2f0e8bcc
|
|||
2901474d10
|
@ -1,5 +1,7 @@
|
|||||||
{ config, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
let streamrip = pkgs.callPackage ../../pkgs/streamrip/package.nix { };
|
||||||
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
@ -49,6 +51,10 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = [
|
||||||
|
streamrip
|
||||||
|
];
|
||||||
|
|
||||||
modules = {
|
modules = {
|
||||||
desktop = {
|
desktop = {
|
||||||
apps.qbittorrent.enable = true;
|
apps.qbittorrent.enable = true;
|
||||||
|
@ -6,6 +6,25 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
|
kernelPackages = let
|
||||||
|
version = "6.6.51";
|
||||||
|
tag = "stable_20241008";
|
||||||
|
srcHash = "sha256-phCxkuO+jUGZkfzSrBq6yErQeO2Td+inIGHxctXbD5U=";
|
||||||
|
in pkgs.linuxPackagesFor (pkgs.linux_rpi4.override {
|
||||||
|
argsOverride = {
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "raspberrypi";
|
||||||
|
repo = "linux";
|
||||||
|
rev = tag;
|
||||||
|
hash = srcHash;
|
||||||
|
};
|
||||||
|
version = version;
|
||||||
|
modDirVersion = version;
|
||||||
|
structuredExtraConfig = {};
|
||||||
|
kernelPatches = [];
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
# Stop ZFS kernel being built
|
# Stop ZFS kernel being built
|
||||||
supportedFilesystems = lib.mkForce [ "btrfs" "cifs" "f2fs" "jfs" "ntfs" "reiserfs" "vfat" "xfs" ];
|
supportedFilesystems = lib.mkForce [ "btrfs" "cifs" "f2fs" "jfs" "ntfs" "reiserfs" "vfat" "xfs" ];
|
||||||
tmp.cleanOnBoot = true;
|
tmp.cleanOnBoot = true;
|
||||||
@ -14,9 +33,24 @@
|
|||||||
# Fix missing modules
|
# Fix missing modules
|
||||||
# https://github.com/NixOS/nixpkgs/issues/154163
|
# https://github.com/NixOS/nixpkgs/issues/154163
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
(final: super: {
|
(final: prev: {
|
||||||
makeModulesClosure = x:
|
makeModulesClosure = x:
|
||||||
super.makeModulesClosure (x // { allowMissing = true; });
|
prev.makeModulesClosure (x // { allowMissing = true; });
|
||||||
|
})
|
||||||
|
(final: prev: {
|
||||||
|
raspberrypifw = let
|
||||||
|
version = "1.20241008";
|
||||||
|
srcHash = "sha256-4gnK0KbqFnjBmWia9Jt2gveVWftmHrprpwBqYVqE/k0=";
|
||||||
|
in pkgs.blah.override {
|
||||||
|
argsOverride = {
|
||||||
|
src = prev.fetchFromGitHub {
|
||||||
|
owner = "raspberrypi";
|
||||||
|
repo = "firmware";
|
||||||
|
rev = "${version}";
|
||||||
|
hash = srcHash;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -0,0 +1,26 @@
|
|||||||
|
From 18efb9b5c8e562b169425f6ba79977e52e8b91b9 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pavel Sobolev <paveloomm@gmail.com>
|
||||||
|
Date: Sat, 13 Jan 2024 12:49:45 +0000
|
||||||
|
Subject: [PATCH] Ensure the default config file is writable.
|
||||||
|
|
||||||
|
---
|
||||||
|
streamrip/config.py | 3 +++
|
||||||
|
1 file changed, 3 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/streamrip/config.py b/streamrip/config.py
|
||||||
|
index 7ee2f57..88a5fef 100644
|
||||||
|
--- a/streamrip/config.py
|
||||||
|
+++ b/streamrip/config.py
|
||||||
|
@@ -378,6 +378,9 @@ def set_user_defaults(path: str, /):
|
||||||
|
"""Update the TOML file at the path with user-specific default values."""
|
||||||
|
shutil.copy(BLANK_CONFIG_PATH, path)
|
||||||
|
|
||||||
|
+ # Ensure the default config file is writable
|
||||||
|
+ os.chmod(path, 0o644)
|
||||||
|
+
|
||||||
|
with open(path) as f:
|
||||||
|
toml = parse(f.read())
|
||||||
|
toml["downloads"]["folder"] = DEFAULT_DOWNLOADS_FOLDER # type: ignore
|
||||||
|
--
|
||||||
|
2.42.0
|
||||||
|
|
78
pkgs/streamrip/package.nix
Normal file
78
pkgs/streamrip/package.nix
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
{ lib
|
||||||
|
, python3Packages
|
||||||
|
, fetchFromGitHub
|
||||||
|
|
||||||
|
, ffmpeg
|
||||||
|
}:
|
||||||
|
|
||||||
|
python3Packages.buildPythonApplication {
|
||||||
|
pname = "streamrip";
|
||||||
|
version = "2.0.7";
|
||||||
|
pyproject = true;
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "nathom";
|
||||||
|
repo = "streamrip";
|
||||||
|
rev = "46b570dbb6f81d604cbaa3bfa379463e0a20a841";
|
||||||
|
hash = "sha256-LD99OjguaBnrQxCwmCeHvmBMq5aOfobwnMd5/aCRZW8=";
|
||||||
|
};
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
./ensure-the-default-config-file-is-writable.patch
|
||||||
|
];
|
||||||
|
|
||||||
|
nativeBuildInputs = with python3Packages; [
|
||||||
|
poetry-core
|
||||||
|
];
|
||||||
|
|
||||||
|
propagatedBuildInputs = with python3Packages; [
|
||||||
|
aiodns
|
||||||
|
aiofiles
|
||||||
|
aiohttp
|
||||||
|
aiolimiter
|
||||||
|
appdirs
|
||||||
|
cleo
|
||||||
|
click-help-colors
|
||||||
|
deezer-py
|
||||||
|
m3u8
|
||||||
|
mutagen
|
||||||
|
pathvalidate
|
||||||
|
pillow
|
||||||
|
pycryptodomex
|
||||||
|
pytest-asyncio
|
||||||
|
pytest-mock
|
||||||
|
rich
|
||||||
|
simple-term-menu
|
||||||
|
tomlkit
|
||||||
|
tqdm
|
||||||
|
];
|
||||||
|
|
||||||
|
nativeCheckInputs = with python3Packages; [
|
||||||
|
pytestCheckHook
|
||||||
|
];
|
||||||
|
|
||||||
|
prePatch = ''
|
||||||
|
sed -i 's#aiofiles = ".*"#aiofiles = "*"#' pyproject.toml
|
||||||
|
sed -i 's#deezer-py = ".*"#deezer-py = "*"#' pyproject.toml
|
||||||
|
sed -i 's#m3u8 = ".*"#m3u8 = "*"#' pyproject.toml
|
||||||
|
sed -i 's#pathvalidate = ".*"#pathvalidate = "*"#' pyproject.toml
|
||||||
|
sed -i 's#Pillow = ".*"#Pillow = "*"#' pyproject.toml
|
||||||
|
sed -i 's#pytest-asyncio = ".*"#pytest-asyncio = "*"#' pyproject.toml
|
||||||
|
sed -i 's#tomlkit = ".*"#tomlkit = "*"#' pyproject.toml
|
||||||
|
|
||||||
|
sed -i 's#"ffmpeg"#"${lib.getBin ffmpeg}/bin/ffmpeg"#g' streamrip/client/downloadable.py
|
||||||
|
'';
|
||||||
|
|
||||||
|
preCheck = ''
|
||||||
|
export HOME=$(mktemp -d)
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "Scriptable music downloader for Qobuz, Tidal, SoundCloud, and Deezer";
|
||||||
|
homepage = "https://github.com/nathom/streamrip";
|
||||||
|
license = licenses.gpl3Only;
|
||||||
|
maintainers = with maintainers; [ paveloom ];
|
||||||
|
mainProgram = "rip";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
Reference in New Issue
Block a user