diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..f340798 --- /dev/null +++ b/flake.lock @@ -0,0 +1,107 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1676283394, + "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073", + "type": "github" + }, + "original": { + "id": "flake-utils", + "type": "indirect" + } + }, + "flake-utils_2": { + "locked": { + "lastModified": 1642700792, + "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "846b2ae0fc4cc943637d3d1def4454213e203cba", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "mach-nix": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs", + "pypi-deps-db": "pypi-deps-db" + }, + "locked": { + "lastModified": 1654084003, + "narHash": "sha256-j/XrVVistvM+Ua+0tNFvO5z83isL+LBgmBi9XppxuKA=", + "owner": "DavHau", + "repo": "mach-nix", + "rev": "7e14360bde07dcae32e5e24f366c83272f52923f", + "type": "github" + }, + "original": { + "id": "mach-nix", + "ref": "3.5.0", + "type": "indirect" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1643805626, + "narHash": "sha256-AXLDVMG+UaAGsGSpOtQHPIKB+IZ0KSd9WS77aanGzgc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "554d2d8aa25b6e583575459c297ec23750adb6cb", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1678298120, + "narHash": "sha256-iaV5xqgn29xy765Js3EoZePQyZIlLZA3pTYtTnKkejg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1e383aada51b416c6c27d4884d2e258df201bc11", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "pypi-deps-db": { + "flake": false, + "locked": { + "lastModified": 1643877077, + "narHash": "sha256-jv8pIvRFTP919GybOxXE5TfOkrjTbdo9QiCO1TD3ZaY=", + "owner": "DavHau", + "repo": "pypi-deps-db", + "rev": "da53397f0b782b0b18deb72ef8e0fb5aa7c98aa3", + "type": "github" + }, + "original": { + "owner": "DavHau", + "repo": "pypi-deps-db", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "mach-nix": "mach-nix", + "nixpkgs": "nixpkgs_2" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..714360d --- /dev/null +++ b/flake.nix @@ -0,0 +1,36 @@ +{ + description = "Dvd ripper and transcoder"; + + inputs.nixpkgs.url = "github:NixOS/nixpkgs"; + inputs.flake-utils.url = "github:numtide/flake-utils"; + inputs.mach-nix.url = "github:mach-nix/3.5.0"; + + outputs = { self, nixpkgs, flake-utils, mach-nix }: + flake-utils.lib.eachSystem [ "x86_64-linux" ] (system: + let pkgs = nixpkgs.legacyPackages.${system}; + in { + devShells.default = pkgs.mkShell { + packages = with pkgs; [ + # Manage dependencies via requirements.txt file + # !! Did not work for playsound, since gst-python no python package?? + # (mach-nix.lib.${system}.mkPython { + # requirements = builtins.readFile ./requirements.txt; + # }) + + # Python dependencies + (python3.withPackages + (p: with p; [ gst-python pygobject3 playsound python-dotenv ])) + + # Playsound dependencies + gobject-introspection + gst_all_1.gst-devtools + + # Script dependencies + dvdbackup + handbrake + rsync + libnotify + ]; + }; + }); +} diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..1953c75 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +# playsound +# pygobject # dependency of playsound +python-dotenv diff --git a/ripper/requirements.txt b/ripper/requirements.txt deleted file mode 100644 index 39bee82..0000000 --- a/ripper/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -playsound==1.3.0 -python-dotenv==1.0 diff --git a/ripper/rip_dvd.py b/ripper/rip_dvd.py index c901117..b00076f 100755 --- a/ripper/rip_dvd.py +++ b/ripper/rip_dvd.py @@ -43,9 +43,9 @@ def main(): success = rip_to_tmp_dir(args) program_execution_time_str = get_program_execution_time_str(program_start_time) if success: + mv_ripped_from_tmp_to_ripped_dir(args) write_to_logfile(args, "Success") notify_ripping_success(args, program_execution_time_str) - mv_ripped_from_tmp_to_ripped_dir(args) else: write_to_logfile(args, "FAILURE") notify_ripping_error(args, program_execution_time_str) diff --git a/transcoder/requirements.txt b/transcoder/requirements.txt deleted file mode 100644 index 3e75cf5..0000000 --- a/transcoder/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -python-dotenv==1.0