summaryrefslogtreecommitdiffstats
path: root/pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/haskell/blessings.nix16
-rw-r--r--pkgs/haskell/desktop-pager.nix10
-rw-r--r--pkgs/haskell/hack.nix12
-rw-r--r--pkgs/haskell/much.nix19
-rw-r--r--pkgs/haskell/terminal-scanner.nix13
-rw-r--r--pkgs/haskell/xmonad-tv/src/main.hs29
-rw-r--r--pkgs/override/htop.nix36
-rw-r--r--pkgs/shell/default.nix6
-rwxr-xr-xpkgs/shell/genpasswd56
-rwxr-xr-xpkgs/shell/with-ssh37
-rw-r--r--pkgs/simple/alacritty-tv.nix6
-rw-r--r--pkgs/simple/editor-input.nix2
-rw-r--r--pkgs/simple/ff.nix2
-rw-r--r--pkgs/simple/pinentry-urxvt/default.nix2
-rw-r--r--pkgs/simple/q/default.nix4
-rw-r--r--pkgs/simple/rxvt-unicode-256color-terminfo/default.nix2
-rw-r--r--pkgs/simple/xkiller.nix2
17 files changed, 205 insertions, 49 deletions
diff --git a/pkgs/haskell/blessings.nix b/pkgs/haskell/blessings.nix
new file mode 100644
index 0000000..65661aa
--- /dev/null
+++ b/pkgs/haskell/blessings.nix
@@ -0,0 +1,16 @@
+{ mkDerivation, base, bytestring, fetchgit, hspec, QuickCheck, lib, mylib, text }:
+
+mkDerivation {
+ pname = "blessings";
+ version = "2.3.0";
+ src = fetchgit {
+ url = http://cgit.ni.krebsco.de/blessings;
+ rev = "refs/tags/v2.3.0";
+ hash = "sha256-fS79UOHBMfJHyz7E0Rx4lKZSZOD2G99h2zuDT+SOUJQ=";
+ };
+ libraryHaskellDepends = [ base bytestring text ];
+ testHaskellDepends = [ base hspec QuickCheck ];
+ doHaddock = false;
+ # WTFPL is the true license, which is unknown to cabal.
+ license = lib.licenses.wtfpl;
+}
diff --git a/pkgs/haskell/desktop-pager.nix b/pkgs/haskell/desktop-pager.nix
index 3b96159..8301235 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, scanner, speculate, split, terminal-size, text, unix
-, utf8-string, X11
+, probability, speculate, split, terminal-scanner, terminal-size
+, text, unix, utf8-string, X11
}:
mkDerivation {
pname = "desktop-pager";
version = "1.0.0";
src = fetchgit {
url = "https://cgit.krebsco.de/desktop-pager";
- sha256 = "11v4f2sz6p69fx2804w0akb8xqv56g89chjyx77jhwqcng2bn6pw";
- rev = "0894fbe50ee2f63b510d32ab8c524134e450f20d";
+ sha256 = "1hb8an31szwx9zixzb1m7219jrz3cdz57phf45r4b3n6qrzcn35l";
+ rev = "3919fb8adc06134a304d4fcbcd192c8707c06cbd";
fetchSubmodules = true;
};
isLibrary = true;
@@ -17,7 +17,7 @@ mkDerivation {
libraryHaskellDepends = [ base extra utf8-string X11 ];
executableHaskellDepends = [
aeson base blessings bytestring containers data-default hack
- optparse-applicative probability scanner speculate split
+ 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 f1b22b5..0eb0232 100644
--- a/pkgs/haskell/hack.nix
+++ b/pkgs/haskell/hack.nix
@@ -1,13 +1,14 @@
{ mkDerivation, base, blessings, containers, data-default, fetchgit
-, lens, lib, mtl, old-locale, process, input-scanner, time, unix, zippers
+, lens, lib, mtl, old-locale, process, terminal-scanner, time, unix
+, zippers
}:
mkDerivation {
pname = "hack";
- version = "1.0.2";
+ version = "1.0.3";
src = fetchgit {
url = "https://cgit.krebsco.de/hack";
- hash = "sha256-QHSGF4wFwLyn8W8jYbN1QajMnmQqUI+7VWk7yVvJgIg=";
- rev = "refs/tags/1.0.2";
+ sha256 = "04vxcfm204sxn3v48ch27srgqgpiqbm9i82lrmgp1yyx84wchq32";
+ rev = "a6fc1e51f1f87a7cc485a47000f23f1f054beb95";
fetchSubmodules = true;
};
isLibrary = true;
@@ -15,7 +16,8 @@ mkDerivation {
libraryHaskellDepends = [ base ];
executableHaskellDepends = [
base blessings containers data-default lens mtl old-locale process
- input-scanner time unix zippers
+ terminal-scanner time unix zippers
];
license = lib.licenses.mit;
+ mainProgram = "hack";
}
diff --git a/pkgs/haskell/much.nix b/pkgs/haskell/much.nix
index 865294d..9744a25 100644
--- a/pkgs/haskell/much.nix
+++ b/pkgs/haskell/much.nix
@@ -3,17 +3,17 @@
, 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, scanner
-, servant-server, split, terminal-size, text, time, transformers
-, transformers-compat, unix, vector, wai, warp
+, optparse-applicative, process, random, rosezipper, safe
+, servant-server, split, terminal-scanner, terminal-size, text
+, time, transformers, transformers-compat, unix, vector, wai, warp
}:
mkDerivation rec {
pname = "much";
version = "1.3.2";
src = fetchgit {
url = "https://cgit.krebsco.de/much";
- hash = "sha256-q65EYO1d3NYVv2NECkGWPb1TyHGdARNi/GX4pgQmljc=";
- rev = "refs/tags/${version}";
+ sha256 = "001lvn4f3pgxwq0fgxvk0jl33r54gvh908r6wx02fw4s6b3sysc0";
+ rev = "3a0fe1da7c33b024128079f5810c6a99b25aebe7";
fetchSubmodules = true;
};
isLibrary = true;
@@ -23,14 +23,15 @@ mkDerivation rec {
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 scanner servant-server split
- terminal-size text time transformers transformers-compat unix
- vector wai warp
+ process random rosezipper safe servant-server split
+ terminal-scanner terminal-size text 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 scanner text time transformers unix
+ process rosezipper safe terminal-scanner text time transformers
+ unix
];
license = lib.licenses.mit;
}
diff --git a/pkgs/haskell/terminal-scanner.nix b/pkgs/haskell/terminal-scanner.nix
new file mode 100644
index 0000000..4801df7
--- /dev/null
+++ b/pkgs/haskell/terminal-scanner.nix
@@ -0,0 +1,13 @@
+{ mkDerivation, base, fetchgit, lib }:
+mkDerivation {
+ pname = "terminal-scanner";
+ version = "1.0.1";
+ src = fetchgit {
+ url = "https://cgit.krebsco.de/terminal-scanner";
+ sha256 = "1ic8j2nlhmy76fnqji277wsl1cikd9y4lwqqcxzldjx1vi61r13r";
+ rev = "3c5301303230f563214c5ff003f9fc8e2e0a7199";
+ fetchSubmodules = true;
+ };
+ libraryHaskellDepends = [ base ];
+ license = lib.licenses.mit;
+}
diff --git a/pkgs/haskell/xmonad-tv/src/main.hs b/pkgs/haskell/xmonad-tv/src/main.hs
index 1878d8e..e3090a3 100644
--- a/pkgs/haskell/xmonad-tv/src/main.hs
+++ b/pkgs/haskell/xmonad-tv/src/main.hs
@@ -20,15 +20,13 @@ import XMonad.Extra (isFloatingX)
import System.IO (hPutStrLn, stderr)
import System.Environment (getArgs, getEnv, getEnvironment, lookupEnv)
import System.Posix.Process (executeFile)
-import XMonad.Actions.DynamicWorkspaces ( addWorkspacePrompt, renameWorkspace
- , removeEmptyWorkspace)
+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.ResizableTile (ResizableTall(ResizableTall))
import XMonad.Layout.ResizableTile (MirrorResize(MirrorExpand,MirrorShrink))
import XMonad.Layout.StateFull (pattern StateFull)
-import qualified XMonad.Prompt
import qualified XMonad.StackSet as W
import Data.Map (Map)
import qualified Data.Map as Map
@@ -72,11 +70,10 @@ readEnv' defaultValue name =
mainNoArgs :: IO ()
mainNoArgs = do
+ 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]
myScreenWidth <- readEnv "XMONAD_SCREEN_WIDTH" :: IO Dimension
- myTermFont <- getEnv "XMONAD_TERM_FONT"
- myTermFontWidth <- readEnv "XMONAD_TERM_FONT_WIDTH" :: IO Dimension
- myTermPadding <- readEnv "XMONAD_TERM_PADDING" :: IO Dimension
handleShutdownEvent <- newShutdownEventHandler
config <-
ewmhExtra
@@ -93,15 +90,15 @@ mainNoArgs = do
{ terminal = {-pkg:alacritty-tv-}"alacritty"
, clientMask = clientMask def .|. focusChangeMask
, modMask = mod4Mask
- , keys = myKeys myTermFont
+ , keys = myKeys
, layoutHook =
refocusLastLayoutHook $
gaps (zip [U,R,D,L] myScreenGaps) $
smartBorders $
ResizableTall
1
- (fromIntegral (10 * myTermFontWidth) / fromIntegral myScreenWidth)
- (fromIntegral (80 * myTermFontWidth + 2 * (myTermPadding + borderWidth def)) / fromIntegral myScreenWidth)
+ myMasterDelta
+ (myMasterWidth + 2 * fromIntegral (borderWidth def) / fromIntegral myScreenWidth)
[]
|||
StateFull
@@ -148,8 +145,8 @@ spawnRootTerm =
Nothing
-myKeys :: String -> XConfig Layout -> Map (KeyMask, KeySym) (X ())
-myKeys font conf = Map.fromList $
+myKeys :: XConfig Layout -> Map (KeyMask, KeySym) (X ())
+myKeys conf = Map.fromList $
[ ((_4 , xK_Escape ), forkFile {-pkg-}"slock" [] Nothing)
, ((_4S , xK_c ), kill)
@@ -185,8 +182,6 @@ myKeys font conf = Map.fromList $
, ((_4 , xK_comma ), sendMessage $ IncMasterN 1)
, ((_4 , xK_period ), sendMessage $ IncMasterN (-1))
- , ((_4 , xK_a ), addWorkspacePrompt promptXPConfig)
- , ((_4 , xK_r ), renameWorkspace promptXPConfig)
, ((_4 , xK_Delete ), removeEmptyWorkspace)
, ((_4 , xK_Return ), toggleWS)
@@ -215,7 +210,7 @@ myKeys font conf = Map.fromList $
_4CM = _4 .|. _C .|. _M
_4SM = _4 .|. _S .|. _M
- amixer args = forkFile {-pkg:alsaUtils-}"amixer" args Nothing
+ amixer args = forkFile {-pkg:alsa-utils-}"amixer" args Nothing
pavucontrol args = forkFile {-pkg-}"pavucontrol" args Nothing
audioLowerVolume = amixer ["-q", "sset", "Master", "5%-"]
@@ -225,14 +220,10 @@ myKeys font conf = Map.fromList $
resetLayout = setLayout $ XMonad.layoutHook conf
- promptXPConfig =
- def { XMonad.Prompt.font = font }
-
xdeny =
forkFile
{-pkg-}"xterm"
- [ "-fn", font
- , "-geometry", "300x100"
+ [ "-geometry", "300x100"
, "-name", "AlertFloat"
, "-bg", "#E4002B"
, "-e", "sleep", "0.05"
diff --git a/pkgs/override/htop.nix b/pkgs/override/htop.nix
new file mode 100644
index 0000000..38a19e0
--- /dev/null
+++ b/pkgs/override/htop.nix
@@ -0,0 +1,36 @@
+self: super:
+self.symlinkJoin {
+ name = "htop";
+ paths = [
+ (self.writeDashBin "htop" ''
+ export HTOPRC=${self.writeText "htoprc" ''
+ fields=0 48 17 18 38 39 40 2 46 47 49 1
+ sort_key=46
+ sort_direction=1
+ hide_threads=0
+ hide_kernel_threads=1
+ hide_userland_threads=0
+ shadow_other_users=1
+ show_thread_names=1
+ show_program_path=1
+ highlight_base_name=1
+ highlight_megabytes=1
+ highlight_threads=1
+ tree_view=1
+ header_margin=0
+ detailed_cpu_time=0
+ cpu_count_from_zero=0
+ update_process_names=0
+ account_guest_in_cpu_meter=1
+ color_scheme=0
+ delay=15
+ left_meters=LeftCPUs2 RightCPUs2 Memory Swap
+ left_meter_modes=1 1 1 1
+ right_meters=Uptime Tasks LoadAverage Battery
+ right_meter_modes=2 2 2 2
+ ''}
+ exec ${super.htop}/bin/htop "$@"
+ '')
+ super.htop
+ ];
+}
diff --git a/pkgs/shell/default.nix b/pkgs/shell/default.nix
index 119b23e..ce6123d 100644
--- a/pkgs/shell/default.nix
+++ b/pkgs/shell/default.nix
@@ -15,7 +15,11 @@ let
assert mylib.types.filename.check name;
assert isShellScript path;
self.callPackage
- ({ pkgs }: pkgs.runCommand "${name}" {} /* sh */ ''
+ ({ pkgs }: pkgs.runCommand "${name}" {
+ meta = {
+ mainProgram = name;
+ };
+ } /* sh */ ''
mkdir -p $out/bin
touch $out/bin/${name}
chmod +x $out/bin/${name}
diff --git a/pkgs/shell/genpasswd b/pkgs/shell/genpasswd
new file mode 100755
index 0000000..a6d96aa
--- /dev/null
+++ b/pkgs/shell/genpasswd
@@ -0,0 +1,56 @@
+#! /bin/sh
+#!buildShellBin path=coreutils
+#
+# NAME
+# genpasswd - generate a password
+#
+# SYNOPSIS
+# genpasswd [OPTION]...
+#
+# DESCRIPTION
+# Produce a random string of a given length and alphabet to standard
+# output.
+#
+# --length=number (default: 71)
+# Specify the number of bytes to produce.
+#
+# --alphabet=string (default: -+.,=/A-Za-z0-9_)
+# Specify the list of characters that can be produced.
+# The string gets interpreted by tr and may contain single-character
+# collating elements. See tr(1) for details.
+#
+# --newline=bool (default: true)
+# Specify whether a newline should be appended to the output.
+#
+
+set -efu
+
+alphabet=-+.,=/A-Za-z0-9_
+length=71
+newline=true
+
+while test $# -gt 0; do
+ case $1 in
+ --alphabet=*)
+ alphabet=${1//--alphabet=}
+ shift
+ ;;
+ --length=*)
+ length=${1//--length=}
+ shift
+ ;;
+ --newline=true|--newline=false)
+ newline=${1//--newline=}
+ shift
+ ;;
+ *)
+ echo "$0: bad argument: $1" >&2
+ exit 1
+ esac
+done
+
+tr -dc -- "$alphabet" < /dev/urandom | dd status=none bs="$length" count=1
+
+case $newline in true)
+ echo
+esac
diff --git a/pkgs/shell/with-ssh b/pkgs/shell/with-ssh
new file mode 100755
index 0000000..65459e2
--- /dev/null
+++ b/pkgs/shell/with-ssh
@@ -0,0 +1,37 @@
+#! /bin/sh
+#!buildShellBin prepend-path=openssh
+#
+# usage: with-ssh [--add[=KEY] ...] [COMMAND [ARGS ...]]
+#
+
+set -efu
+
+case ${WITH_SSH_STAGE-1} in
+ 1)
+ export WITH_SSH_STAGE=2
+ exec ssh-agent "$0" "$@"
+ ;;
+ 2)
+ if test $# = 0; then
+ set -- "$SHELL"
+ fi
+ case "$1" in
+ --add)
+ shift
+ ssh-add
+ exec "$0"
+ ;;
+ --add=*)
+ key=$1; shift
+ key=${key#--add=}
+ ssh-add "$key"
+ exec "$0" "$@"
+ ;;
+ *)
+ exec "$@"
+ esac
+ ;;
+ *)
+ echo "with-ssh: error: bad stage: $WITH_SSH_STAGE" >&2
+ exit 1
+esac
diff --git a/pkgs/simple/alacritty-tv.nix b/pkgs/simple/alacritty-tv.nix
index 0e65434..bea5776 100644
--- a/pkgs/simple/alacritty-tv.nix
+++ b/pkgs/simple/alacritty-tv.nix
@@ -7,7 +7,7 @@ pkgs.symlinkJoin {
# usage:
# alacritty [--profile=PROFILE] [--singleton] [ARGS...]
# where
- # PROFILE must have a corresponding file /etc/alacritty/PROFILE.json
+ # PROFILE must have a corresponding file /etc/alacritty/PROFILE.toml
set -efu
@@ -18,12 +18,12 @@ pkgs.symlinkJoin {
shift
esac
- config=/etc/alacritty/$profile.json
+ config=/etc/alacritty/$profile.toml
if ! test -e "$config"; then
echo "$0: warning: bad profile: $profile; using default instead" >&2
profile=default
- config=/etc/alacritty/default.json
+ config=/etc/alacritty/default.toml
fi
case ''${1-} in
diff --git a/pkgs/simple/editor-input.nix b/pkgs/simple/editor-input.nix
index 931179a..536084d 100644
--- a/pkgs/simple/editor-input.nix
+++ b/pkgs/simple/editor-input.nix
@@ -5,7 +5,7 @@ pkgs.writeDashBin "editor-input" ''
${pkgs.with-tmpdir}/bin/with-tmpdir -t editor-input.XXXXXXXX \
${pkgs.writeDash "editor-input.sh" ''
f=$TMPDIR/input
- ${pkgs.rxvt_unicode}/bin/urxvt -name editor-input-urxvt -e \
+ ${pkgs.rxvt-unicode-unwrapped}/bin/urxvt -name editor-input-urxvt -e \
${pkgs.vim}/bin/vim --cmd ':set noeol binary' -c startinsert "$f"
if test -e "$f"; then
${pkgs.xsel}/bin/xsel -ip < "$f"
diff --git a/pkgs/simple/ff.nix b/pkgs/simple/ff.nix
index b6022c6..355c3ec 100644
--- a/pkgs/simple/ff.nix
+++ b/pkgs/simple/ff.nix
@@ -4,5 +4,5 @@ pkgs.writeDashBin "ff" ''
case $TOUCHSCREEN in 1)
export MOZ_USE_XINPUT2=1
esac
- exec ${pkgs.firefox}/bin/firefox "$@"
+ exec ${lib.getExe pkgs.librewolf} "$@"
''
diff --git a/pkgs/simple/pinentry-urxvt/default.nix b/pkgs/simple/pinentry-urxvt/default.nix
index 6868207..808d00a 100644
--- a/pkgs/simple/pinentry-urxvt/default.nix
+++ b/pkgs/simple/pinentry-urxvt/default.nix
@@ -102,7 +102,7 @@ in
''}
exec 3<&0 4>&1 5>&2
- ${pkgs.rxvt_unicode}/bin/urxvt \
+ ${pkgs.rxvt-unicode-unwrapped}/bin/urxvt \
-name ${mylib.shell.escape cfg.appName} \
-e ${pkgs.writeDash "pinentry-urxvt-tty" ''
set -efu
diff --git a/pkgs/simple/q/default.nix b/pkgs/simple/q/default.nix
index a1e60e3..ca4a466 100644
--- a/pkgs/simple/q/default.nix
+++ b/pkgs/simple/q/default.nix
@@ -83,13 +83,13 @@ let
q-net = /* sh */ ''
for dev in $(
- ${pkgs.iproute}/bin/ip a |
+ ${pkgs.iproute2}/bin/ip a |
${pkgs.gnused}/bin/sed -rn 's/^[0-9]+: ([^:]+):.*/\1/p' |
${pkgs.gnugrep}/bin/grep -Ev '^(lo|retiolum|wiregrill)$'
# TODO wiregrill ping ni.w, retiolum ping ni.r
); do
{
- inet=$(${pkgs.iproute}/bin/ip addr show $dev \
+ inet=$(${pkgs.iproute2}/bin/ip addr show $dev \
| ${pkgs.gnused}/bin/sed -n '
s/.*inet \([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/p
')
diff --git a/pkgs/simple/rxvt-unicode-256color-terminfo/default.nix b/pkgs/simple/rxvt-unicode-256color-terminfo/default.nix
index d2f6f46..8bfd1e8 100644
--- a/pkgs/simple/rxvt-unicode-256color-terminfo/default.nix
+++ b/pkgs/simple/rxvt-unicode-256color-terminfo/default.nix
@@ -1,5 +1,5 @@
# This package is mainly intended for cross-built systems for which we cannot
-# or don't want to build pkgs.rxvt_unicode for some reason.
+# or don't want to build pkgs.rxvt-unicode-unwrapped for some reason.
#
# ${./rxvt-unicode-256color.terminfo} was copied from a previously built
# /run/current-system/sw/share/terminfo/r/rxvt-unicode-256color
diff --git a/pkgs/simple/xkiller.nix b/pkgs/simple/xkiller.nix
index 8d8f016..9d83047 100644
--- a/pkgs/simple/xkiller.nix
+++ b/pkgs/simple/xkiller.nix
@@ -2,7 +2,7 @@
pkgs.writeDash "xkiller" ''
set -efu
exec >&2
- ${pkgs.iproute}/bin/ss -lp src unix:/tmp/.X11-unix/X* |
+ ${pkgs.iproute2}/bin/ss -lp src unix:/tmp/.X11-unix/X* |
${pkgs.gnused}/bin/sed -n '
s|.*/tmp/.X11-unix/X\([0-9]\+\)\>.*("X[^"]*",pid=\([0-9]\+\)\>.*|\1 \2|p
' |