about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/misc/stylish/default.nix
blob: 8dce6409bb7c40cd1e40147ef12510147dfc5a68 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{
  lib,
  stdenvNoCC,
  fetchFromGitHub,
  makeWrapper,
  curl,
  feh,
  file,
  jq,
  util-linux,
  wget,
}:
stdenvNoCC.mkDerivation rec {
  pname = "stylish";
  version = "unstable-2022-12-05";

  nativeBuildInputs = [ makeWrapper ];

  src = fetchFromGitHub {
    owner = "thevinter";
    repo = "styli.sh";
    rev = "d595412a949c6cdc7e151ae0cf929aa1958aa7f1";
    hash = "sha256-lFnzrYnTFWe8bvK//aC1+TapWIFNsNP60Msn7D0tk/0=";
  };

  installPhase = ''
    runHook preInstall
    mkdir -p $out/bin
    cp "${src}/styli.sh" $out/bin
    chmod +x $out/bin/styli.sh
    runHook postInstall
  '';

  postInstall = ''
    wrapProgram $out/bin/styli.sh --prefix PATH : ${lib.makeBinPath [
      curl
      feh
      file
      jq
      util-linux
      wget
    ]}
  '';

  meta = with lib; {
    homepage = "https://github.com/thevinter/styli.sh";
    description = "A shell script to manage wallpapers";
    mainProgram = "styli.sh";
    longDescription = ''
      Styli.sh is a Bash script that aims to automate the tedious process
      of finding new wallpapers, downloading and switching them via the
      configs.
      Styli.sh can search for specific wallpapers from unsplash or download
      a random image from the specified subreddits. If you have pywal it also
      can set automatically your terminal colors.
    '';
    license = licenses.mit;
    maintainers = with maintainers; [ tchab ];
  };
}