Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e552d657c3fc
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4c84556d6bd4
Choose a head ref
  • 3 commits
  • 5 files changed
  • 2 contributors

Commits on Nov 6, 2020

  1. Verified

    This commit was signed with the committer’s verified signature.
    prusnak Pavol Rusnak
    Copy the full SHA
    65d60c1 View commit details
  2. Verified

    This commit was signed with the committer’s verified signature.
    prusnak Pavol Rusnak
    Copy the full SHA
    efa1a8b View commit details
  3. Copy the full SHA
    4c84556 View commit details
61 changes: 61 additions & 0 deletions pkgs/applications/misc/pass-secret-service/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{ stdenv, fetchFromGitHub, python3, dbus, gnupg }:

python3.pkgs.buildPythonApplication rec {
pname = "pass-secret-service";
# PyPI has old alpha version. Since then the project has switched from using a
# seemingly abandoned D-Bus package pydbus and started using maintained
# dbus-next. So let's use latest from GitHub.
version = "unstable-2020-04-12";

src = fetchFromGitHub {
owner = "mdellweg";
repo = "pass_secret_service";
rev = "f6fbca6ac3ccd16bfec407d845ed9257adf74dfa";
sha256 = "0rm4pbx1fiwds1v7f99khhh7x3inv9yniclwd95mrbgljk3cc6a4";
};


# Need to specify session.conf file for tests because it won't be found under
# /etc/ in check phase.
postPatch = ''
substituteInPlace Makefile \
--replace \
"dbus-run-session" \
"dbus-run-session --config-file=${dbus}/share/dbus-1/session.conf"
'';

propagatedBuildInputs = with python3.pkgs; [
click
cryptography
dbus-next
decorator
pypass
secretstorage
];

checkInputs =
let
ps = python3.pkgs;
in
[
dbus
gnupg
ps.pytest
ps.pytest-asyncio
ps.pypass
];

checkPhase = ''
runHook preCheck
make test
runHook postCheck
'';

meta = {
description = "Libsecret D-Bus API with pass as the backend";
homepage = "https://github.com/mdellweg/pass_secret_service/";
license = stdenv.lib.licenses.gpl3Only;
platforms = stdenv.lib.platforms.all;
maintainers = with stdenv.lib.maintainers; [ jluttine ];
};
}
84 changes: 84 additions & 0 deletions pkgs/development/python-modules/pypass/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{ buildPythonPackage
, click
, colorama
, enum34
, fetchPypi
, git
, gnugrep
, gnupg
, nose
, pbr
, pexpect
, pythonAtLeast
, pythonOlder
, stdenv
, substituteAll
, tree
, xclip
}:

# NOTE: pypass can also be used as an application, but probably the most
# important usecase is as a library. So, let's use buildPythonPackage and
# support any Python version instead of defining it as an application with
# buildPythonApplication.
buildPythonPackage rec {
pname = "pypass";
version = "0.2.1";

src = fetchPypi {
inherit pname version;
sha256 = "1nm4mj7pd7gz4ghic6b3wrnd1b59hd1f0axavdabfl79wy511l7r";
};

# Set absolute nix store paths to the executables that pypass uses
patches = [
(substituteAll {
src = ./mark-executables.patch;
git_exec = "${git}/bin/git";
grep_exec = "${gnugrep}/bin/grep";
gpg_exec = "${gnupg}/bin/gpg2";
tree_exec = "${tree}/bin/tree";
xclip_exec = "${xclip}/bin/xclip";
})
];

# Remove enum34 requirement if Python >= 3.4
postPatch = stdenv.lib.optionalString (pythonAtLeast "3.4") ''
substituteInPlace requirements.txt --replace "enum34" ""
'';

nativeBuildInputs = [ pbr ];

propagatedBuildInputs = [
click
colorama
pexpect
] ++ stdenv.lib.optional (pythonOlder "3.4") enum34;

checkInputs = [ nose ];

# Configuration so that the tests work
preCheck = ''
HOME=$TEMP ${git}/bin/git config --global user.email "nix-builder@nixos.org"
HOME=$TEMP ${git}/bin/git config --global user.name "Nix Builder"
HOME=$TEMP ${git}/bin/git config --global pull.ff only
HOME=$TEMP make setup_gpg
'';

# Run tests but exclude the test that uses clipboard as I wasn't able to make
# it work - probably the X clipboard just doesn't work in the build
# environment..
checkPhase = ''
runHook preCheck
HOME=$TEMP GNUPGHOME=pypass/tests/gnupg nosetests -v --exclude=test_show_clip .
runHook postCheck
'';

meta = {
description = "Password manager pass in Python";
homepage = "https://github.com/aviau/python-pass";
license = stdenv.lib.licenses.gpl3Plus;
platforms = stdenv.lib.platforms.all;
maintainers = with stdenv.lib.maintainers; [ jluttine ];
};
}
Loading