Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pywal: init at 2.0.5 #38443

Merged
merged 1 commit into from Apr 6, 2018
Merged

pywal: init at 2.0.5 #38443

merged 1 commit into from Apr 6, 2018

Conversation

Fresheyeball
Copy link

Motivation for this change

I wanted nixos to be prettier

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@Mic92 Mic92 changed the title pywal added pywal: init at 2.0.4 Apr 5, 2018
version = "2.0.4";
src = builtins.fetchTarball {
url = "https://github.com/dylanaraps/pywal/archive/${version}.tar.gz";
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use fetchFromGitHub here and add a checksum.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also use fetchPypi: https://pypi.org/project/pywal/.

postCheck = ''
rm -r tmp
'';
propagatedBuildInputs = with pkgs; [ imagemagick feh ] ++ (with py; [ setuptools ]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add meta attributes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the program uses imagemagick or feh executables, adding those to propagatedBuildInputs will not work except inside a nix-shell. Use makeWrapper here instead to extend PATH: https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/tools/build-managers/sbt-extras/default.nix#L29

let
py = pkgs.python36Packages;
in py.buildPythonPackage rec {
name = "pywal";
Copy link
Member

@Mic92 Mic92 Apr 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name = "pyval-${version}";

Copy link
Member

@dotlambda dotlambda Apr 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pname = "pywal";

@@ -0,0 +1,18 @@
{ pkgs ? import <nixpkgs> {} }:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove pkgs here and add imagemagick, feh and python3Packages explictly.

'';
postCheck = ''
rm -r tmp
'';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleanup can be skipped here. Nix take care of this.

{ pkgs ? import <nixpkgs> {} }:
let
py = pkgs.python36Packages;
in py.buildPythonPackage rec {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

buildPythonApplication

py = pkgs.python36Packages;
in py.buildPythonPackage rec {
name = "pywal";
version = "2.0.4";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Version 2.0.5 is now available.

version = "2.0.4";
src = builtins.fetchTarball {
url = "https://github.com/dylanaraps/pywal/archive/${version}.tar.gz";
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also use fetchPypi: https://pypi.org/project/pywal/.

@Fresheyeball Fresheyeball changed the title pywal: init at 2.0.4 pywal: init at 2.0.5 Apr 5, 2018
@Fresheyeball
Copy link
Author

@dotlambda @Mic92 Addressed

meta = {
description = "Generate and change colorschemes on the fly. A 'wal' rewrite in Python 3.";
license = stdenv.lib.licenses.mit;
platforms = stdenv.lib.platforms.unix;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want maintain this package?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can. How would I state that here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to add inherit (src.meta) homepage;.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dotlambda done!

postCheck = ''
rm -r tmp
postFixup = ''
wrapProgram $out/bin/wal --prefix PATH : ${stdenv.lib.makeBinPath [ imagemagick feh ]}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use makeWrapperArgs instead.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean?

Copy link
Member

@dotlambda dotlambda Apr 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/NixOS/nixpkgs/search?q=makeWrapperArgs, i.e.

makeWrapperArgs = [ "--prefix PATH : ${stdenv.lib.makeBinPath [ imagemagick feh ]}" ];

@0x6C38
Copy link
Contributor

0x6C38 commented May 13, 2018

Excuse my ignorance, but how do I use this? I've tried to install the package by adding it to my configuration file but it seems that it can't be found, I'm getting error: undefined variable pywal. I can see this branch has been merged into master, is this package not in the stable channel or is there a special workaround to install it?

Mic92 pushed a commit that referenced this pull request May 13, 2018
(cherry picked from commit ff5baea)
@Mic92
Copy link
Member

Mic92 commented May 13, 2018

It was only available in unstable because it was merged after the last release.
We do not backport all new packages. This happens mostly on popular demand.

Here is the backport to 18.03:

[detached HEAD b88d66c] pywal: init at 2.0.5 (#38443)
Author: Isaac Shapira fresheyeball@gmail.com
Date: Fri Apr 6 01:57:20 2018 -0600
3 files changed, 35 insertions(+)
create mode 100644 pkgs/tools/graphics/pywal/default.nix

Channel updates can be tracked here: https://howoldis.herokuapp.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants