about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/misc/xflux
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:36 +0000
committerAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:47 +0000
commit36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch)
treeb3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/tools/misc/xflux
parent4e31070265257dc67d120c27e0f75c2344fdfa9a (diff)
parentabf060725d7614bd3b9f96764262dfbc2f9c2199 (diff)
downloadnixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs
git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a
git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/tools/misc/xflux')
-rw-r--r--nixpkgs/pkgs/tools/misc/xflux/default.nix39
-rw-r--r--nixpkgs/pkgs/tools/misc/xflux/gui.nix46
2 files changed, 85 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/misc/xflux/default.nix b/nixpkgs/pkgs/tools/misc/xflux/default.nix
new file mode 100644
index 000000000000..d0f358446952
--- /dev/null
+++ b/nixpkgs/pkgs/tools/misc/xflux/default.nix
@@ -0,0 +1,39 @@
+{stdenv, fetchurl, libXxf86vm, libXext, libX11, libXrandr, gcc}:
+stdenv.mkDerivation {
+  name = "xflux-2013-09-01";
+  src = fetchurl {
+    url = https://justgetflux.com/linux/xflux64.tgz;
+    sha256 = "cc50158fabaeee58c331f006cc1c08fd2940a126e99d37b76c8e878ef20c2021";
+  };
+
+  libPath = stdenv.lib.makeLibraryPath [
+    gcc.cc
+    libXxf86vm
+    libXext
+    libX11
+    libXrandr
+  ];
+
+  unpackPhase = ''
+    unpackFile $src;
+  '';
+  installPhase = ''
+    mkdir -p "$out/bin"
+    cp  xflux "$out/bin"
+  '';
+  postFixup = ''
+    patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) --set-rpath "$libPath" "$out/bin/xflux"
+  '';
+  meta = {
+    description = "Adjusts your screen to emit warmer light at night";
+    longDescription = ''
+      xflux changes the color temperature of your screen to be much warmer
+      when the sun sets, and then changes it back its colder temperature
+      when the sun rises.
+    '';
+    homepage = https://justgetflux.com/;
+    license = stdenv.lib.licenses.unfree;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.paholg ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/misc/xflux/gui.nix b/nixpkgs/pkgs/tools/misc/xflux/gui.nix
new file mode 100644
index 000000000000..d8959687945a
--- /dev/null
+++ b/nixpkgs/pkgs/tools/misc/xflux/gui.nix
@@ -0,0 +1,46 @@
+{ stdenv, fetchFromGitHub, pythonPackages
+, gnome_python
+, libappindicator-gtk2, xflux, librsvg, wrapGAppsHook
+}:
+pythonPackages.buildPythonApplication rec {
+  name = "xflux-gui-${version}";
+  version = "1.1.10";
+
+  src = fetchFromGitHub {
+    repo = "xflux-gui";
+    owner = "xflux-gui";
+    rev = "v${version}";
+    sha256 = "1k67qg9y4c0n9ih0syx81ixbdl2x89gd4arwh71316cshskn0rc8";
+  };
+
+  propagatedBuildInputs = with pythonPackages; [
+    pexpect
+    pyGtkGlade
+    pygobject2
+    pyxdg
+    libappindicator-gtk2
+    gnome_python
+  ];
+
+  buildInputs = [ xflux librsvg ];
+
+  nativeBuildInputs = [ wrapGAppsHook ];
+
+  postPatch = ''
+     substituteInPlace src/fluxgui/xfluxcontroller.py --replace "pexpect.spawn(\"xflux\"" "pexpect.spawn(\"${xflux}/bin/xflux\""
+  '';
+
+  postFixup = ''
+    wrapGAppsHook
+    wrapPythonPrograms
+    patchPythonScript $out/${pythonPackages.python.sitePackages}/fluxgui/fluxapp.py
+  '';
+
+  meta = {
+    description = "Better lighting for Linux. Open source GUI for xflux";
+    homepage = https://justgetflux.com/linux.html;
+    license = stdenv.lib.licenses.unfree; # marked as unfree since the source code contains a copy of the unfree xflux binary
+    maintainers = [ stdenv.lib.maintainers.sheenobu ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}