sane-scripts: split sane-lib-bt into an actual, nix-level library
a bit less hacky, i think
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
{ lib
|
{ lib
|
||||||
, pkgs
|
, python3Packages
|
||||||
, static-nix-shell
|
, static-nix-shell
|
||||||
, symlinkJoin
|
, symlinkJoin
|
||||||
}:
|
}:
|
||||||
@@ -13,6 +13,19 @@ let
|
|||||||
cp -R lib/* $out/bin/lib/
|
cp -R lib/* $out/bin/lib/
|
||||||
'';
|
'';
|
||||||
});
|
});
|
||||||
|
|
||||||
|
sane-lib = {
|
||||||
|
bt = python3Packages.buildPythonPackage {
|
||||||
|
pname = "sane-lib-bt";
|
||||||
|
version = "0.1.0";
|
||||||
|
format = "setuptools";
|
||||||
|
src = ./src/lib/bt;
|
||||||
|
pythonImportChecks = [
|
||||||
|
"sane_bt"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
nix-shell-scripts = {
|
nix-shell-scripts = {
|
||||||
# anything added to this attrset gets symlink-joined into `sane-scripts`
|
# anything added to this attrset gets symlink-joined into `sane-scripts`
|
||||||
# and is made available through `sane-scripts.passthru`
|
# and is made available through `sane-scripts.passthru`
|
||||||
@@ -26,15 +39,17 @@ let
|
|||||||
src = ./src;
|
src = ./src;
|
||||||
pkgs = [ "duplicity" ];
|
pkgs = [ "duplicity" ];
|
||||||
};
|
};
|
||||||
bt-add = pythonWithLib {
|
bt-add = static-nix-shell.mkPython3Bin {
|
||||||
pname = "sane-bt-add";
|
pname = "sane-bt-add";
|
||||||
src = ./src;
|
src = ./src;
|
||||||
pkgs = [ "transmission" ];
|
pkgs = [ "transmission" ];
|
||||||
|
pyPkgs = [ "sane-lib.bt" ];
|
||||||
};
|
};
|
||||||
bt-rm = pythonWithLib {
|
bt-rm = pythonWithLib {
|
||||||
pname = "sane-bt-rm";
|
pname = "sane-bt-rm";
|
||||||
src = ./src;
|
src = ./src;
|
||||||
pkgs = [ "transmission" ];
|
pkgs = [ "transmission" ];
|
||||||
|
pyPkgs = [ "sane-lib.bt" ];
|
||||||
};
|
};
|
||||||
bt-search = static-nix-shell.mkPython3Bin {
|
bt-search = static-nix-shell.mkPython3Bin {
|
||||||
pname = "sane-bt-search";
|
pname = "sane-bt-search";
|
||||||
@@ -215,7 +230,9 @@ in
|
|||||||
symlinkJoin {
|
symlinkJoin {
|
||||||
name = "sane-scripts";
|
name = "sane-scripts";
|
||||||
paths = lib.attrValues nix-shell-scripts;
|
paths = lib.attrValues nix-shell-scripts;
|
||||||
passthru = nix-shell-scripts;
|
passthru = nix-shell-scripts // {
|
||||||
|
lib = sane-lib;
|
||||||
|
};
|
||||||
meta = {
|
meta = {
|
||||||
description = "collection of scripts associated with sane systems";
|
description = "collection of scripts associated with sane systems";
|
||||||
homepage = "https://git.uninsane.org";
|
homepage = "https://git.uninsane.org";
|
||||||
|
9
pkgs/additional/sane-scripts/src/lib/bt/setup.py
Normal file
9
pkgs/additional/sane-scripts/src/lib/bt/setup.py
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
from distutils.core import setup
|
||||||
|
|
||||||
|
setup(
|
||||||
|
name='sane-lib-bt',
|
||||||
|
version='0.1.0',
|
||||||
|
description='utilities for sane-scripts',
|
||||||
|
)
|
@@ -1,13 +1,10 @@
|
|||||||
#!/usr/bin/env nix-shell
|
#!/usr/bin/env nix-shell
|
||||||
#!nix-shell -i python3 -p "python3.withPackages (ps: [ ])" -p transmission
|
#!nix-shell -i python3 -p "python3.withPackages (ps: [ ps.sane-lib.bt ])" -p transmission
|
||||||
# vim: set filetype=python :
|
# vim: set filetype=python :
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import sys
|
|
||||||
|
|
||||||
sys.path.insert(0, ".") # to import `lib`
|
from sane_bt import MediaMeta, TransmissionApi
|
||||||
|
|
||||||
from lib.sane_torrent import MediaMeta, TransmissionApi
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@@ -1,15 +1,12 @@
|
|||||||
#!/usr/bin/env nix-shell
|
#!/usr/bin/env nix-shell
|
||||||
#!nix-shell -i python3 -p "python3.withPackages (ps: [ ])" -p transmission
|
#!nix-shell -i python3 -p "python3.withPackages (ps: [ ps.sane-lib.bt ])" -p transmission
|
||||||
# vim: set filetype=python :
|
# vim: set filetype=python :
|
||||||
|
|
||||||
# removes a torrent and trashes its data
|
# removes a torrent and trashes its data
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import sys
|
|
||||||
|
|
||||||
sys.path.insert(0, ".") # to import `lib`
|
from sane_bt import TransmissionApi
|
||||||
|
|
||||||
from lib.sane_torrent import TransmissionApi
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
{ callPackage }:
|
{ callPackage }:
|
||||||
{
|
{
|
||||||
feedsearch-crawler = callPackage ./feedsearch-crawler { };
|
feedsearch-crawler = callPackage ./feedsearch-crawler { };
|
||||||
|
sane-lib = (callPackage ../additional/sane-scripts { }).lib;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user