diff options
Diffstat (limited to 'pkgs')
26 files changed, 498 insertions, 105 deletions
diff --git a/pkgs/haskell/blessings.nix b/pkgs/haskell/blessings.nix index 65661aa..9ed1664 100644 --- a/pkgs/haskell/blessings.nix +++ b/pkgs/haskell/blessings.nix @@ -1,16 +1,18 @@ -{ mkDerivation, base, bytestring, fetchgit, hspec, QuickCheck, lib, mylib, text }: - +{ mkDerivation, base, dlist, extra, fetchgit, hspec, lib +, mono-traversable, QuickCheck, seq2, text +}: mkDerivation { pname = "blessings"; - version = "2.3.0"; + version = "3.0.0"; src = fetchgit { - url = http://cgit.ni.krebsco.de/blessings; - rev = "refs/tags/v2.3.0"; - hash = "sha256-fS79UOHBMfJHyz7E0Rx4lKZSZOD2G99h2zuDT+SOUJQ="; + url = "https://cgit.krebsco.de/blessings"; + sha256 = "1x4wa9v9kgd8z11pxf9clsbk1527bqq86zvk1mp26dzwkbw8kgpk"; + rev = "2e33bc5ac86c81f0c9ee823b4913bce776ba5a0d"; + fetchSubmodules = true; }; - libraryHaskellDepends = [ base bytestring text ]; - testHaskellDepends = [ base hspec QuickCheck ]; - doHaddock = false; - # WTFPL is the true license, which is unknown to cabal. - license = lib.licenses.wtfpl; + libraryHaskellDepends = [ + base dlist extra mono-traversable seq2 text + ]; + testHaskellDepends = [ base hspec mono-traversable QuickCheck ]; + license = lib.licenses.mit; } diff --git a/pkgs/haskell/desktop-pager.nix b/pkgs/haskell/desktop-pager.nix index 8301235..fd90c1e 100644 --- a/pkgs/haskell/desktop-pager.nix +++ b/pkgs/haskell/desktop-pager.nix @@ -1,15 +1,15 @@ { mkDerivation, aeson, base, blessings, bytestring, containers -, data-default, extra, fetchgit, hack, lib, optparse-applicative -, probability, speculate, split, terminal-scanner, terminal-size -, text, unix, utf8-string, X11 +, data-default, extra, fetchgit, hack, lib, mono-traversable +, optparse-applicative, probability, speculate, split +, terminal-scanner, terminal-size, text, unix, utf8-string, X11 }: mkDerivation { pname = "desktop-pager"; - version = "1.0.0"; + version = "1.0.2"; src = fetchgit { url = "https://cgit.krebsco.de/desktop-pager"; - sha256 = "1hb8an31szwx9zixzb1m7219jrz3cdz57phf45r4b3n6qrzcn35l"; - rev = "3919fb8adc06134a304d4fcbcd192c8707c06cbd"; + sha256 = "1dvqm8a0d8lh227ck0dhyfxkjknhjgjpcwjh3dvps3721p1qldjn"; + rev = "f792f1db052afd4f4af9bca568fe2b8fb96ea7e8"; fetchSubmodules = true; }; isLibrary = true; @@ -17,8 +17,8 @@ mkDerivation { libraryHaskellDepends = [ base extra utf8-string X11 ]; executableHaskellDepends = [ aeson base blessings bytestring containers data-default hack - optparse-applicative probability speculate split terminal-scanner - terminal-size text unix X11 + mono-traversable optparse-applicative probability speculate split + terminal-scanner terminal-size text unix X11 ]; license = lib.licenses.mit; } diff --git a/pkgs/haskell/hack.nix b/pkgs/haskell/hack.nix index 0eb0232..b6c3ca6 100644 --- a/pkgs/haskell/hack.nix +++ b/pkgs/haskell/hack.nix @@ -1,22 +1,22 @@ { mkDerivation, base, blessings, containers, data-default, fetchgit -, lens, lib, mtl, old-locale, process, terminal-scanner, time, unix -, zippers +, lens, lib, mono-traversable, mtl, old-locale, process +, terminal-scanner, time, unix, zippers }: mkDerivation { pname = "hack"; - version = "1.0.3"; + version = "1.0.4"; src = fetchgit { url = "https://cgit.krebsco.de/hack"; - sha256 = "04vxcfm204sxn3v48ch27srgqgpiqbm9i82lrmgp1yyx84wchq32"; - rev = "a6fc1e51f1f87a7cc485a47000f23f1f054beb95"; + sha256 = "1in95j2fx12kh994ajd5wpzsf5nrk7bs1rqjjnn7gq5zal216kkq"; + rev = "4f81ea639fb7754b1169f358bdae8225e6e4e2b3"; fetchSubmodules = true; }; isLibrary = true; isExecutable = true; libraryHaskellDepends = [ base ]; executableHaskellDepends = [ - base blessings containers data-default lens mtl old-locale process - terminal-scanner time unix zippers + base blessings containers data-default lens mono-traversable mtl + old-locale process terminal-scanner time unix zippers ]; license = lib.licenses.mit; mainProgram = "hack"; diff --git a/pkgs/haskell/mailaids.nix b/pkgs/haskell/mailaids.nix new file mode 100644 index 0000000..815613c --- /dev/null +++ b/pkgs/haskell/mailaids.nix @@ -0,0 +1,22 @@ +{ mkDerivation, aeson, aeson-pretty, base, bytestring +, case-insensitive, either, fetchgit, lens, lib +, optparse-applicative, purebred-email, text, vector, word8 +}: +mkDerivation { + pname = "mailaids"; + version = "1.1.0+parts"; + src = fetchgit { + url = "https://cgit.krebsco.de/mailaids"; + sha256 = "0xwd196zrgfv2d7x1pgp1yzqj1hrpwr0m54i6mnrmk6022yx46hl"; + rev = "02d8996bb6aaeb2881e2df33da5167b649edb822"; + fetchSubmodules = true; + }; + isLibrary = false; + isExecutable = true; + executableHaskellDepends = [ + aeson aeson-pretty base bytestring case-insensitive either lens + optparse-applicative purebred-email text vector word8 + ]; + license = lib.licenses.mit; + mainProgram = "mailaid"; +} diff --git a/pkgs/haskell/much.nix b/pkgs/haskell/much.nix index 9744a25..cdfe011 100644 --- a/pkgs/haskell/much.nix +++ b/pkgs/haskell/much.nix @@ -2,18 +2,19 @@ , blaze-builder, blessings, bytestring, case-insensitive , containers, data-default, deepseq, directory, either , email-header, fetchgit, filepath, friendly-time, http-types -, hyphenation, lib, linebreak, network, old-locale -, optparse-applicative, process, random, rosezipper, safe -, servant-server, split, terminal-scanner, terminal-size, text -, time, transformers, transformers-compat, unix, vector, wai, warp +, hyphenation, lib, linebreak, mono-traversable, network +, old-locale, optparse-applicative, process, process-extras, random +, rosezipper, safe, servant-server, split, terminal-scanner +, terminal-size, text, text-wcwidth, time, transformers +, transformers-compat, unix, vector, wai, warp }: -mkDerivation rec { +mkDerivation { pname = "much"; - version = "1.3.2"; + version = "1.4.2"; src = fetchgit { url = "https://cgit.krebsco.de/much"; - sha256 = "001lvn4f3pgxwq0fgxvk0jl33r54gvh908r6wx02fw4s6b3sysc0"; - rev = "3a0fe1da7c33b024128079f5810c6a99b25aebe7"; + sha256 = "088cbzlvh23625617qyp1s3q0qb4il4b3f4ji061gq3bikycrhkf"; + rev = "36184551980eb59b67189c2a782c7f4461285d23"; fetchSubmodules = true; }; isLibrary = true; @@ -22,16 +23,18 @@ mkDerivation rec { aeson attoparsec base base64-bytestring blaze-builder blessings bytestring case-insensitive containers data-default deepseq directory either email-header filepath friendly-time http-types - hyphenation linebreak network old-locale optparse-applicative - process random rosezipper safe servant-server split - terminal-scanner terminal-size text time transformers - transformers-compat unix vector wai warp + hyphenation linebreak mono-traversable network old-locale + optparse-applicative process process-extras random rosezipper safe + servant-server split terminal-scanner terminal-size text + text-wcwidth time transformers transformers-compat unix vector wai + warp ]; executableHaskellDepends = [ aeson base blessings bytestring case-insensitive containers - data-default deepseq directory filepath hyphenation linebreak - process rosezipper safe terminal-scanner text time transformers - unix + data-default deepseq directory hyphenation linebreak + mono-traversable process rosezipper safe terminal-scanner text + text-wcwidth time transformers ]; license = lib.licenses.mit; + mainProgram = "much"; } diff --git a/pkgs/haskell/purebred-email/default.nix b/pkgs/haskell/purebred-email/default.nix new file mode 100644 index 0000000..34c3ed6 --- /dev/null +++ b/pkgs/haskell/purebred-email/default.nix @@ -0,0 +1,31 @@ +{ mkDerivation, attoparsec, base, base64-bytestring, bytestring +, case-insensitive, concise, deepseq, fetchgit, hedgehog, lens, lib +, QuickCheck, quickcheck-instances, random, semigroupoids +, stringsearch, tasty, tasty-golden, tasty-hedgehog, tasty-hunit +, tasty-quickcheck, text, time +}: +mkDerivation { + pname = "purebred-email"; + version = "0.6.0.2"; + src = fetchgit { + url = "https://github.com/purebred-mua/purebred-email"; + hash = "sha256-P9RmQZ4fvQ1LGdQXFAAP/43VR8TZtQASs2cDK/zjHWg="; + rev = "23c69d5c923a91581c366e23fc7de3992dd81e27"; + fetchSubmodules = true; + }; + isLibrary = true; + isExecutable = true; + libraryHaskellDepends = [ + attoparsec base base64-bytestring bytestring case-insensitive + concise deepseq lens random semigroupoids stringsearch text time + ]; + testHaskellDepends = [ + attoparsec base bytestring case-insensitive hedgehog lens + QuickCheck quickcheck-instances random tasty tasty-golden + tasty-hedgehog tasty-hunit tasty-quickcheck text time + ]; + homepage = "https://github.com/purebred-mua/purebred-email"; + description = "types and parser for email messages (including MIME)"; + license = lib.licenses.agpl3Plus; + jailbreak = true; +} diff --git a/pkgs/haskell/purebred-email/untweak-mime-version-header.patch b/pkgs/haskell/purebred-email/untweak-mime-version-header.patch new file mode 100644 index 0000000..97baf7a --- /dev/null +++ b/pkgs/haskell/purebred-email/untweak-mime-version-header.patch @@ -0,0 +1,65 @@ +diff --git a/src/Data/MIME.hs b/src/Data/MIME.hs +index 19af53e..be8cbd4 100644 +--- a/src/Data/MIME.hs ++++ b/src/Data/MIME.hs +@@ -810,7 +810,6 @@ multipart takeTillEnd boundary = + -- | Sets the @MIME-Version: 1.0@ header. + -- + instance RenderMessage MIME where +- tweakHeaders = set (headers . at "MIME-Version") (Just "1.0") + buildBody h z = Just $ case z of + Part partbody -> Builder.byteString partbody + Encapsulated msg -> buildMessage msg +diff --git a/tests/Generator.hs b/tests/Generator.hs +index 9e1f166..23bd122 100644 +--- a/tests/Generator.hs ++++ b/tests/Generator.hs +@@ -64,7 +64,7 @@ exampleMailsParseSuccessfully = + textPlain7bit :: MIMEMessage + textPlain7bit = + let m = createTextPlainMessage "This is a simple mail." +- in over headers (\(Headers xs) -> Headers $ (CI.mk "Subject", "Hello there") : xs) m ++ in over headers (\(Headers xs) -> Headers $ (CI.mk "MIME-Version", "1.0") : (CI.mk "Subject", "Hello there") : xs) m + + multiPartMail :: MIMEMessage + multiPartMail = +@@ -72,13 +72,16 @@ multiPartMail = + to' = Single $ Mailbox Nothing (AddrSpec "bar" (DomainDotAtom $ pure "bar.com")) + subject = "Hello there" + p = createTextPlainMessage "This is a simple mail." ++ & set (headers . at "MIME-Version") (Just "1.0") + a = createAttachment + contentTypeApplicationOctetStream + (Just "foo.bin") + "fileContentsASDF" ++ & set (headers . at "MIME-Version") (Just "1.0") + now = UTCTime (ModifiedJulianDay 123) (secondsToDiffTime 123) + in createMultipartMixedMessage "asdf" (fromList [p, a]) +- & set (headers . at "From") (Just $ renderMailboxes [from']) ++ & set (headers . at "MIME-Version") (Just "1.0") ++ . set (headers . at "From") (Just $ renderMailboxes [from']) + . set (headers . at "To") (Just $ renderAddresses [to']) + . set (headers . at "Date") (Just $ renderRFC5422Date now) + . set (headers . at "Subject") (Just $ T.encodeUtf8 subject) +diff --git a/tests/Message.hs b/tests/Message.hs +index 6711519..3e40397 100644 +--- a/tests/Message.hs ++++ b/tests/Message.hs +@@ -29,7 +29,7 @@ import Data.Char (isPrint) + import Data.Foldable (fold) + import Data.List.NonEmpty (NonEmpty(..), intersperse) + +-import Control.Lens (set, view) ++import Control.Lens ((&), at, set, view) + import qualified Data.ByteString as B + import qualified Data.Text as T + +@@ -99,7 +99,7 @@ genMessage = Gen.choice [ genTextPlain, genMultipart, encapsulate <$> genMessage + prop_messageRoundTrip :: Property + prop_messageRoundTrip = property $ do + msg <- forAll genMessage +- parse (message mime) (renderMessage msg) === Right msg ++ parse (message mime) (renderMessage $ msg & set (headers . at "MIME-Version") (Just "1.0")) === Right msg + + prop_messageFromRoundTrip :: Property + prop_messageFromRoundTrip = property $ do diff --git a/pkgs/haskell/seq2.nix b/pkgs/haskell/seq2.nix new file mode 100644 index 0000000..9d18f92 --- /dev/null +++ b/pkgs/haskell/seq2.nix @@ -0,0 +1,14 @@ +{ mkDerivation, base, fetchgit, lib }: +mkDerivation { + pname = "seq2"; + version = "1.0.0"; + src = fetchgit { + url = "https://cgit.krebsco.de/seq2"; + sha256 = "03b90b68xpk00v13cc45aw148z1spph8vyqga8vmif9iv5g0lfjn"; + rev = "6aeb56c36a9a47c9216c8f9252ca26d091506c73"; + fetchSubmodules = true; + }; + libraryHaskellDepends = [ base ]; + homepage = "https://cgit.krebsco.de/seq2"; + license = lib.licenses.mit; +} diff --git a/pkgs/haskell/terminal-scanner.nix b/pkgs/haskell/terminal-scanner.nix index 4801df7..ca16644 100644 --- a/pkgs/haskell/terminal-scanner.nix +++ b/pkgs/haskell/terminal-scanner.nix @@ -1,11 +1,11 @@ { mkDerivation, base, fetchgit, lib }: mkDerivation { pname = "terminal-scanner"; - version = "1.0.1"; + version = "1.1.0"; src = fetchgit { url = "https://cgit.krebsco.de/terminal-scanner"; - sha256 = "1ic8j2nlhmy76fnqji277wsl1cikd9y4lwqqcxzldjx1vi61r13r"; - rev = "3c5301303230f563214c5ff003f9fc8e2e0a7199"; + sha256 = "0x37g62km90pgamrn3slr513jw29cb9zmrnb9frs8j8r9yq50fz0"; + rev = "a77acbcc13f8eb50e1277d07cf2a10004b58af71"; fetchSubmodules = true; }; libraryHaskellDepends = [ base ]; diff --git a/pkgs/haskell/terminal-utilities.nix b/pkgs/haskell/terminal-utilities.nix new file mode 100644 index 0000000..eeab32f --- /dev/null +++ b/pkgs/haskell/terminal-utilities.nix @@ -0,0 +1,13 @@ +{ mkDerivation, base, fetchgit, lib }: +mkDerivation { + pname = "terminal-utilities"; + version = "1.0.0"; + src = fetchgit { + url = "https://cgit.krebsco.de/terminal-utilities"; + sha256 = "0kpkm87g5ab0s22zly994ql8hfc0gbqc5s7ln4ngav2k91a0wp7j"; + rev = "e2c0cc11a71c785b268f31f60bed2a79e00a4d61"; + fetchSubmodules = true; + }; + libraryHaskellDepends = [ base ]; + license = lib.licenses.mit; +} diff --git a/pkgs/haskell/text-wcwidth.nix b/pkgs/haskell/text-wcwidth.nix new file mode 100644 index 0000000..e6a43d6 --- /dev/null +++ b/pkgs/haskell/text-wcwidth.nix @@ -0,0 +1,15 @@ +{ mkDerivation, base, fetchgit, lib, mono-traversable, text +, wcwidth +}: +mkDerivation { + pname = "text-wcwidth"; + version = "1.0.0"; + src = fetchgit { + url = "https://cgit.krebsco.de/text-wcwidth"; + sha256 = "1x51za2vpxgdz05arks3a98v9mz12s64rcncgg34fmir42f27li1"; + rev = "d70945bdfcf1bebf3dadb6b6c8ac7c75b4d3e9d0"; + fetchSubmodules = true; + }; + libraryHaskellDepends = [ base mono-traversable text wcwidth ]; + license = lib.licenses.mit; +} diff --git a/pkgs/haskell/xmonad-tv/src/main.hs b/pkgs/haskell/xmonad-tv/src/main.hs index 711f9eb..05817af 100644 --- a/pkgs/haskell/xmonad-tv/src/main.hs +++ b/pkgs/haskell/xmonad-tv/src/main.hs @@ -9,6 +9,7 @@ import XMonad.Hooks.EwmhDesktops (ewmh) import XMonad.Hooks.EwmhDesktops.Extra (ewmhExtra) import XMonad.Hooks.RefocusLast (refocusLastLayoutHook, toggleFocus) +import Control.Monad (void) import Control.Monad.Extra (whenJustM) import qualified Data.Aeson import qualified Data.ByteString.Char8 @@ -23,10 +24,10 @@ import System.Posix.Process (executeFile) import XMonad.Actions.DynamicWorkspaces (removeEmptyWorkspace) import XMonad.Actions.CycleWS (toggleWS) import XMonad.Layout.Gaps (Direction2D(U,R,D,L), gaps) -import XMonad.Layout.NoBorders ( smartBorders ) +import XMonad.Layout.FocusTracking (focusTracking) +import XMonad.Layout.NoBorders (noBorders) import XMonad.Layout.ResizableTile (ResizableTall(ResizableTall)) import XMonad.Layout.ResizableTile (MirrorResize(MirrorExpand,MirrorShrink)) -import XMonad.Layout.StateFull (pattern StateFull) import qualified XMonad.StackSet as W import Data.Map (Map) import qualified Data.Map as Map @@ -44,6 +45,11 @@ import XMonad.Hooks.Place (placeHook, smart) import XMonad.Actions.PerWorkspaceKeys (chooseAction) import Shutdown (shutdown, newShutdownEventHandler) +import System.IO.Unsafe (unsafePerformIO) + + +sliceEnvPath :: FilePath +sliceEnvPath = unsafePerformIO (getEnv "XMONAD_CACHE_DIR") <> "/slice.env" main :: IO () @@ -70,6 +76,7 @@ readEnv' defaultValue name = mainNoArgs :: IO () mainNoArgs = do + getEnvironment >>= \env -> writeFile sliceEnvPath $ unlines [ k <> "=" <> v | (k, v) <- env] myMasterDelta <- readEnv' (1 / 20) "XMONAD_MASTER_DELTA" :: IO Rational myMasterWidth <- readEnv' (1 / 2) "XMONAD_MASTER_WIDTH" :: IO Rational myScreenGaps <- readEnv' [] "XMONAD_SCREEN_GAPS" :: IO [Int] @@ -95,14 +102,13 @@ mainNoArgs = do , layoutHook = refocusLastLayoutHook $ gaps (zip [U,R,D,L] myScreenGaps) $ - smartBorders $ - ResizableTall - 1 - myMasterDelta - (myMasterWidth + 2 * fromIntegral (borderWidth def) / fromIntegral myScreenWidth) - [] - ||| - StateFull + ResizableTall + 1 + myMasterDelta + (myMasterWidth + 2 * fromIntegral (borderWidth def) / fromIntegral myScreenWidth) + [] + ||| + noBorders (focusTracking Full) , manageHook = composeAll [ appName =? "fzmenu-urxvt" --> doCenterFloat @@ -134,16 +140,22 @@ handleFocusChangeEvent = \case forkFile :: FilePath -> [String] -> Maybe [(String, String)] -> X () -forkFile path args env = - xfork (executeFile path True args env) >> return () +forkFile path args env = void . xfork $ do + environment <- getEnvironment + executeFile path True args (env <> Just environment) -spawnRootTerm :: X () -spawnRootTerm = - forkFile - {-pkg:alacritty-tv-}"alacritty" - ["--profile=root", "-e", "/run/wrappers/bin/su", "-"] - Nothing +forkFileInSlice :: String -> FilePath -> [String] -> X () +forkFileInSlice sliceName path args = void . xfork $ + executeFile {-pkg:systemd-}"systemd-run" True + ( "--collect" + : "--user" + : "--slice=" <> sliceName + : "--property=EnvironmentFile=" <> sliceEnvPath + : path + : args + ) + Nothing myKeys :: XConfig Layout -> Map (KeyMask, KeySym) (X ()) @@ -156,8 +168,8 @@ myKeys conf = Map.fromList $ , ((_4 , xK_p ), forkFile {-pkg:fzmenu-}"passmenu" [] Nothing) , ((_4C , xK_p ), forkFile {-pkg:fzmenu-}"passmenu" ["--phase2-method=copy"] Nothing) - , ((_4 , xK_x ), forkFile {-pkg:alacritty-tv-}"alacritty" ["--singleton"] Nothing) - , ((_4C , xK_x ), spawnRootTerm) + , ((_4 , xK_x ), forkFileInSlice "alacritty" {-pkg:alacritty-tv-}"alacritty" ["--dtach", "--singleton"]) + , ((_4C , xK_x ), forkFileInSlice "alacritty" {-pkg:alacritty-tv-}"alacritty" ["--profile=root", "-e", "/run/wrappers/bin/su", "-"]) , ((_C , xK_Menu ), toggleWS) diff --git a/pkgs/shell/dtach-list b/pkgs/shell/dtach-list new file mode 100755 index 0000000..1e77a3d --- /dev/null +++ b/pkgs/shell/dtach-list @@ -0,0 +1,32 @@ +#! /bin/sh +#!buildShellBin path=coreutils:findutils:gawk:gnugrep:gnused:iproute2:psmisc +# +# NAME +# dtach-list - list dtach sessions +# +# SYNOPSIS +# dtach-list +# +set -efu + +workdir=$(mktemp -d -t dtach-list.XXXXXXXX) +readonly workdir +trap 'cd / && rm -r "$workdir"' EXIT +cd "$workdir" + +ss -HQpx > ssclients + +ss -HQlpx | sed -nr 's/ +/ /g; s/^u_str LISTEN ([^ ]+) [0-9]+ \* 0 users:\(\("dtach",pid=([0-9]+),fd=3\)\) $/\2 \1/p' | sort -n > sockets + +while read -r pid sock; do + connections=$(awk -v sock="$sock" '$3==sock{n++}BEGIN{n=0}END{print n}' ssclients) + pstree -TUalp "$pid" >pstree + if test "$connections" = 0; then + sed ' + 1s/$/ (detached)/ + s/.*/\x1b[38;5;202m&\x1b[m/ + ' pstree + else + cat pstree + fi +done <sockets diff --git a/pkgs/simple/alacritty-tv.nix b/pkgs/simple/alacritty-tv.nix index 0d2fe59..ebf609e 100644 --- a/pkgs/simple/alacritty-tv.nix +++ b/pkgs/simple/alacritty-tv.nix @@ -5,18 +5,33 @@ pkgs.symlinkJoin { paths = [ (pkgs.writeDashBin "alacritty" '' # usage: - # alacritty [--profile=PROFILE] [--singleton] [ARGS...] + # alacritty [--dtach] [--profile=PROFILE] [--singleton] [COMMAND [ARGS...]] # where # PROFILE must have a corresponding file /etc/alacritty/PROFILE.toml set -efu + dtach= profile=default - case ''${1-} in - --profile=*) - profile=''${1#--profile=} - shift - esac + singleton= + while :; do + case ''${1-} in + --dtach) + dtach=1 + shift + ;; + --profile=*) + profile=''${1#--profile=} + shift + ;; + --singleton) + singleton=1 + shift + ;; + *) + break + esac + done config=/etc/alacritty/$profile.toml @@ -31,17 +46,24 @@ pkgs.symlinkJoin { ${pkgs.jq}/bin/jq .device_scale_factor ) - case ''${1-} in - --singleton) - shift - if ! ${pkgs.alacritty}/bin/alacritty --config-file "$config" msg create-window "$@"; then - ${pkgs.alacritty}/bin/alacritty --config-file "$config" "$@" & - fi - ;; - *) - exec ${pkgs.alacritty}/bin/alacritty --config-file "$config" "$@" - ;; - esac + if test "$dtach" = 1; then + if test $# = 0; then + _CURRENT_DESKTOP_NAME=''${_CURRENT_DESKTOP_NAME-$(${pkgs.xextras}/bin/net-current-desktop)} + SHELL=''${SHELL-${pkgs.bash}/bin/bash} + sock=$XDG_RUNTIME_DIR/Alacritty-$DISPLAY-dtach-$_CURRENT_DESKTOP_NAME-$$.sock + set -- -e ${pkgs.dtach}/bin/dtach -c "$sock" -r winch -z "$SHELL" + else + echo 'alacritty-tv: warning: option --dtach ignored: arguments provided' >&2 + fi + fi + + if test "$singleton" = 1; then + if ! ${pkgs.alacritty}/bin/alacritty --config-file "$config" msg create-window "$@"; then + ${pkgs.alacritty}/bin/alacritty --config-file "$config" "$@" & + fi + else + exec ${pkgs.alacritty}/bin/alacritty --config-file "$config" "$@" + fi '') pkgs.alacritty ]; diff --git a/pkgs/simple/dic.nix b/pkgs/simple/dic.nix new file mode 100644 index 0000000..0875c73 --- /dev/null +++ b/pkgs/simple/dic.nix @@ -0,0 +1,37 @@ +{ lib, pkgs, stdenv }: + +stdenv.mkDerivation { + name = "dic"; + + src = pkgs.fetchgit { + url = https://cgit.ni.krebsco.de/dic; + rev = "refs/tags/v1.1.1"; + sha256 = "1gbj967a5hj53fdkkxijqgwnl9hb8kskz0cmpjq7v65ffz3v6vag"; + }; + + phases = [ + "unpackPhase" + "installPhase" + ]; + + installPhase = + let + path = lib.makeBinPath [ + pkgs.coreutils + pkgs.curl + pkgs.gnused + pkgs.gnugrep + pkgs.util-linux + ]; + in + '' + mkdir -p $out/bin + + sed \ + 's,^main() {$,&\n PATH=${path}; export PATH,' \ + < ./dic \ + > $out/bin/dic + + chmod +x $out/bin/dic + ''; +} diff --git a/pkgs/simple/editor-input.nix b/pkgs/simple/editor-input.nix index 536084d..0591f2f 100644 --- a/pkgs/simple/editor-input.nix +++ b/pkgs/simple/editor-input.nix @@ -1,7 +1,7 @@ { pkgs }: pkgs.writeDashBin "editor-input" '' exec \ - ${pkgs.utillinux}/bin/setsid -f \ + ${pkgs.util-linux}/bin/setsid -f \ ${pkgs.with-tmpdir}/bin/with-tmpdir -t editor-input.XXXXXXXX \ ${pkgs.writeDash "editor-input.sh" '' f=$TMPDIR/input diff --git a/pkgs/simple/fzmenu/default.nix b/pkgs/simple/fzmenu/default.nix index e709d74..9a9bda6 100644 --- a/pkgs/simple/fzmenu/default.nix +++ b/pkgs/simple/fzmenu/default.nix @@ -17,8 +17,8 @@ pkgs.runCommand "fzmenu" { cp -r ${./bin} $out/bin substituteInPlace $out/bin/otpmenu \ - --replace '#! /bin/sh' '#! ${pkgs.dash}/bin/dash' \ - --replace '#PATH=' PATH=${lib.makeBinPath [ + --replace-fail '#! /bin/sh' '#! ${pkgs.dash}/bin/dash' \ + --replace-fail '#PATH=' PATH=${lib.makeBinPath [ pkgs.coreutils pkgs.dash pkgs.findutils @@ -27,15 +27,15 @@ pkgs.runCommand "fzmenu" { (pkgs.pass.withExtensions (ext: [ ext.pass-otp ])) - pkgs.utillinux + pkgs.util-linux pkgs.xsel pkgs.xvkbd terminal ]} substituteInPlace $out/bin/passmenu \ - --replace '#! /bin/sh' '#! ${pkgs.dash}/bin/dash' \ - --replace '#PATH=' PATH=${lib.makeBinPath [ + --replace-fail '#! /bin/sh' '#! ${pkgs.dash}/bin/dash' \ + --replace-fail '#PATH=' PATH=${lib.makeBinPath [ pkgs.coreutils pkgs.dash pkgs.findutils @@ -44,7 +44,7 @@ pkgs.runCommand "fzmenu" { (pkgs.pass.withExtensions (ext: [ ext.pass-otp ])) - pkgs.utillinux + pkgs.util-linux pkgs.xsel pkgs.xvkbd terminal diff --git a/pkgs/simple/hc.nix b/pkgs/simple/hc.nix index 086445e..15550dc 100644 --- a/pkgs/simple/hc.nix +++ b/pkgs/simple/hc.nix @@ -1,5 +1,5 @@ { fetchgit, lib, makeWrapper, stdenv -, coreutils, findutils, gawk, gnugrep, qrencode, texlive, utillinux, zbar +, coreutils, findutils, gawk, gnugrep, qrencode, texlive, util-linux, zbar }: stdenv.mkDerivation rec { @@ -28,7 +28,7 @@ stdenv.mkDerivation rec { gnugrep qrencode texlive.combined.scheme-full - utillinux + util-linux zbar ]} ''; diff --git a/pkgs/simple/otherutils.nix b/pkgs/simple/otherutils.nix new file mode 100644 index 0000000..5c946d2 --- /dev/null +++ b/pkgs/simple/otherutils.nix @@ -0,0 +1,15 @@ +{ pkgs, stdenv }: + +stdenv.mkDerivation rec { + pname = "otherutils"; + version = "1.1.0"; + src = pkgs.fetchgit { + url = "https://cgit.krebsco.de/otherutils"; + rev = "refs/tags/${version}"; + hash = "sha256-eiMTIXTEsq+DGlOw+fcU2cgRkuPWTy5lm/L5heuhDxM="; + }; + env = { + PREFIX = placeholder "out"; + }; +} + diff --git a/pkgs/simple/pinentry-urxvt/default.nix b/pkgs/simple/pinentry-urxvt/default.nix index 808d00a..e79b09f 100644 --- a/pkgs/simple/pinentry-urxvt/default.nix +++ b/pkgs/simple/pinentry-urxvt/default.nix @@ -51,7 +51,7 @@ in trap cleanup EXIT cleanup() { - ${pkgs.utillinux}/bin/kill -- $(${pkgs.coreutils}/bin/cat "$displayers") + ${pkgs.util-linux}/bin/kill -- $(${pkgs.coreutils}/bin/cat "$displayers") rm "$displayers" rm "$screenshot" } diff --git a/pkgs/simple/q/default.nix b/pkgs/simple/q/default.nix index ca4a466..5944dd9 100644 --- a/pkgs/simple/q/default.nix +++ b/pkgs/simple/q/default.nix @@ -17,11 +17,11 @@ let in /* sh */ '' cols=$(${pkgs.ncurses}/bin/tput cols) if test $cols -ge ${toString (need_width 3)}; then - ${pkgs.utillinux}/bin/cal --color=always -mw3 + ${pkgs.util-linux}/bin/cal --color=always -mw3 elif test $cols -ge ${toString (need_width 2)}; then - ${pkgs.utillinux}/bin/cal --color=always -mw -n 2 + ${pkgs.util-linux}/bin/cal --color=always -mw -n 2 elif test $cols -ge ${toString (need_width 1)}; then - ${pkgs.utillinux}/bin/cal --color=always -mw1 + ${pkgs.util-linux}/bin/cal --color=always -mw1 else : fi | diff --git a/pkgs/simple/viljetic-pages/index.html b/pkgs/simple/viljetic-pages/index.html index c268cb9..9394cf7 100644 --- a/pkgs/simple/viljetic-pages/index.html +++ b/pkgs/simple/viljetic-pages/index.html @@ -4,6 +4,7 @@ <i>This page intentionally left blank.</i> <!-- mailto:tomislav@viljetic.de + matrix:u/@tomislav:viljetic.de https://github.com/4z3 irc://irc.hackint.org/tv,isnick irc://irc.libera.chat/tv,isnick diff --git a/pkgs/simple/with-tmpdir.nix b/pkgs/simple/with-tmpdir.nix new file mode 100644 index 0000000..9862671 --- /dev/null +++ b/pkgs/simple/with-tmpdir.nix @@ -0,0 +1,29 @@ +{ stdenv, fetchgit, coreutils, dash, ... }: + +stdenv.mkDerivation { + name = "with-tmpdir-1"; + + src = fetchgit { + url = http://cgit.ni.krebsco.de/with-tmpdir; + rev = "3243c02ed8cd27a04c080bd39560204980f6c16a"; + sha256 = "80ee6cafb2c337999ddcd1e41747d6256b7cfcea605358c2046eb7e3729555c6"; + }; + + phases = [ + "unpackPhase" + "installPhase" + ]; + + installPhase = '' + mkdir -p $out/bin + + { echo '#! ${dash}/bin/dash' + echo 'OLDPATH=$PATH' + echo 'PATH=${coreutils}/bin' + sed '$s/^/#/' ./with-tmpdir + echo '(PATH=$OLDPATH; exec "$@")' + } > $out/bin/with-tmpdir + + chmod +x $out/bin/with-tmpdir + ''; +} diff --git a/pkgs/simple/writePolkitRules.nix b/pkgs/simple/writePolkitRules.nix new file mode 100644 index 0000000..af4cb49 --- /dev/null +++ b/pkgs/simple/writePolkitRules.nix @@ -0,0 +1,72 @@ +{ lib, pkgs, ... }: + +name: text: + +pkgs.runCommand name { + nativeBuildInputs = [ + pkgs.eslint + ]; + eslintConfig = /* js */ '' + // ESLint flat config for Polkit rules (Duktape 2.7) + export default [ + { + files: [${builtins.toJSON name}], + languageOptions: { + ecmaVersion: 2016, + sourceType: 'script', + globals: { + polkit: 'readonly', + }, + }, + linterOptions: { + reportUnusedDisableDirectives: true, + }, |
