diff options
Diffstat (limited to 'modules/borgcopy')
| -rw-r--r-- | modules/borgcopy/copy/setup.py | 10 | ||||
| -rwxr-xr-x | modules/borgcopy/copy_borg/__main__.py (renamed from modules/borgcopy/copy/copy_borg/__main__.py) | 0 | ||||
| -rw-r--r-- | modules/borgcopy/default.nix | 40 | ||||
| -rw-r--r-- | modules/borgcopy/poetry.lock | 180 | ||||
| -rw-r--r-- | modules/borgcopy/pyproject.toml | 22 |
5 files changed, 217 insertions, 35 deletions
diff --git a/modules/borgcopy/copy/setup.py b/modules/borgcopy/copy/setup.py deleted file mode 100644 index f77d9560..00000000 --- a/modules/borgcopy/copy/setup.py +++ /dev/null | |||
| @@ -1,10 +0,0 @@ | |||
| 1 | from setuptools import setup | ||
| 2 | |||
| 3 | setup(name='copy_borg', | ||
| 4 | packages=['copy_borg'], | ||
| 5 | entry_points={ | ||
| 6 | 'console_scripts': [ | ||
| 7 | 'copy_borg=copy_borg.__main__:main', | ||
| 8 | ], | ||
| 9 | } | ||
| 10 | ) | ||
diff --git a/modules/borgcopy/copy/copy_borg/__main__.py b/modules/borgcopy/copy_borg/__main__.py index 09f7557a..09f7557a 100755 --- a/modules/borgcopy/copy/copy_borg/__main__.py +++ b/modules/borgcopy/copy_borg/__main__.py | |||
diff --git a/modules/borgcopy/default.nix b/modules/borgcopy/default.nix index eae07dc8..afc6c37b 100644 --- a/modules/borgcopy/default.nix +++ b/modules/borgcopy/default.nix | |||
| @@ -3,33 +3,23 @@ | |||
| 3 | with lib; | 3 | with lib; |
| 4 | 4 | ||
| 5 | let | 5 | let |
| 6 | copyBorg = flakeInputs.mach-nix.lib.${config.nixpkgs.system}.buildPythonPackage rec { | 6 | copyBorg = |
| 7 | pname = "copy-borg"; | 7 | with pkgs.poetry2nix; |
| 8 | src = ./copy; | 8 | mkPoetryApplication { |
| 9 | version = "0.0.0"; | 9 | projectDir = cleanPythonSources { src = ./.; }; |
| 10 | ignoreDataOutdated = true; | ||
| 11 | 10 | ||
| 12 | requirements = '' | 11 | overrides = overrides.withDefaults (self: super: { |
| 13 | humanize | 12 | pyprctl = super.pyprctl.overridePythonAttrs (oldAttrs: { |
| 14 | tqdm | 13 | buildInputs = (oldAttrs.buildInputs or []) ++ [super.setuptools]; |
| 15 | python-dateutil | 14 | }); |
| 16 | xdg | 15 | inherit (pkgs.python3Packages) python-unshare; |
| 17 | python-unshare | 16 | }); |
| 18 | pyprctl | ||
| 19 | halo | ||
| 20 | ''; | ||
| 21 | postInstall = '' | ||
| 22 | wrapProgram $out/bin/copy_borg \ | ||
| 23 | --prefix PATH : ${makeBinPath (with pkgs; [util-linux borgbackup])}:${config.security.wrapperDir} | ||
| 24 | ''; | ||
| 25 | |||
| 26 | providers.python-unshare = "nixpkgs"; | ||
| 27 | overridesPre = [ | ||
| 28 | (self: super: { python-unshare = super.python-unshare.overrideAttrs (oldAttrs: { name = "python-unshare-0.2.1"; version = "0.2.1"; }); }) | ||
| 29 | ]; | ||
| 30 | 17 | ||
| 31 | # _.tomli.buildInputs.add = with pkgs."python3Packages"; [ flit-core ]; | 18 | postInstall = '' |
| 32 | }; | 19 | wrapProgram $out/bin/copy_borg \ |
| 20 | --prefix PATH : ${makeBinPath (with pkgs; [util-linux borgbackup])}:${config.security.wrapperDir} | ||
| 21 | ''; | ||
| 22 | }; | ||
| 33 | 23 | ||
| 34 | copyService = name: opts: nameValuePair "copy-borg@${utils.escapeSystemdPath name}" { | 24 | copyService = name: opts: nameValuePair "copy-borg@${utils.escapeSystemdPath name}" { |
| 35 | serviceConfig = { | 25 | serviceConfig = { |
diff --git a/modules/borgcopy/poetry.lock b/modules/borgcopy/poetry.lock new file mode 100644 index 00000000..759ecfe9 --- /dev/null +++ b/modules/borgcopy/poetry.lock | |||
| @@ -0,0 +1,180 @@ | |||
| 1 | # This file is automatically @generated by Poetry 1.4.2 and should not be changed by hand. | ||
| 2 | |||
| 3 | [[package]] | ||
| 4 | name = "colorama" | ||
| 5 | version = "0.4.6" | ||
| 6 | description = "Cross-platform colored terminal text." | ||
| 7 | category = "main" | ||
| 8 | optional = false | ||
| 9 | python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" | ||
| 10 | files = [ | ||
| 11 | {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, | ||
| 12 | {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, | ||
| 13 | ] | ||
| 14 | |||
| 15 | [[package]] | ||
| 16 | name = "halo" | ||
| 17 | version = "0.0.31" | ||
| 18 | description = "Beautiful terminal spinners in Python" | ||
| 19 | category = "main" | ||
| 20 | optional = false | ||
| 21 | python-versions = ">=3.4" | ||
| 22 | files = [ | ||
| 23 | {file = "halo-0.0.31-py2-none-any.whl", hash = "sha256:5350488fb7d2aa7c31a1344120cee67a872901ce8858f60da7946cef96c208ab"}, | ||
| 24 | {file = "halo-0.0.31.tar.gz", hash = "sha256:7b67a3521ee91d53b7152d4ee3452811e1d2a6321975137762eb3d70063cc9d6"}, | ||
| 25 | ] | ||
| 26 | |||
| 27 | [package.dependencies] | ||
| 28 | colorama = ">=0.3.9" | ||
| 29 | log-symbols = ">=0.0.14" | ||
| 30 | six = ">=1.12.0" | ||
| 31 | spinners = ">=0.0.24" | ||
| 32 | termcolor = ">=1.1.0" | ||
| 33 | |||
| 34 | [package.extras] | ||
| 35 | ipython = ["IPython (==5.7.0)", "ipywidgets (==7.1.0)"] | ||
| 36 | |||
| 37 | [[package]] | ||
| 38 | name = "humanize" | ||
| 39 | version = "4.6.0" | ||
| 40 | description = "Python humanize utilities" | ||
| 41 | category = "main" | ||
| 42 | optional = false | ||
| 43 | python-versions = ">=3.7" | ||
| 44 | files = [ | ||
| 45 | {file = "humanize-4.6.0-py3-none-any.whl", hash = "sha256:401201aca462749773f02920139f302450cb548b70489b9b4b92be39fe3c3c50"}, | ||
| 46 | {file = "humanize-4.6.0.tar.gz", hash = "sha256:5f1f22bc65911eb1a6ffe7659bd6598e33dcfeeb904eb16ee1e705a09bf75916"}, | ||
| 47 | ] | ||
| 48 | |||
| 49 | [package.extras] | ||
| 50 | tests = ["freezegun", "pytest", "pytest-cov"] | ||
| 51 | |||
| 52 | [[package]] | ||
| 53 | name = "log-symbols" | ||
| 54 | version = "0.0.14" | ||
| 55 | description = "Colored symbols for various log levels for Python" | ||
| 56 | category = "main" | ||
| 57 | optional = false | ||
| 58 | python-versions = "*" | ||
| 59 | files = [ | ||
| 60 | {file = "log_symbols-0.0.14-py3-none-any.whl", hash = "sha256:4952106ff8b605ab7d5081dd2c7e6ca7374584eff7086f499c06edd1ce56dcca"}, | ||
| 61 | {file = "log_symbols-0.0.14.tar.gz", hash = "sha256:cf0bbc6fe1a8e53f0d174a716bc625c4f87043cc21eb55dd8a740cfe22680556"}, | ||
| 62 | ] | ||
| 63 | |||
| 64 | [package.dependencies] | ||
| 65 | colorama = ">=0.3.9" | ||
| 66 | |||
| 67 | [[package]] | ||
| 68 | name = "pyprctl" | ||
| 69 | version = "0.1.3" | ||
| 70 | description = "An interface to Linux's prctl() syscall written in pure Python using ctypes." | ||
| 71 | category = "main" | ||
| 72 | optional = false | ||
| 73 | python-versions = ">=3.6" | ||
| 74 | files = [ | ||
| 75 | {file = "pyprctl-0.1.3-py3-none-any.whl", hash = "sha256:6302e5114f078fb33e5799835d0a69e2fc180bb6b28ad073515fa40c5272f1dd"}, | ||
| 76 | {file = "pyprctl-0.1.3.tar.gz", hash = "sha256:1fb54d3ab030ec02e4afc38fb9662d6634c12834e91ae7959de56a9c09f69c26"}, | ||
| 77 | ] | ||
| 78 | |||
| 79 | [[package]] | ||
| 80 | name = "python-dateutil" | ||
| 81 | version = "2.8.2" | ||
| 82 | description = "Extensions to the standard Python datetime module" | ||
| 83 | category = "main" | ||
| 84 | optional = false | ||
| 85 | python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" | ||
| 86 | files = [ | ||
| 87 | {file = "python-dateutil-2.8.2.tar.gz", hash = "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"}, | ||
| 88 | {file = "python_dateutil-2.8.2-py2.py3-none-any.whl", hash = "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9"}, | ||
| 89 | ] | ||
| 90 | |||
| 91 | [package.dependencies] | ||
| 92 | six = ">=1.5" | ||
| 93 | |||
| 94 | [[package]] | ||
| 95 | name = "python-unshare" | ||
| 96 | version = "0.2" | ||
| 97 | description = "Python bindings for the Linux unshare() syscall" | ||
| 98 | category = "main" | ||
| 99 | optional = false | ||
| 100 | python-versions = "*" | ||
| 101 | files = [ | ||
| 102 | {file = "python-unshare-0.2.tar.gz", hash = "sha256:f79b7de441b6c27930b775085a6a4fd2f378b628737aaaebc2a6c519023fd47a"}, | ||
| 103 | ] | ||
| 104 | |||
| 105 | [[package]] | ||
| 106 | name = "six" | ||
| 107 | version = "1.16.0" | ||
| 108 | description = "Python 2 and 3 compatibility utilities" | ||
| 109 | category = "main" | ||
| 110 | optional = false | ||
| 111 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" | ||
| 112 | files = [ | ||
| 113 | {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, | ||
| 114 | {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, | ||
| 115 | ] | ||
| 116 | |||
| 117 | [[package]] | ||
| 118 | name = "spinners" | ||
| 119 | version = "0.0.24" | ||
| 120 | description = "Spinners for terminals" | ||
| 121 | category = "main" | ||
| 122 | optional = false | ||
| 123 | python-versions = "*" | ||
| 124 | files = [ | ||
| 125 | {file = "spinners-0.0.24-py3-none-any.whl", hash = "sha256:2fa30d0b72c9650ad12bbe031c9943b8d441e41b4f5602b0ec977a19f3290e98"}, | ||
| 126 | {file = "spinners-0.0.24.tar.gz", hash = "sha256:1eb6aeb4781d72ab42ed8a01dcf20f3002bf50740d7154d12fb8c9769bf9e27f"}, | ||
| 127 | ] | ||
| 128 | |||
| 129 | [[package]] | ||
| 130 | name = "termcolor" | ||
| 131 | version = "2.2.0" | ||
| 132 | description = "ANSI color formatting for output in terminal" | ||
| 133 | category = "main" | ||
| 134 | optional = false | ||
| 135 | python-versions = ">=3.7" | ||
| 136 | files = [ | ||
| 137 | {file = "termcolor-2.2.0-py3-none-any.whl", hash = "sha256:91ddd848e7251200eac969846cbae2dacd7d71c2871e92733289e7e3666f48e7"}, | ||
| 138 | {file = "termcolor-2.2.0.tar.gz", hash = "sha256:dfc8ac3f350788f23b2947b3e6cfa5a53b630b612e6cd8965a015a776020b99a"}, | ||
| 139 | ] | ||
| 140 | |||
| 141 | [package.extras] | ||
| 142 | tests = ["pytest", "pytest-cov"] | ||
| 143 | |||
| 144 | [[package]] | ||
| 145 | name = "tqdm" | ||
| 146 | version = "4.65.0" | ||
| 147 | description = "Fast, Extensible Progress Meter" | ||
| 148 | category = "main" | ||
| 149 | optional = false | ||
| 150 | python-versions = ">=3.7" | ||
| 151 | files = [ | ||
| 152 | {file = "tqdm-4.65.0-py3-none-any.whl", hash = "sha256:c4f53a17fe37e132815abceec022631be8ffe1b9381c2e6e30aa70edc99e9671"}, | ||
| 153 | {file = "tqdm-4.65.0.tar.gz", hash = "sha256:1871fb68a86b8fb3b59ca4cdd3dcccbc7e6d613eeed31f4c332531977b89beb5"}, | ||
| 154 | ] | ||
| 155 | |||
| 156 | [package.dependencies] | ||
| 157 | colorama = {version = "*", markers = "platform_system == \"Windows\""} | ||
| 158 | |||
| 159 | [package.extras] | ||
| 160 | dev = ["py-make (>=0.1.0)", "twine", "wheel"] | ||
| 161 | notebook = ["ipywidgets (>=6)"] | ||
| 162 | slack = ["slack-sdk"] | ||
| 163 | telegram = ["requests"] | ||
| 164 | |||
| 165 | [[package]] | ||
| 166 | name = "xdg" | ||
| 167 | version = "6.0.0" | ||
| 168 | description = "Variables defined by the XDG Base Directory Specification" | ||
| 169 | category = "main" | ||
| 170 | optional = false | ||
| 171 | python-versions = ">=3.7,<4.0" | ||
| 172 | files = [ | ||
| 173 | {file = "xdg-6.0.0-py3-none-any.whl", hash = "sha256:df3510755b4395157fc04fc3b02467c777f3b3ca383257397f09ab0d4c16f936"}, | ||
| 174 | {file = "xdg-6.0.0.tar.gz", hash = "sha256:24278094f2d45e846d1eb28a2ebb92d7b67fc0cab5249ee3ce88c95f649a1c92"}, | ||
| 175 | ] | ||
| 176 | |||
| 177 | [metadata] | ||
| 178 | lock-version = "2.0" | ||
| 179 | python-versions = ">=3.10.0,<3.12" | ||
| 180 | content-hash = "3c6b538852447a8f3ae34e1be122716d47e669a2b44f7c5d3d850e5d877353c7" | ||
diff --git a/modules/borgcopy/pyproject.toml b/modules/borgcopy/pyproject.toml new file mode 100644 index 00000000..f3401ed2 --- /dev/null +++ b/modules/borgcopy/pyproject.toml | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | [tool.poetry] | ||
| 2 | name = "copy_borg" | ||
| 3 | version = "0.0.0" | ||
| 4 | authors = ["Gregor Kleen <gkleen@yggdrasil.li>"] | ||
| 5 | description = "" | ||
| 6 | |||
| 7 | [tool.poetry.scripts] | ||
| 8 | copy_borg = "copy_borg.__main__:main" | ||
| 9 | |||
| 10 | [tool.poetry.dependencies] | ||
| 11 | python = ">=3.10.0,<3.12" | ||
| 12 | humanize = "^4.6.0" | ||
| 13 | tqdm = "^4.65.0" | ||
| 14 | python-dateutil = "^2.8.2" | ||
| 15 | xdg = "^6.0.0" | ||
| 16 | python-unshare = "^0.2" | ||
| 17 | pyprctl = "^0.1.3" | ||
| 18 | halo = "^0.0.31" | ||
| 19 | |||
| 20 | [build-system] | ||
| 21 | requires = ["poetry-core>=1.0.0"] | ||
| 22 | build-backend = "poetry.core.masonry.api" \ No newline at end of file | ||
