diff options
author | jeschli <jeschli@gmail.com> | 2019-03-21 20:09:09 +0100 |
---|---|---|
committer | jeschli <jeschli@gmail.com> | 2019-03-21 20:09:09 +0100 |
commit | a045a7f054859efcb40baf8ded13bcb7fd706d01 (patch) | |
tree | df23b0d31db9fc0b0087f4d5d4c7b3dd7a88b44c /krebs/5pkgs | |
parent | ed499a84a9fe067c80e5a4768482333863c1e9ad (diff) | |
parent | 550faa1f64434951cd3949bc96a25012349f0090 (diff) |
Merge branch 'master' of prism.r:stockholm into new-master
Diffstat (limited to 'krebs/5pkgs')
-rw-r--r-- | krebs/5pkgs/default.nix | 14 | ||||
-rw-r--r-- | krebs/5pkgs/haskell/blessings.nix | 9 | ||||
-rw-r--r-- | krebs/5pkgs/haskell/flameshot-once.nix | 21 | ||||
-rw-r--r-- | krebs/5pkgs/haskell/reaktor2.nix | 6 | ||||
-rw-r--r-- | krebs/5pkgs/simple/Reaktor/default.nix | 4 | ||||
-rw-r--r-- | krebs/5pkgs/simple/flameshot-once/default.nix | 27 | ||||
-rw-r--r-- | krebs/5pkgs/simple/flameshot-once/profile.nix | 129 |
7 files changed, 187 insertions, 23 deletions
diff --git a/krebs/5pkgs/default.nix b/krebs/5pkgs/default.nix index dc04b6a72..4cdaedebf 100644 --- a/krebs/5pkgs/default.nix +++ b/krebs/5pkgs/default.nix @@ -13,15 +13,6 @@ foldl' mergeAttrs {} // { - # https://github.com/NixOS/nixpkgs/pull/30065 - brscan4 = overrideDerivation super.brscan4 (original: rec { - name = "brscan4-0.4.4-4"; - src = super.fetchurl { - url = "http://download.brother.com/welcome/dlf006645/${name}.amd64.deb"; - sha256 = "0xy5px96y1saq9l80vwvfn6anr2q42qlxdhm6ci2a0diwib5q9fd"; - }; - }); - reaktor2 = self.haskellPackages.reaktor2; ReaktorPlugins = self.callPackage ./simple/Reaktor/plugins.nix {}; @@ -31,9 +22,4 @@ foldl' mergeAttrs {} export PROOT_NO_SECCOMP=1 exec ${super.proot}/bin/proot "$@" ''; - - # XXX symlinkJoin changed arguments somewhere around nixpkgs d541e0d - symlinkJoin = { name, paths, ... }@args: let - x = super.symlinkJoin args; - in if typeOf x != "lambda" then x else super.symlinkJoin name paths; } diff --git a/krebs/5pkgs/haskell/blessings.nix b/krebs/5pkgs/haskell/blessings.nix index 97e4a717c..f730cc72b 100644 --- a/krebs/5pkgs/haskell/blessings.nix +++ b/krebs/5pkgs/haskell/blessings.nix @@ -1,5 +1,5 @@ with import <stockholm/lib>; -{ mkDerivation, base, fetchgit, stdenv }: let +{ mkDerivation, base, fetchgit, hspec, QuickCheck, stdenv, text }: let cfg = { "18.03" = { @@ -7,8 +7,8 @@ with import <stockholm/lib>; sha256 = "1k908zap3694fcxdk4bb29s54b0lhdh557y10ybjskfwnym7szn1"; }; "18.09" = { - version = "2.1.0"; - sha256 = "0wc8v48bb0bkvypc0j6imvnf8xc8572hykk9sgjhzf2w0ggqxv5d"; + version = "2.2.0"; + sha256 = "1pb56dgf3jj2kq3cbbppwzyg3ccgqy9xara62hkjwyxzdx20clk1"; }; }.${versions.majorMinor nixpkgsVersion}; @@ -20,7 +20,8 @@ in mkDerivation { rev = "refs/tags/v${cfg.version}"; sha256 = cfg.sha256; }; - libraryHaskellDepends = [ base ]; + libraryHaskellDepends = [ base text ]; + testHaskellDepends = [ base hspec QuickCheck ]; doHaddock = false; # WTFPL is the true license, which is unknown to cabal. license = stdenv.lib.licenses.wtfpl; diff --git a/krebs/5pkgs/haskell/flameshot-once.nix b/krebs/5pkgs/haskell/flameshot-once.nix new file mode 100644 index 000000000..89b95ca07 --- /dev/null +++ b/krebs/5pkgs/haskell/flameshot-once.nix @@ -0,0 +1,21 @@ +{ mkDerivation, async, base, blessings, bytestring, dbus, fetchgit +, iso8601-time, process, random, stdenv, text, time, unagi-chan +, unix +}: +mkDerivation { + pname = "flameshot-once"; + version = "1.1.0"; + src = fetchgit { + url = "https://cgit.krebsco.de/flameshot-once"; + sha256 = "158ha1yyj3p3mdjjga62j91ml83nhrsg34xbg3dir5cb399j8pxx"; + rev = "9d688b6ffad14912bd1afe42555747cb3d213d95"; + fetchSubmodules = true; + }; + isLibrary = false; + isExecutable = true; + executableHaskellDepends = [ + async base blessings bytestring dbus iso8601-time process random + text time unagi-chan unix + ]; + license = stdenv.lib.licenses.mit; +} diff --git a/krebs/5pkgs/haskell/reaktor2.nix b/krebs/5pkgs/haskell/reaktor2.nix index 40c628802..f06e79121 100644 --- a/krebs/5pkgs/haskell/reaktor2.nix +++ b/krebs/5pkgs/haskell/reaktor2.nix @@ -7,11 +7,11 @@ }: mkDerivation { pname = "reaktor2"; - version = "0.2.1"; + version = "0.2.2"; src = fetchgit { url = "https://cgit.krebsco.de/reaktor2"; - sha256 = "0wg76wlzfi893rl0lzhfs6bkpdcvwvgl6mpnz6w7r8f7znr4a9vr"; - rev = "0e199f7a357a4c5973e5837ec67699cf224ca69c"; + sha256 = "1kyr5i5zdzvc7fcyac1i1yvi88kcxafrgp8p79c1b9l4g9sjnv78"; + rev = "9f4e2644188f985d7cd806c13e2c0dee1688b9f0"; fetchSubmodules = true; }; isLibrary = false; diff --git a/krebs/5pkgs/simple/Reaktor/default.nix b/krebs/5pkgs/simple/Reaktor/default.nix index a88db6379..1cc498a68 100644 --- a/krebs/5pkgs/simple/Reaktor/default.nix +++ b/krebs/5pkgs/simple/Reaktor/default.nix @@ -2,7 +2,7 @@ python3Packages.buildPythonPackage rec { name = "Reaktor-${version}"; - version = "0.7.0"; + version = "0.7.1"; doCheck = false; @@ -14,7 +14,7 @@ python3Packages.buildPythonPackage rec { owner = "krebs"; repo = "Reaktor"; rev = "v${version}"; - sha256 = "12yy06vk0smjs0rmahrn2kd4bcdh1yjw1fz6rifw6nmgx889d9hj"; + sha256 = "0cv5a4x73ls6sk8qj2qi6gqn31rv8kvdg13dsf3jv92xdfx6brjn"; }; meta = { homepage = http://krebsco.de/; diff --git a/krebs/5pkgs/simple/flameshot-once/default.nix b/krebs/5pkgs/simple/flameshot-once/default.nix new file mode 100644 index 000000000..c442a2e96 --- /dev/null +++ b/krebs/5pkgs/simple/flameshot-once/default.nix @@ -0,0 +1,27 @@ +with import <stockholm/lib>; +{ pkgs, ... }@args: + +let + # config cannot be declared in the input attribute set because that would + # cause callPackage to inject the wrong config. Instead, get it from ... + # via args. + config = args.config or {}; +in + + pkgs.symlinkJoin { + name = "flameshot-once-wrapper"; + paths = [ + (pkgs.writeDashBin "flameshot-once" '' + export PATH=${makeBinPath [ + pkgs.flameshot + pkgs.qt5.qtbase + pkgs.xclip + ]} + ${optionalString (config != null) /* sh */ '' + . ${import ./profile.nix { inherit config pkgs; }} + ''} + exec ${pkgs.haskellPackages.flameshot-once}/bin/flameshot-once "$@" + '') + pkgs.haskellPackages.flameshot-once + ]; + } diff --git a/krebs/5pkgs/simple/flameshot-once/profile.nix b/krebs/5pkgs/simple/flameshot-once/profile.nix new file mode 100644 index 000000000..7373da00a --- /dev/null +++ b/krebs/5pkgs/simple/flameshot-once/profile.nix @@ -0,0 +1,129 @@ +with import <stockholm/lib>; +{ config, pkgs }: +let + + # Refs https://github.com/lupoDharkael/flameshot/blob/master/src/widgets/capture/capturebutton.h + ButtonType = { + PENCIL = 0; + DRAWER = 1; + ARROW = 2; + SELECTION = 3; + RECTANGLE = 4; + CIRCLE = 5; + MARKER = 6; + SELECTIONINDICATOR = 7; + MOVESELECTION = 8; + UNDO = 9; + COPY = 10; + SAVE = 11; + EXIT = 12; + IMAGEUPLOADER = 13; + OPEN_APP = 14; + BLUR = 15; + REDO = 16; + PIN = 17; + TEXT = 18; + }; + + cfg = eval.config; + + eval = evalModules { + modules = singleton { + _file = toString ./config.nix; + imports = singleton config; + options = { + buttons = mkOption { + apply = map (name: ButtonType.${name}); + default = [ + "PENCIL" + "DRAWER" + "ARROW" + "SELECTION" + "RECTANGLE" + "CIRCLE" + "MARKER" + "SELECTIONINDICATOR" + "MOVESELECTION" + "UNDO" + "SAVE" + "EXIT" + "BLUR" + ]; + type = types.listOf (types.enum (attrNames ButtonType)); + }; + disabledTrayIcon = mkOption { + default = true; + type = types.bool; + }; + drawThickness = mkOption { + default = 8; + type = types.positive; + }; + filenamePattern = mkOption { + default = "%FT%T%z_flameshot"; + type = + # This is types.filename extended by [%:][%:+]* + types.addCheck types.str (test "[%:0-9A-Za-z._][%:+0-9A-Za-z._-]*"); + }; + savePath = mkOption { + default = "/tmp"; + type = types.absolute-pathname; + }; + showDesktopNotification = mkOption { + default = false; + type = types.bool; + }; + showHelp = mkOption { + default = false; + type = types.bool; + }; + }; + }; + }; + + hexchars = stringToCharacters "0123456789abcdef"; + + # Encode integer to C-escaped string of bytes, little endian / LSB 0 + le = rec { + x1 = i: let + i0 = mod i 16; + i1 = i / 16; + in + "\\x${elemAt hexchars i1}${elemAt hexchars i0}"; + + x2 = i: let + i0 = mod i 256; + i1 = i / 256; + in + "${x1 i0}${x1 i1}"; + + x4 = i: let + i0 = mod i 65536; + i1 = i / 65536; + in + "${x2 i0}${x2 i1}"; + }; + + toQList = t: xs: + assert t == "int"; + "QList<${t}>${le.x4 0}${le.x4 (length xs)}${concatMapStrings le.x4 xs}"; + + XDG_CONFIG_HOME = pkgs.write "flameshot-config" { + "/Dharkael/flameshot.ini".text = '' + [General] + buttons=@Variant(\0\0\0\x7f\0\0\0\v${toQList "int" cfg.buttons}) + disabledTrayIcon=${toJSON cfg.disabledTrayIcon} + drawThickness=${toJSON cfg.drawThickness} + filenamePattern=${toJSON cfg.filenamePattern} + savePath=${toJSON cfg.savePath} + showDesktopNotification=${toJSON cfg.showDesktopNotification} + showHelp=${toJSON cfg.showHelp} + ''; + }; + +in + + pkgs.writeDash "flameshot.profile" '' + export FLAMESHOT_CAPTURE_PATH=${cfg.savePath} + export XDG_CONFIG_HOME=${XDG_CONFIG_HOME} + '' |