From 81b001e825e08007b8751d128b6388a50208ed7c Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 10 Apr 2018 13:25:51 +0200 Subject: tv pass: init at 1.7.1 Import from nixpkgs 09bca91e3b5a18d7f37f7632175ac71f2bf369ff. --- tv/5pkgs/simple/pass/default.nix | 111 +++++++++++++++++++++ tv/5pkgs/simple/pass/no-darwin-getopt.patch | 9 ++ tv/5pkgs/simple/pass/rofi-pass.nix | 57 +++++++++++ .../pass/set-correct-program-name-for-sleep.patch | 69 +++++++++++++ 4 files changed, 246 insertions(+) create mode 100644 tv/5pkgs/simple/pass/default.nix create mode 100644 tv/5pkgs/simple/pass/no-darwin-getopt.patch create mode 100644 tv/5pkgs/simple/pass/rofi-pass.nix create mode 100644 tv/5pkgs/simple/pass/set-correct-program-name-for-sleep.patch diff --git a/tv/5pkgs/simple/pass/default.nix b/tv/5pkgs/simple/pass/default.nix new file mode 100644 index 000000000..ad2afa8ed --- /dev/null +++ b/tv/5pkgs/simple/pass/default.nix @@ -0,0 +1,111 @@ +{ stdenv, lib, fetchurl, fetchFromGitHub +, coreutils, gnused, getopt, git, tree, gnupg, which, procps, qrencode +, makeWrapper + +, xclip ? null, xdotool ? null, dmenu ? null +, x11Support ? !stdenv.isDarwin +, tombPluginSupport ? false, tomb +}: + +with lib; + +assert x11Support -> xclip != null + && xdotool != null + && dmenu != null; + +let + plugins = map (p: (fetchFromGitHub { + owner = "roddhjav"; + repo = "pass-${p.name}"; + inherit (p) rev sha256; + })) + ([ + { name = "import"; + rev = "491935bd275f29ceac2b876b3a288011d1ce31e7"; + sha256 = "02mbh05ab8h7kc30hz718d1d1vkjz43b96c7p0xnd92610d2q66q"; } + { name = "update"; + rev = "cf576c9036fd18efb9ed29e0e9f811207b556fde"; + sha256 = "1hhbrg6a2walrvla6q4cd3pgrqbcrf9brzjkb748735shxfn52hd"; } + ] ++ stdenv.lib.optional tombPluginSupport { + name = "tomb"; + rev = "3368134898a42c1b758fabac625ec240e125c6be"; + sha256 = "0qqmxfg4w3r088qhlkhs44036mya82vjflsjjhw2hk8y0wd2i6ds"; } + ); + +in stdenv.mkDerivation rec { + version = "1.7.1"; + name = "password-store-${version}"; + + src = fetchurl { + url = "http://git.zx2c4.com/password-store/snapshot/${name}.tar.xz"; + sha256 = "0scqkpll2q8jhzcgcsh9kqz0gwdpvynivqjmmbzax2irjfaiklpn"; + }; + + patches = [ ./set-correct-program-name-for-sleep.patch + ] ++ stdenv.lib.optional stdenv.isDarwin ./no-darwin-getopt.patch; + + nativeBuildInputs = [ makeWrapper ]; + + installFlags = [ "PREFIX=$(out)" "WITH_ALLCOMP=yes" ]; + + postInstall = '' + # plugins + ${stdenv.lib.concatStringsSep "\n" (map (plugin: '' + pushd ${plugin} + PREFIX=$out make install + popd + '') plugins)} + + # Install Emacs Mode. NOTE: We can't install the necessary + # dependencies (s.el and f.el) here. The user has to do this + # himself. + mkdir -p "$out/share/emacs/site-lisp" + cp "contrib/emacs/password-store.el" "$out/share/emacs/site-lisp/" + '' + optionalString x11Support '' + cp "contrib/dmenu/passmenu" "$out/bin/" + ''; + + wrapperPath = with stdenv.lib; makeBinPath ([ + coreutils + getopt + git + gnupg + gnused + tree + which + qrencode + ] ++ optional tombPluginSupport tomb + ++ optional stdenv.isLinux procps + ++ ifEnable x11Support [ dmenu xclip xdotool ]); + + postFixup = '' + # Fix program name in --help + substituteInPlace $out/bin/pass \ + --replace 'PROGRAM="''${0##*/}"' "PROGRAM=pass" + + # Ensure all dependencies are in PATH + wrapProgram $out/bin/pass \ + --prefix PATH : "${wrapperPath}" + '' + stdenv.lib.optionalString x11Support '' + # We just wrap passmenu with the same PATH as pass. It doesn't + # need all the tools in there but it doesn't hurt either. + wrapProgram $out/bin/passmenu \ + --prefix PATH : "$out/bin:${wrapperPath}" + ''; + + meta = with stdenv.lib; { + description = "Stores, retrieves, generates, and synchronizes passwords securely"; + homepage = https://www.passwordstore.org/; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ lovek323 the-kenny fpletz ]; + platforms = platforms.unix; + + longDescription = '' + pass is a very simple password store that keeps passwords inside gpg2 + encrypted files inside a simple directory tree residing at + ~/.password-store. The pass utility provides a series of commands for + manipulating the password store, allowing the user to add, remove, edit, + synchronize, generate, and manipulate passwords. + ''; + }; +} diff --git a/tv/5pkgs/simple/pass/no-darwin-getopt.patch b/tv/5pkgs/simple/pass/no-darwin-getopt.patch new file mode 100644 index 000000000..e8f7e138f --- /dev/null +++ b/tv/5pkgs/simple/pass/no-darwin-getopt.patch @@ -0,0 +1,9 @@ +diff -Naur password-store-1.6.5-orig/src/platform/darwin.sh password-store-1.6.5/src/platform/darwin.sh +--- password-store-1.6.5-orig/src/platform/darwin.sh 2015-01-28 16:43:02.000000000 +0000 ++++ password-store-1.6.5/src/platform/darwin.sh 2015-02-15 16:09:02.000000000 +0000 +@@ -31,5 +31,4 @@ + mount -t hfs -o noatime -o nobrowse "$DARWIN_RAMDISK_DEV" "$SECURE_TMPDIR" || die "Error: could not mount filesystem on ramdisk." + } + +-GETOPT="$(brew --prefix gnu-getopt 2>/dev/null || { which port &>/dev/null && echo /opt/local; } || echo /usr/local)/bin/getopt" + SHRED="srm -f -z" diff --git a/tv/5pkgs/simple/pass/rofi-pass.nix b/tv/5pkgs/simple/pass/rofi-pass.nix new file mode 100644 index 000000000..61f51973e --- /dev/null +++ b/tv/5pkgs/simple/pass/rofi-pass.nix @@ -0,0 +1,57 @@ +{ stdenv, fetchFromGitHub, pass, rofi, coreutils, utillinux, xdotool, gnugrep +, libnotify, pwgen, findutils, gawk, gnused, xclip, makeWrapper +}: + +stdenv.mkDerivation rec { + name = "rofi-pass-${version}"; + version = "1.5.3"; + + src = fetchFromGitHub { + owner = "carnager"; + repo = "rofi-pass"; + rev = version; + sha256 = "1fn1j2rf3abc5qb44zfc8z8ffw6rva4xfp7597hwr1g3szacazpq"; + }; + + buildInputs = [ makeWrapper ]; + + dontBuild = true; + + installPhase = '' + mkdir -p $out/bin + cp -a rofi-pass $out/bin/rofi-pass + + mkdir -p $out/share/doc/rofi-pass/ + cp -a config.example $out/share/doc/rofi-pass/config.example + ''; + + wrapperPath = with stdenv.lib; makeBinPath [ + coreutils + findutils + gawk + gnugrep + gnused + libnotify + pass + pwgen + rofi + utillinux + xclip + xdotool + ]; + + fixupPhase = '' + patchShebangs $out/bin + + wrapProgram $out/bin/rofi-pass \ + --prefix PATH : "${wrapperPath}" + ''; + + meta = { + description = "A script to make rofi work with password-store"; + homepage = https://github.com/carnager/rofi-pass; + maintainers = with stdenv.lib.maintainers; [ the-kenny garbas ]; + license = stdenv.lib.licenses.gpl3; + platforms = with stdenv.lib.platforms; linux; + }; +} diff --git a/tv/5pkgs/simple/pass/set-correct-program-name-for-sleep.patch b/tv/5pkgs/simple/pass/set-correct-program-name-for-sleep.patch new file mode 100644 index 000000000..782e06e20 --- /dev/null +++ b/tv/5pkgs/simple/pass/set-correct-program-name-for-sleep.patch @@ -0,0 +1,69 @@ +From 25b44e00ed5df8ffe2782d38ad5cd9f514379599 Mon Sep 17 00:00:00 2001 +From: "Andrew R. M" +Date: Sat, 8 Apr 2017 13:50:01 -0400 +Subject: [PATCH] Patch the clip() function to work even when using + single-binary coreutils + +--- + src/password-store.sh | 4 ++-- + src/platform/cygwin.sh | 4 ++-- + src/platform/darwin.sh | 4 ++-- + 3 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/src/password-store.sh b/src/password-store.sh +index 6a4172d..4dbd6b8 100755 +--- a/src/password-store.sh ++++ b/src/password-store.sh +@@ -155,11 +155,11 @@ clip() { + # variable. Specifically, it cannot store nulls nor (non-trivally) store + # trailing new lines. + local sleep_argv0="password store sleep on display $DISPLAY" +- pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5 ++ pkill -P $(pgrep -f "^$sleep_argv0") 2>/dev/null && sleep 0.5 + local before="$(xclip -o -selection "$X_SELECTION" 2>/dev/null | base64)" + echo -n "$1" | xclip -selection "$X_SELECTION" || die "Error: Could not copy data to the clipboard" + ( +- ( exec -a "$sleep_argv0" bash <<<"trap 'kill %1' TERM; sleep '$CLIP_TIME' & wait" ) ++ ( exec -a "$sleep_argv0" bash <(echo trap 'kill %1' TERM\; sleep "$CLIP_TIME & wait") ) + local now="$(xclip -o -selection "$X_SELECTION" | base64)" + [[ $now != $(echo -n "$1" | base64) ]] && before="$now" + +diff --git a/src/platform/cygwin.sh b/src/platform/cygwin.sh +index 6e5dd86..f3574c4 100644 +--- a/src/platform/cygwin.sh ++++ b/src/platform/cygwin.sh +@@ -3,11 +3,11 @@ + + clip() { + local sleep_argv0="password store sleep on display $DISPLAY" +- pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5 ++ pkill -P $(pgrep -f "^$sleep_argv0") 2>/dev/null && sleep 0.5 + local before="$(base64 < /dev/clipboard)" + echo -n "$1" > /dev/clipboard + ( +- ( exec -a "$sleep_argv0" sleep "$CLIP_TIME" ) ++ ( exec -a "$sleep_argv0" bash <(echo sleep "$CLIP_TIME") ) + local now="$(base64 < /dev/clipboard)" + [[ $now != $(echo -n "$1" | base64) ]] && before="$now" + echo "$before" | base64 -d > /dev/clipboard +diff --git a/src/platform/darwin.sh b/src/platform/darwin.sh +index 86eb325..deb04c4 100644 +--- a/src/platform/darwin.sh ++++ b/src/platform/darwin.sh +@@ -3,11 +3,11 @@ + + clip() { + local sleep_argv0="password store sleep for user $(id -u)" +- pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5 ++ pkill -P $(pgrep -f "^$sleep_argv0") 2>/dev/null && sleep 0.5 + local before="$(pbpaste | openssl base64)" + echo -n "$1" | pbcopy + ( +- ( exec -a "$sleep_argv0" sleep "$CLIP_TIME" ) ++ ( exec -a "$sleep_argv0" bash <(echo sleep "$CLIP_TIME") ) + local now="$(pbpaste | openssl base64)" + [[ $now != $(echo -n "$1" | openssl base64) ]] && before="$now" + echo "$before" | openssl base64 -d | pbcopy +-- +2.12.2 + -- cgit v1.2.3 From 5bf85816d3c8b0e37a6f6a6ff2eaafc059b5199c Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 10 Apr 2018 13:26:50 +0200 Subject: tv pass-otp: init at 1.1.0 Import from nixpkgs 09bca91e3b5a18d7f37f7632175ac71f2bf369ff. --- tv/5pkgs/simple/pass-otp/default.nix | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tv/5pkgs/simple/pass-otp/default.nix diff --git a/tv/5pkgs/simple/pass-otp/default.nix b/tv/5pkgs/simple/pass-otp/default.nix new file mode 100644 index 000000000..7f0f44bdf --- /dev/null +++ b/tv/5pkgs/simple/pass-otp/default.nix @@ -0,0 +1,30 @@ +{ stdenv, pass, fetchFromGitHub, oathToolkit }: +stdenv.mkDerivation rec { + name = "pass-otp-${version}"; + version = "1.1.0"; + + src = fetchFromGitHub { + owner = "tadfisher"; + repo = "pass-otp"; + rev = "v${version}"; + sha256 = "1cgj4zc8fq88n3h6c0vkv9i5al785mdprpgpbv5m22dz9p1wqvbb"; + }; + + buildInputs = [ pass oathToolkit ]; + + patchPhase = '' + sed -i -e 's|OATH=\$(which oathtool)|OATH=${oathToolkit}/bin/oathtool|' otp.bash + ''; + + installPhase = '' + make PREFIX=$out install + ''; + + meta = with stdenv.lib; { + description = "A pass extension for managing one-time-password (OTP) tokens"; + homepage = https://github.com/tadfisher/pass-otp; + license = licenses.gpl3; + maintainers = with maintainers; [ jwiegley tadfisher ]; + platforms = platforms.unix; + }; +} -- cgit v1.2.3 From a426bfd1bda89cc1af901f6196a323d7be4e4865 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 10 Apr 2018 13:27:34 +0200 Subject: tv: make pass and pass-otp work together pass's name argument has been modified to work with tv/5pkgs/simple/default.nix's callPackage. --- tv/5pkgs/simple/pass-otp/default.nix | 4 ++-- tv/5pkgs/simple/pass/default.nix | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/tv/5pkgs/simple/pass-otp/default.nix b/tv/5pkgs/simple/pass-otp/default.nix index 7f0f44bdf..33411180a 100644 --- a/tv/5pkgs/simple/pass-otp/default.nix +++ b/tv/5pkgs/simple/pass-otp/default.nix @@ -1,4 +1,4 @@ -{ stdenv, pass, fetchFromGitHub, oathToolkit }: +{ stdenv, fetchFromGitHub, oathToolkit }: stdenv.mkDerivation rec { name = "pass-otp-${version}"; version = "1.1.0"; @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { sha256 = "1cgj4zc8fq88n3h6c0vkv9i5al785mdprpgpbv5m22dz9p1wqvbb"; }; - buildInputs = [ pass oathToolkit ]; + buildInputs = [ oathToolkit ]; patchPhase = '' sed -i -e 's|OATH=\$(which oathtool)|OATH=${oathToolkit}/bin/oathtool|' otp.bash diff --git a/tv/5pkgs/simple/pass/default.nix b/tv/5pkgs/simple/pass/default.nix index ad2afa8ed..3b6928087 100644 --- a/tv/5pkgs/simple/pass/default.nix +++ b/tv/5pkgs/simple/pass/default.nix @@ -2,6 +2,8 @@ , coreutils, gnused, getopt, git, tree, gnupg, which, procps, qrencode , makeWrapper +, pass-otp + , xclip ? null, xdotool ? null, dmenu ? null , x11Support ? !stdenv.isDarwin , tombPluginSupport ? false, tomb @@ -34,7 +36,7 @@ let in stdenv.mkDerivation rec { version = "1.7.1"; - name = "password-store-${version}"; + name = "pass-${version}"; src = fetchurl { url = "http://git.zx2c4.com/password-store/snapshot/${name}.tar.xz"; @@ -56,6 +58,14 @@ in stdenv.mkDerivation rec { popd '') plugins)} + ln -s \ + ${pass-otp}/lib/password-store/extensions/otp.bash \ + $out/lib/password-store/extensions/ + + ln -s \ + ${pass-otp}/share/man/man1/pass-otp.1.gz \ + $out/share/man/man1/ + # Install Emacs Mode. NOTE: We can't install the necessary # dependencies (s.el and f.el) here. The user has to do this # himself. -- cgit v1.2.3 From 3f9cbbc8d1f5420ef276633f087e63f700c386e7 Mon Sep 17 00:00:00 2001 From: jeschli Date: Tue, 10 Apr 2018 18:15:02 +0200 Subject: j brauerei: +rust, +exercism, *minor cosmetics --- jeschli/1systems/brauerei/config.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jeschli/1systems/brauerei/config.nix b/jeschli/1systems/brauerei/config.nix index 1203720a5..b0bd74789 100644 --- a/jeschli/1systems/brauerei/config.nix +++ b/jeschli/1systems/brauerei/config.nix @@ -57,7 +57,6 @@ terminator tmux wget - # rxvt_unicode # editors emacs # internet @@ -65,6 +64,7 @@ chromium google-chrome # programming languages + exercism go gcc ghc @@ -73,6 +73,9 @@ # go tools golint gotools + # rust + cargo + rustc # dev tools gnumake jetbrains.pycharm-professional -- cgit v1.2.3 From 68ceb8df1318a87f0b121eda5a2a29eab360d578 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 10 Apr 2018 22:06:03 +0200 Subject: pass{,-otp}: init from tv --- krebs/5pkgs/simple/pass-otp/default.nix | 30 +++++ krebs/5pkgs/simple/pass/default.nix | 121 +++++++++++++++++++++ krebs/5pkgs/simple/pass/no-darwin-getopt.patch | 9 ++ krebs/5pkgs/simple/pass/rofi-pass.nix | 57 ++++++++++ .../pass/set-correct-program-name-for-sleep.patch | 69 ++++++++++++ tv/5pkgs/simple/pass-otp/default.nix | 30 ----- tv/5pkgs/simple/pass/default.nix | 121 --------------------- tv/5pkgs/simple/pass/no-darwin-getopt.patch | 9 -- tv/5pkgs/simple/pass/rofi-pass.nix | 57 ---------- .../pass/set-correct-program-name-for-sleep.patch | 69 ------------ 10 files changed, 286 insertions(+), 286 deletions(-) create mode 100644 krebs/5pkgs/simple/pass-otp/default.nix create mode 100644 krebs/5pkgs/simple/pass/default.nix create mode 100644 krebs/5pkgs/simple/pass/no-darwin-getopt.patch create mode 100644 krebs/5pkgs/simple/pass/rofi-pass.nix create mode 100644 krebs/5pkgs/simple/pass/set-correct-program-name-for-sleep.patch delete mode 100644 tv/5pkgs/simple/pass-otp/default.nix delete mode 100644 tv/5pkgs/simple/pass/default.nix delete mode 100644 tv/5pkgs/simple/pass/no-darwin-getopt.patch delete mode 100644 tv/5pkgs/simple/pass/rofi-pass.nix delete mode 100644 tv/5pkgs/simple/pass/set-correct-program-name-for-sleep.patch diff --git a/krebs/5pkgs/simple/pass-otp/default.nix b/krebs/5pkgs/simple/pass-otp/default.nix new file mode 100644 index 000000000..33411180a --- /dev/null +++ b/krebs/5pkgs/simple/pass-otp/default.nix @@ -0,0 +1,30 @@ +{ stdenv, fetchFromGitHub, oathToolkit }: +stdenv.mkDerivation rec { + name = "pass-otp-${version}"; + version = "1.1.0"; + + src = fetchFromGitHub { + owner = "tadfisher"; + repo = "pass-otp"; + rev = "v${version}"; + sha256 = "1cgj4zc8fq88n3h6c0vkv9i5al785mdprpgpbv5m22dz9p1wqvbb"; + }; + + buildInputs = [ oathToolkit ]; + + patchPhase = '' + sed -i -e 's|OATH=\$(which oathtool)|OATH=${oathToolkit}/bin/oathtool|' otp.bash + ''; + + installPhase = '' + make PREFIX=$out install + ''; + + meta = with stdenv.lib; { + description = "A pass extension for managing one-time-password (OTP) tokens"; + homepage = https://github.com/tadfisher/pass-otp; + license = licenses.gpl3; + maintainers = with maintainers; [ jwiegley tadfisher ]; + platforms = platforms.unix; + }; +} diff --git a/krebs/5pkgs/simple/pass/default.nix b/krebs/5pkgs/simple/pass/default.nix new file mode 100644 index 000000000..3b6928087 --- /dev/null +++ b/krebs/5pkgs/simple/pass/default.nix @@ -0,0 +1,121 @@ +{ stdenv, lib, fetchurl, fetchFromGitHub +, coreutils, gnused, getopt, git, tree, gnupg, which, procps, qrencode +, makeWrapper + +, pass-otp + +, xclip ? null, xdotool ? null, dmenu ? null +, x11Support ? !stdenv.isDarwin +, tombPluginSupport ? false, tomb +}: + +with lib; + +assert x11Support -> xclip != null + && xdotool != null + && dmenu != null; + +let + plugins = map (p: (fetchFromGitHub { + owner = "roddhjav"; + repo = "pass-${p.name}"; + inherit (p) rev sha256; + })) + ([ + { name = "import"; + rev = "491935bd275f29ceac2b876b3a288011d1ce31e7"; + sha256 = "02mbh05ab8h7kc30hz718d1d1vkjz43b96c7p0xnd92610d2q66q"; } + { name = "update"; + rev = "cf576c9036fd18efb9ed29e0e9f811207b556fde"; + sha256 = "1hhbrg6a2walrvla6q4cd3pgrqbcrf9brzjkb748735shxfn52hd"; } + ] ++ stdenv.lib.optional tombPluginSupport { + name = "tomb"; + rev = "3368134898a42c1b758fabac625ec240e125c6be"; + sha256 = "0qqmxfg4w3r088qhlkhs44036mya82vjflsjjhw2hk8y0wd2i6ds"; } + ); + +in stdenv.mkDerivation rec { + version = "1.7.1"; + name = "pass-${version}"; + + src = fetchurl { + url = "http://git.zx2c4.com/password-store/snapshot/${name}.tar.xz"; + sha256 = "0scqkpll2q8jhzcgcsh9kqz0gwdpvynivqjmmbzax2irjfaiklpn"; + }; + + patches = [ ./set-correct-program-name-for-sleep.patch + ] ++ stdenv.lib.optional stdenv.isDarwin ./no-darwin-getopt.patch; + + nativeBuildInputs = [ makeWrapper ]; + + installFlags = [ "PREFIX=$(out)" "WITH_ALLCOMP=yes" ]; + + postInstall = '' + # plugins + ${stdenv.lib.concatStringsSep "\n" (map (plugin: '' + pushd ${plugin} + PREFIX=$out make install + popd + '') plugins)} + + ln -s \ + ${pass-otp}/lib/password-store/extensions/otp.bash \ + $out/lib/password-store/extensions/ + + ln -s \ + ${pass-otp}/share/man/man1/pass-otp.1.gz \ + $out/share/man/man1/ + + # Install Emacs Mode. NOTE: We can't install the necessary + # dependencies (s.el and f.el) here. The user has to do this + # himself. + mkdir -p "$out/share/emacs/site-lisp" + cp "contrib/emacs/password-store.el" "$out/share/emacs/site-lisp/" + '' + optionalString x11Support '' + cp "contrib/dmenu/passmenu" "$out/bin/" + ''; + + wrapperPath = with stdenv.lib; makeBinPath ([ + coreutils + getopt + git + gnupg + gnused + tree + which + qrencode + ] ++ optional tombPluginSupport tomb + ++ optional stdenv.isLinux procps + ++ ifEnable x11Support [ dmenu xclip xdotool ]); + + postFixup = '' + # Fix program name in --help + substituteInPlace $out/bin/pass \ + --replace 'PROGRAM="''${0##*/}"' "PROGRAM=pass" + + # Ensure all dependencies are in PATH + wrapProgram $out/bin/pass \ + --prefix PATH : "${wrapperPath}" + '' + stdenv.lib.optionalString x11Support '' + # We just wrap passmenu with the same PATH as pass. It doesn't + # need all the tools in there but it doesn't hurt either. + wrapProgram $out/bin/passmenu \ + --prefix PATH : "$out/bin:${wrapperPath}" + ''; + + meta = with stdenv.lib; { + description = "Stores, retrieves, generates, and synchronizes passwords securely"; + homepage = https://www.passwordstore.org/; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ lovek323 the-kenny fpletz ]; + platforms = platforms.unix; + + longDescription = '' + pass is a very simple password store that keeps passwords inside gpg2 + encrypted files inside a simple directory tree residing at + ~/.password-store. The pass utility provides a series of commands for + manipulating the password store, allowing the user to add, remove, edit, + synchronize, generate, and manipulate passwords. + ''; + }; +} diff --git a/krebs/5pkgs/simple/pass/no-darwin-getopt.patch b/krebs/5pkgs/simple/pass/no-darwin-getopt.patch new file mode 100644 index 000000000..e8f7e138f --- /dev/null +++ b/krebs/5pkgs/simple/pass/no-darwin-getopt.patch @@ -0,0 +1,9 @@ +diff -Naur password-store-1.6.5-orig/src/platform/darwin.sh password-store-1.6.5/src/platform/darwin.sh +--- password-store-1.6.5-orig/src/platform/darwin.sh 2015-01-28 16:43:02.000000000 +0000 ++++ password-store-1.6.5/src/platform/darwin.sh 2015-02-15 16:09:02.000000000 +0000 +@@ -31,5 +31,4 @@ + mount -t hfs -o noatime -o nobrowse "$DARWIN_RAMDISK_DEV" "$SECURE_TMPDIR" || die "Error: could not mount filesystem on ramdisk." + } + +-GETOPT="$(brew --prefix gnu-getopt 2>/dev/null || { which port &>/dev/null && echo /opt/local; } || echo /usr/local)/bin/getopt" + SHRED="srm -f -z" diff --git a/krebs/5pkgs/simple/pass/rofi-pass.nix b/krebs/5pkgs/simple/pass/rofi-pass.nix new file mode 100644 index 000000000..61f51973e --- /dev/null +++ b/krebs/5pkgs/simple/pass/rofi-pass.nix @@ -0,0 +1,57 @@ +{ stdenv, fetchFromGitHub, pass, rofi, coreutils, utillinux, xdotool, gnugrep +, libnotify, pwgen, findutils, gawk, gnused, xclip, makeWrapper +}: + +stdenv.mkDerivation rec { + name = "rofi-pass-${version}"; + version = "1.5.3"; + + src = fetchFromGitHub { + owner = "carnager"; + repo = "rofi-pass"; + rev = version; + sha256 = "1fn1j2rf3abc5qb44zfc8z8ffw6rva4xfp7597hwr1g3szacazpq"; + }; + + buildInputs = [ makeWrapper ]; + + dontBuild = true; + + installPhase = '' + mkdir -p $out/bin + cp -a rofi-pass $out/bin/rofi-pass + + mkdir -p $out/share/doc/rofi-pass/ + cp -a config.example $out/share/doc/rofi-pass/config.example + ''; + + wrapperPath = with stdenv.lib; makeBinPath [ + coreutils + findutils + gawk + gnugrep + gnused + libnotify + pass + pwgen + rofi + utillinux + xclip + xdotool + ]; + + fixupPhase = '' + patchShebangs $out/bin + + wrapProgram $out/bin/rofi-pass \ + --prefix PATH : "${wrapperPath}" + ''; + + meta = { + description = "A script to make rofi work with password-store"; + homepage = https://github.com/carnager/rofi-pass; + maintainers = with stdenv.lib.maintainers; [ the-kenny garbas ]; + license = stdenv.lib.licenses.gpl3; + platforms = with stdenv.lib.platforms; linux; + }; +} diff --git a/krebs/5pkgs/simple/pass/set-correct-program-name-for-sleep.patch b/krebs/5pkgs/simple/pass/set-correct-program-name-for-sleep.patch new file mode 100644 index 000000000..782e06e20 --- /dev/null +++ b/krebs/5pkgs/simple/pass/set-correct-program-name-for-sleep.patch @@ -0,0 +1,69 @@ +From 25b44e00ed5df8ffe2782d38ad5cd9f514379599 Mon Sep 17 00:00:00 2001 +From: "Andrew R. M" +Date: Sat, 8 Apr 2017 13:50:01 -0400 +Subject: [PATCH] Patch the clip() function to work even when using + single-binary coreutils + +--- + src/password-store.sh | 4 ++-- + src/platform/cygwin.sh | 4 ++-- + src/platform/darwin.sh | 4 ++-- + 3 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/src/password-store.sh b/src/password-store.sh +index 6a4172d..4dbd6b8 100755 +--- a/src/password-store.sh ++++ b/src/password-store.sh +@@ -155,11 +155,11 @@ clip() { + # variable. Specifically, it cannot store nulls nor (non-trivally) store + # trailing new lines. + local sleep_argv0="password store sleep on display $DISPLAY" +- pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5 ++ pkill -P $(pgrep -f "^$sleep_argv0") 2>/dev/null && sleep 0.5 + local before="$(xclip -o -selection "$X_SELECTION" 2>/dev/null | base64)" + echo -n "$1" | xclip -selection "$X_SELECTION" || die "Error: Could not copy data to the clipboard" + ( +- ( exec -a "$sleep_argv0" bash <<<"trap 'kill %1' TERM; sleep '$CLIP_TIME' & wait" ) ++ ( exec -a "$sleep_argv0" bash <(echo trap 'kill %1' TERM\; sleep "$CLIP_TIME & wait") ) + local now="$(xclip -o -selection "$X_SELECTION" | base64)" + [[ $now != $(echo -n "$1" | base64) ]] && before="$now" + +diff --git a/src/platform/cygwin.sh b/src/platform/cygwin.sh +index 6e5dd86..f3574c4 100644 +--- a/src/platform/cygwin.sh ++++ b/src/platform/cygwin.sh +@@ -3,11 +3,11 @@ + + clip() { + local sleep_argv0="password store sleep on display $DISPLAY" +- pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5 ++ pkill -P $(pgrep -f "^$sleep_argv0") 2>/dev/null && sleep 0.5 + local before="$(base64 < /dev/clipboard)" + echo -n "$1" > /dev/clipboard + ( +- ( exec -a "$sleep_argv0" sleep "$CLIP_TIME" ) ++ ( exec -a "$sleep_argv0" bash <(echo sleep "$CLIP_TIME") ) + local now="$(base64 < /dev/clipboard)" + [[ $now != $(echo -n "$1" | base64) ]] && before="$now" + echo "$before" | base64 -d > /dev/clipboard +diff --git a/src/platform/darwin.sh b/src/platform/darwin.sh +index 86eb325..deb04c4 100644 +--- a/src/platform/darwin.sh ++++ b/src/platform/darwin.sh +@@ -3,11 +3,11 @@ + + clip() { + local sleep_argv0="password store sleep for user $(id -u)" +- pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5 ++ pkill -P $(pgrep -f "^$sleep_argv0") 2>/dev/null && sleep 0.5 + local before="$(pbpaste | openssl base64)" + echo -n "$1" | pbcopy + ( +- ( exec -a "$sleep_argv0" sleep "$CLIP_TIME" ) ++ ( exec -a "$sleep_argv0" bash <(echo sleep "$CLIP_TIME") ) + local now="$(pbpaste | openssl base64)" + [[ $now != $(echo -n "$1" | openssl base64) ]] && before="$now" + echo "$before" | openssl base64 -d | pbcopy +-- +2.12.2 + diff --git a/tv/5pkgs/simple/pass-otp/default.nix b/tv/5pkgs/simple/pass-otp/default.nix deleted file mode 100644 index 33411180a..000000000 --- a/tv/5pkgs/simple/pass-otp/default.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ stdenv, fetchFromGitHub, oathToolkit }: -stdenv.mkDerivation rec { - name = "pass-otp-${version}"; - version = "1.1.0"; - - src = fetchFromGitHub { - owner = "tadfisher"; - repo = "pass-otp"; - rev = "v${version}"; - sha256 = "1cgj4zc8fq88n3h6c0vkv9i5al785mdprpgpbv5m22dz9p1wqvbb"; - }; - - buildInputs = [ oathToolkit ]; - - patchPhase = '' - sed -i -e 's|OATH=\$(which oathtool)|OATH=${oathToolkit}/bin/oathtool|' otp.bash - ''; - - installPhase = '' - make PREFIX=$out install - ''; - - meta = with stdenv.lib; { - description = "A pass extension for managing one-time-password (OTP) tokens"; - homepage = https://github.com/tadfisher/pass-otp; - license = licenses.gpl3; - maintainers = with maintainers; [ jwiegley tadfisher ]; - platforms = platforms.unix; - }; -} diff --git a/tv/5pkgs/simple/pass/default.nix b/tv/5pkgs/simple/pass/default.nix deleted file mode 100644 index 3b6928087..000000000 --- a/tv/5pkgs/simple/pass/default.nix +++ /dev/null @@ -1,121 +0,0 @@ -{ stdenv, lib, fetchurl, fetchFromGitHub -, coreutils, gnused, getopt, git, tree, gnupg, which, procps, qrencode -, makeWrapper - -, pass-otp - -, xclip ? null, xdotool ? null, dmenu ? null -, x11Support ? !stdenv.isDarwin -, tombPluginSupport ? false, tomb -}: - -with lib; - -assert x11Support -> xclip != null - && xdotool != null - && dmenu != null; - -let - plugins = map (p: (fetchFromGitHub { - owner = "roddhjav"; - repo = "pass-${p.name}"; - inherit (p) rev sha256; - })) - ([ - { name = "import"; - rev = "491935bd275f29ceac2b876b3a288011d1ce31e7"; - sha256 = "02mbh05ab8h7kc30hz718d1d1vkjz43b96c7p0xnd92610d2q66q"; } - { name = "update"; - rev = "cf576c9036fd18efb9ed29e0e9f811207b556fde"; - sha256 = "1hhbrg6a2walrvla6q4cd3pgrqbcrf9brzjkb748735shxfn52hd"; } - ] ++ stdenv.lib.optional tombPluginSupport { - name = "tomb"; - rev = "3368134898a42c1b758fabac625ec240e125c6be"; - sha256 = "0qqmxfg4w3r088qhlkhs44036mya82vjflsjjhw2hk8y0wd2i6ds"; } - ); - -in stdenv.mkDerivation rec { - version = "1.7.1"; - name = "pass-${version}"; - - src = fetchurl { - url = "http://git.zx2c4.com/password-store/snapshot/${name}.tar.xz"; - sha256 = "0scqkpll2q8jhzcgcsh9kqz0gwdpvynivqjmmbzax2irjfaiklpn"; - }; - - patches = [ ./set-correct-program-name-for-sleep.patch - ] ++ stdenv.lib.optional stdenv.isDarwin ./no-darwin-getopt.patch; - - nativeBuildInputs = [ makeWrapper ]; - - installFlags = [ "PREFIX=$(out)" "WITH_ALLCOMP=yes" ]; - - postInstall = '' - # plugins - ${stdenv.lib.concatStringsSep "\n" (map (plugin: '' - pushd ${plugin} - PREFIX=$out make install - popd - '') plugins)} - - ln -s \ - ${pass-otp}/lib/password-store/extensions/otp.bash \ - $out/lib/password-store/extensions/ - - ln -s \ - ${pass-otp}/share/man/man1/pass-otp.1.gz \ - $out/share/man/man1/ - - # Install Emacs Mode. NOTE: We can't install the necessary - # dependencies (s.el and f.el) here. The user has to do this - # himself. - mkdir -p "$out/share/emacs/site-lisp" - cp "contrib/emacs/password-store.el" "$out/share/emacs/site-lisp/" - '' + optionalString x11Support '' - cp "contrib/dmenu/passmenu" "$out/bin/" - ''; - - wrapperPath = with stdenv.lib; makeBinPath ([ - coreutils - getopt - git - gnupg - gnused - tree - which - qrencode - ] ++ optional tombPluginSupport tomb - ++ optional stdenv.isLinux procps - ++ ifEnable x11Support [ dmenu xclip xdotool ]); - - postFixup = '' - # Fix program name in --help - substituteInPlace $out/bin/pass \ - --replace 'PROGRAM="''${0##*/}"' "PROGRAM=pass" - - # Ensure all dependencies are in PATH - wrapProgram $out/bin/pass \ - --prefix PATH : "${wrapperPath}" - '' + stdenv.lib.optionalString x11Support '' - # We just wrap passmenu with the same PATH as pass. It doesn't - # need all the tools in there but it doesn't hurt either. - wrapProgram $out/bin/passmenu \ - --prefix PATH : "$out/bin:${wrapperPath}" - ''; - - meta = with stdenv.lib; { - description = "Stores, retrieves, generates, and synchronizes passwords securely"; - homepage = https://www.passwordstore.org/; - license = licenses.gpl2Plus; - maintainers = with maintainers; [ lovek323 the-kenny fpletz ]; - platforms = platforms.unix; - - longDescription = '' - pass is a very simple password store that keeps passwords inside gpg2 - encrypted files inside a simple directory tree residing at - ~/.password-store. The pass utility provides a series of commands for - manipulating the password store, allowing the user to add, remove, edit, - synchronize, generate, and manipulate passwords. - ''; - }; -} diff --git a/tv/5pkgs/simple/pass/no-darwin-getopt.patch b/tv/5pkgs/simple/pass/no-darwin-getopt.patch deleted file mode 100644 index e8f7e138f..000000000 --- a/tv/5pkgs/simple/pass/no-darwin-getopt.patch +++ /dev/null @@ -1,9 +0,0 @@ -diff -Naur password-store-1.6.5-orig/src/platform/darwin.sh password-store-1.6.5/src/platform/darwin.sh ---- password-store-1.6.5-orig/src/platform/darwin.sh 2015-01-28 16:43:02.000000000 +0000 -+++ password-store-1.6.5/src/platform/darwin.sh 2015-02-15 16:09:02.000000000 +0000 -@@ -31,5 +31,4 @@ - mount -t hfs -o noatime -o nobrowse "$DARWIN_RAMDISK_DEV" "$SECURE_TMPDIR" || die "Error: could not mount filesystem on ramdisk." - } - --GETOPT="$(brew --prefix gnu-getopt 2>/dev/null || { which port &>/dev/null && echo /opt/local; } || echo /usr/local)/bin/getopt" - SHRED="srm -f -z" diff --git a/tv/5pkgs/simple/pass/rofi-pass.nix b/tv/5pkgs/simple/pass/rofi-pass.nix deleted file mode 100644 index 61f51973e..000000000 --- a/tv/5pkgs/simple/pass/rofi-pass.nix +++ /dev/null @@ -1,57 +0,0 @@ -{ stdenv, fetchFromGitHub, pass, rofi, coreutils, utillinux, xdotool, gnugrep -, libnotify, pwgen, findutils, gawk, gnused, xclip, makeWrapper -}: - -stdenv.mkDerivation rec { - name = "rofi-pass-${version}"; - version = "1.5.3"; - - src = fetchFromGitHub { - owner = "carnager"; - repo = "rofi-pass"; - rev = version; - sha256 = "1fn1j2rf3abc5qb44zfc8z8ffw6rva4xfp7597hwr1g3szacazpq"; - }; - - buildInputs = [ makeWrapper ]; - - dontBuild = true; - - installPhase = '' - mkdir -p $out/bin - cp -a rofi-pass $out/bin/rofi-pass - - mkdir -p $out/share/doc/rofi-pass/ - cp -a config.example $out/share/doc/rofi-pass/config.example - ''; - - wrapperPath = with stdenv.lib; makeBinPath [ - coreutils - findutils - gawk - gnugrep - gnused - libnotify - pass - pwgen - rofi - utillinux - xclip - xdotool - ]; - - fixupPhase = '' - patchShebangs $out/bin - - wrapProgram $out/bin/rofi-pass \ - --prefix PATH : "${wrapperPath}" - ''; - - meta = { - description = "A script to make rofi work with password-store"; - homepage = https://github.com/carnager/rofi-pass; - maintainers = with stdenv.lib.maintainers; [ the-kenny garbas ]; - license = stdenv.lib.licenses.gpl3; - platforms = with stdenv.lib.platforms; linux; - }; -} diff --git a/tv/5pkgs/simple/pass/set-correct-program-name-for-sleep.patch b/tv/5pkgs/simple/pass/set-correct-program-name-for-sleep.patch deleted file mode 100644 index 782e06e20..000000000 --- a/tv/5pkgs/simple/pass/set-correct-program-name-for-sleep.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 25b44e00ed5df8ffe2782d38ad5cd9f514379599 Mon Sep 17 00:00:00 2001 -From: "Andrew R. M" -Date: Sat, 8 Apr 2017 13:50:01 -0400 -Subject: [PATCH] Patch the clip() function to work even when using - single-binary coreutils - ---- - src/password-store.sh | 4 ++-- - src/platform/cygwin.sh | 4 ++-- - src/platform/darwin.sh | 4 ++-- - 3 files changed, 6 insertions(+), 6 deletions(-) - -diff --git a/src/password-store.sh b/src/password-store.sh -index 6a4172d..4dbd6b8 100755 ---- a/src/password-store.sh -+++ b/src/password-store.sh -@@ -155,11 +155,11 @@ clip() { - # variable. Specifically, it cannot store nulls nor (non-trivally) store - # trailing new lines. - local sleep_argv0="password store sleep on display $DISPLAY" -- pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5 -+ pkill -P $(pgrep -f "^$sleep_argv0") 2>/dev/null && sleep 0.5 - local before="$(xclip -o -selection "$X_SELECTION" 2>/dev/null | base64)" - echo -n "$1" | xclip -selection "$X_SELECTION" || die "Error: Could not copy data to the clipboard" - ( -- ( exec -a "$sleep_argv0" bash <<<"trap 'kill %1' TERM; sleep '$CLIP_TIME' & wait" ) -+ ( exec -a "$sleep_argv0" bash <(echo trap 'kill %1' TERM\; sleep "$CLIP_TIME & wait") ) - local now="$(xclip -o -selection "$X_SELECTION" | base64)" - [[ $now != $(echo -n "$1" | base64) ]] && before="$now" - -diff --git a/src/platform/cygwin.sh b/src/platform/cygwin.sh -index 6e5dd86..f3574c4 100644 ---- a/src/platform/cygwin.sh -+++ b/src/platform/cygwin.sh -@@ -3,11 +3,11 @@ - - clip() { - local sleep_argv0="password store sleep on display $DISPLAY" -- pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5 -+ pkill -P $(pgrep -f "^$sleep_argv0") 2>/dev/null && sleep 0.5 - local before="$(base64 < /dev/clipboard)" - echo -n "$1" > /dev/clipboard - ( -- ( exec -a "$sleep_argv0" sleep "$CLIP_TIME" ) -+ ( exec -a "$sleep_argv0" bash <(echo sleep "$CLIP_TIME") ) - local now="$(base64 < /dev/clipboard)" - [[ $now != $(echo -n "$1" | base64) ]] && before="$now" - echo "$before" | base64 -d > /dev/clipboard -diff --git a/src/platform/darwin.sh b/src/platform/darwin.sh -index 86eb325..deb04c4 100644 ---- a/src/platform/darwin.sh -+++ b/src/platform/darwin.sh -@@ -3,11 +3,11 @@ - - clip() { - local sleep_argv0="password store sleep for user $(id -u)" -- pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5 -+ pkill -P $(pgrep -f "^$sleep_argv0") 2>/dev/null && sleep 0.5 - local before="$(pbpaste | openssl base64)" - echo -n "$1" | pbcopy - ( -- ( exec -a "$sleep_argv0" sleep "$CLIP_TIME" ) -+ ( exec -a "$sleep_argv0" bash <(echo sleep "$CLIP_TIME") ) - local now="$(pbpaste | openssl base64)" - [[ $now != $(echo -n "$1" | openssl base64) ]] && before="$now" - echo "$before" | openssl base64 -d | pbcopy --- -2.12.2 - -- cgit v1.2.3 From bbef96b98913884cb09597943d1b1a42e589cd5c Mon Sep 17 00:00:00 2001 From: jeschli Date: Tue, 17 Apr 2018 18:42:47 +0200 Subject: j brauerei: +hardware.trackpoint configuration --- jeschli/1systems/brauerei/config.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/jeschli/1systems/brauerei/config.nix b/jeschli/1systems/brauerei/config.nix index b0bd74789..eace35dad 100644 --- a/jeschli/1systems/brauerei/config.nix +++ b/jeschli/1systems/brauerei/config.nix @@ -142,4 +142,11 @@ # should. system.stateVersion = "17.09"; # Did you read the comment? + hardware.trackpoint = { + enable = true; + sensitivity = 220; + speed = 0; + emulateWheel = true; + }; + } -- cgit v1.2.3 From a3b0361fd29ab5e8b972ddb29af15a2e249ca3d4 Mon Sep 17 00:00:00 2001 From: jeschli Date: Tue, 17 Apr 2018 18:43:09 +0200 Subject: emacs file sorting --- jeschli/2configs/emacs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jeschli/2configs/emacs.nix b/jeschli/2configs/emacs.nix index 2286baae3..4c52432d3 100644 --- a/jeschli/2configs/emacs.nix +++ b/jeschli/2configs/emacs.nix @@ -53,9 +53,9 @@ let ''; dotEmacs = pkgs.writeText "dot-emacs" '' ${packageRepos} - ${windowCosmetics} ${orgMode} ${recentFiles} + ${windowCosmetics} ''; emacsWithCustomPackages = (pkgs.emacsPackagesNgGen pkgs.emacs).emacsWithPackages (epkgs: [ epkgs.melpaStablePackages.magit -- cgit v1.2.3 From 554026a7796e59fcbc82fa44c11636e56a25a9f2 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 17 Apr 2018 20:17:29 +0200 Subject: font-size: init from tv --- krebs/5pkgs/simple/font-size.nix | 26 ++++++++++++++++++++++++++ tv/5pkgs/simple/font-size.nix | 26 -------------------------- 2 files changed, 26 insertions(+), 26 deletions(-) create mode 100644 krebs/5pkgs/simple/font-size.nix delete mode 100644 tv/5pkgs/simple/font-size.nix diff --git a/krebs/5pkgs/simple/font-size.nix b/krebs/5pkgs/simple/font-size.nix new file mode 100644 index 000000000..21097ed6a --- /dev/null +++ b/krebs/5pkgs/simple/font-size.nix @@ -0,0 +1,26 @@ +{ writeDashBin }: +writeDashBin "font-size" '' + set -efu + + # set_font NORMAL_FONT BOLD_FONT + set_font() { + printf '\033]710;%s\007' "$1" + printf '\033]711;%s\007' "$2" + } + + case ''${1-} in + '''|0|--reset) + set_font \ + -*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1 \ + -*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1 \ + ;; + [1-9]|[1-9][0-9]|[1-9][0-9][0-9]) + set_font \ + xft:Monospace:size=$1 \ + xft:Monospace:size=$1:bold \ + ;; + *) + echo "$0: bad argument: $1" >&2 + exit 1 + esac +'' diff --git a/tv/5pkgs/simple/font-size.nix b/tv/5pkgs/simple/font-size.nix deleted file mode 100644 index 21097ed6a..000000000 --- a/tv/5pkgs/simple/font-size.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ writeDashBin }: -writeDashBin "font-size" '' - set -efu - - # set_font NORMAL_FONT BOLD_FONT - set_font() { - printf '\033]710;%s\007' "$1" - printf '\033]711;%s\007' "$2" - } - - case ''${1-} in - '''|0|--reset) - set_font \ - -*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1 \ - -*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1 \ - ;; - [1-9]|[1-9][0-9]|[1-9][0-9][0-9]) - set_font \ - xft:Monospace:size=$1 \ - xft:Monospace:size=$1:bold \ - ;; - *) - echo "$0: bad argument: $1" >&2 - exit 1 - esac -'' -- cgit v1.2.3 From 511b45543ad8a0a135425c71108c6907180444d5 Mon Sep 17 00:00:00 2001 From: jeschli Date: Tue, 17 Apr 2018 20:20:09 +0200 Subject: j brauerei: first step for tv xmonad --- jeschli/1systems/brauerei/config.nix | 17 +++++++++-------- jeschli/default.nix | 6 +++--- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/jeschli/1systems/brauerei/config.nix b/jeschli/1systems/brauerei/config.nix index eace35dad..bd86f43dd 100644 --- a/jeschli/1systems/brauerei/config.nix +++ b/jeschli/1systems/brauerei/config.nix @@ -6,6 +6,7 @@ ./hardware-configuration.nix + ]; krebs.build.host = config.krebs.hosts.brauerei; @@ -108,8 +109,8 @@ # services.printing.enable = true; # Enable the X11 windowing system. - services.xserver.enable = true; - services.xserver.layout = "us"; + # services.xserver.enable = true; + # services.xserver.layout = "us"; # services.xserver.xkbOptions = "eurosign:e"; # Enable touchpad support. @@ -118,18 +119,18 @@ # Enable the KDE Desktop Environment. # services.xserver.displayManager.sddm.enable = true; # services.xserver.desktopManager.plasma5.enable = true; - services.xserver.displayManager.sddm.enable = true; - services.xserver.windowManager.xmonad.enable = true; - services.xserver.windowManager.xmonad.enableContribAndExtras = true; -# + # services.xserver.displayManager.sddm.enable = true; + # services.xserver.windowManager.xmonad.enable = true; + # services.xserver.windowManager.xmonad.enableContribAndExtras = true; + # # Define a user account. Don't forget to set a password with ‘passwd’. - users.extraUsers.jeschli = { + users.extraUsers.jeschli = { # TODO: define as krebs.users isNormalUser = true; uid = 1000; }; users.extraUsers.jamie = { isNormalUser = true; - uid = 1001; + uid = 1001; # TODO genid }; users.users.root.openssh.authorizedKeys.keys = [ diff --git a/jeschli/default.nix b/jeschli/default.nix index 7886fef49..b57932719 100644 --- a/jeschli/default.nix +++ b/jeschli/default.nix @@ -1,9 +1,9 @@ -_: +{ pkgs, ... }: { imports = [ ../krebs ./2configs -# ./3modules -# ./5pkgs ]; + + nixpkgs.config.packageOverrides = import ./5pkgs pkgs; } -- cgit v1.2.3 From 3871554d1935bcdc5d8ed6b82c847bee03a6d6bf Mon Sep 17 00:00:00 2001 From: jeschli Date: Wed, 18 Apr 2018 08:20:48 +0200 Subject: j: xserver, xdg from tv; updated brauerei --- jeschli/1systems/brauerei/config.nix | 1 + jeschli/2configs/xdg.nix | 14 +++ jeschli/2configs/xserver/Xmodmap.nix | 27 ++++++ jeschli/2configs/xserver/Xresources.nix | 52 +++++++++++ jeschli/2configs/xserver/default.nix | 141 ++++++++++++++++++++++++++++++ jeschli/2configs/xserver/xserver.conf.nix | 40 +++++++++ 6 files changed, 275 insertions(+) create mode 100644 jeschli/2configs/xdg.nix create mode 100644 jeschli/2configs/xserver/Xmodmap.nix create mode 100644 jeschli/2configs/xserver/Xresources.nix create mode 100644 jeschli/2configs/xserver/default.nix create mode 100644 jeschli/2configs/xserver/xserver.conf.nix diff --git a/jeschli/1systems/brauerei/config.nix b/jeschli/1systems/brauerei/config.nix index bd86f43dd..49f439a06 100644 --- a/jeschli/1systems/brauerei/config.nix +++ b/jeschli/1systems/brauerei/config.nix @@ -6,6 +6,7 @@ ./hardware-configuration.nix + ]; diff --git a/jeschli/2configs/xdg.nix b/jeschli/2configs/xdg.nix new file mode 100644 index 000000000..18bac9b38 --- /dev/null +++ b/jeschli/2configs/xdg.nix @@ -0,0 +1,14 @@ +{ config, lib, pkgs, ... }: + +with import ; + +{ + environment.variables.XDG_RUNTIME_DIR = "/run/xdg/$LOGNAME"; + + systemd.tmpfiles.rules = let + forUsers = flip map users; + isUser = { name, group, ... }: + name == "root" || hasSuffix "users" group; + users = filter isUser (mapAttrsToList (_: id) config.users.users); + in forUsers (u: "d /run/xdg/${u.name} 0700 ${u.name} ${u.group} -"); +} diff --git a/jeschli/2configs/xserver/Xmodmap.nix b/jeschli/2configs/xserver/Xmodmap.nix new file mode 100644 index 000000000..d2b1b2604 --- /dev/null +++ b/jeschli/2configs/xserver/Xmodmap.nix @@ -0,0 +1,27 @@ +{ config, pkgs, ... }: + +with import ; + +pkgs.writeText "Xmodmap" '' + !keycode 66 = Caps_Lock + !remove Lock = Caps_Lock + clear Lock + + ! caps lock + keycode 66 = Mode_switch + + keycode 13 = 4 dollar EuroSign cent + keycode 30 = u U udiaeresis Udiaeresis + keycode 32 = o O odiaeresis Odiaeresis + keycode 38 = a A adiaeresis Adiaeresis + keycode 39 = s S ssharp + + keycode 33 = p P Greek_pi Greek_PI + keycode 46 = l L Greek_lambda Greek_LAMBDA + + keycode 54 = c C cacute Cacute + + ! BULLET OPERATOR + keycode 17 = 8 asterisk U2219 + keycode 27 = r R r U211D +'' diff --git a/jeschli/2configs/xserver/Xresources.nix b/jeschli/2configs/xserver/Xresources.nix new file mode 100644 index 000000000..e433a855e --- /dev/null +++ b/jeschli/2configs/xserver/Xresources.nix @@ -0,0 +1,52 @@ +{ config, lib, pkgs, ... }: + +with import ; + +pkgs.writeText "Xresources" /* xdefaults */ '' + URxvt*cutchars: "\\`\"'&()*,;<=>?@[]^{|}‘’" + URxvt*eightBitInput: false + URxvt*font: -*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1 + URxvt*boldFont: -*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1 + URxvt*scrollBar: false + URxvt*background: #050505 + URxvt*foreground: #d0d7d0 + URxvt*cursorColor: #f042b0 + URxvt*cursorColor2: #f0b000 + URxvt*cursorBlink: off + URxvt*jumpScroll: true + URxvt*allowSendEvents: false + URxvt*charClass: 33:48,37:48,45-47:48,64:48,38:48,61:48,63:48 + URxvt*cutNewline: False + URxvt*cutToBeginningOfLine: False + + URxvt*color0: #232342 + URxvt*color3: #c07000 + URxvt*color4: #4040c0 + URxvt*color7: #c0c0c0 + URxvt*color8: #707070 + URxvt*color9: #ff6060 + URxvt*color10: #70ff70 + URxvt*color11: #ffff70 + URxvt*color12: #7070ff + URxvt*color13: #ff50ff + URxvt*color14: #70ffff + URxvt*color15: #ffffff + + URxvt*iso14755: False + + URxvt*urgentOnBell: True + URxvt*visualBell: True + + ! ref https://github.com/muennich/urxvt-perls + URxvt*perl-ext: default,url-select + URxvt*keysym.M-u: perl:url-select:select_next + URxvt*url-select.underline: true + URxvt*colorUL: #4682B4 + URxvt.perl-lib: ${pkgs.urxvt_perls}/lib/urxvt/perl + URxvt*saveLines: 10000 + + root-urxvt*background: #230000 + root-urxvt*foreground: #e0c0c0 + root-urxvt*BorderColor: #400000 + root-urxvt*color0: #800000 +'' diff --git a/jeschli/2configs/xserver/default.nix b/jeschli/2configs/xserver/default.nix new file mode 100644 index 000000000..df06000f3 --- /dev/null +++ b/jeschli/2configs/xserver/default.nix @@ -0,0 +1,141 @@ +{ config, pkgs, ... }@args: +with import ; +let + cfg = { + cacheDir = cfg.dataDir; + configDir = "/var/empty"; + dataDir = "/run/xdg/${cfg.user.name}/xmonad"; + user = config.krebs.users.jeschli; + }; +in { + + environment.systemPackages = [ + pkgs.font-size + pkgs.gitAndTools.qgit + pkgs.mpv + pkgs.sxiv + pkgs.xdotool + pkgs.xsel + pkgs.zathura + ]; + + fonts.fonts = [ + pkgs.xlibs.fontschumachermisc + ]; + + # TODO dedicated group, i.e. with a single user [per-user-setuid] + # TODO krebs.setuid.slock.path vs /run/wrappers/bin + krebs.setuid.slock = { + filename = "${pkgs.slock}/bin/slock"; + group = "wheel"; + envp = { + DISPLAY = ":${toString config.services.xserver.display}"; + USER = cfg.user.name; + }; + }; + + services.xserver = { + + # Don't install feh into systemPackages + # refs + desktopManager.session = mkForce []; + + enable = true; + display = 11; + tty = 11; + + synaptics = { + enable = true; + twoFingerScroll = true; + accelFactor = "0.035"; + }; + }; + + systemd.services.display-manager.enable = false; + + systemd.services.xmonad = { + wantedBy = [ "multi-user.target" ]; + requires = [ "xserver.service" ]; + environment = { + DISPLAY = ":${toString config.services.xserver.display}"; + + XMONAD_CACHE_DIR = cfg.cacheDir; + XMONAD_CONFIG_DIR = cfg.configDir; + XMONAD_DATA_DIR = cfg.dataDir; + + XMONAD_STARTUP_HOOK = pkgs.writeDash "xmonad-startup-hook" '' + ${pkgs.xorg.xhost}/bin/xhost +LOCAL: & + ${pkgs.xorg.xmodmap}/bin/xmodmap ${import ./Xmodmap.nix args} & + ${pkgs.xorg.xrdb}/bin/xrdb ${import ./Xresources.nix args} & + ${pkgs.xorg.xsetroot}/bin/xsetroot -solid '#1c1c1c' & + wait + ''; + + # XXX JSON is close enough :) + XMONAD_WORKSPACES0_FILE = pkgs.writeText "xmonad.workspaces0" (toJSON [ + "dashboard" # we start here + "stockholm" + "pycharm" + "chromium" + "iRC" + "git" + "hipbird" + ]); + }; + serviceConfig = { + SyslogIdentifier = "xmonad"; + ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p ${toString [ + "\${XMONAD_CACHE_DIR}" + "\${XMONAD_CONFIG_DIR}" + "\${XMONAD_DATA_DIR}" + ]}"; + ExecStart = "${pkgs.xmonad-jeschli}/bin/xmonad"; + ExecStop = "${pkgs.xmonad-jeschli}/bin/xmonad --shutdown"; + User = cfg.user.name; + WorkingDirectory = cfg.user.home; + }; + }; + + systemd.services.xserver = { + after = [ + "systemd-udev-settle.service" + "local-fs.target" + "acpid.service" + ]; + reloadIfChanged = true; + environment = { + XKB_BINDIR = "${pkgs.xorg.xkbcomp}/bin"; # Needed for the Xkb extension. + XORG_DRI_DRIVER_PATH = "/run/opengl-driver/lib/dri"; # !!! Depends on the driver selected at runtime. + LD_LIBRARY_PATH = concatStringsSep ":" ( + [ "${pkgs.xorg.libX11}/lib" "${pkgs.xorg.libXext}/lib" ] + ++ concatLists (catAttrs "libPath" config.services.xserver.drivers)); + }; + serviceConfig = { + SyslogIdentifier = "xserver"; + ExecReload = "${pkgs.coreutils}/bin/echo NOP"; + ExecStart = toString [ + "${pkgs.xorg.xorgserver}/bin/X" + ":${toString config.services.xserver.display}" + "vt${toString config.services.xserver.tty}" + "-config ${import ./xserver.conf.nix args}" + "-logfile /dev/null -logverbose 0 -verbose 3" + "-nolisten tcp" + "-xkbdir ${pkgs.xkeyboard_config}/etc/X11/xkb" + ]; + }; + }; + + systemd.services.urxvtd = { + wantedBy = [ "multi-user.target" ]; + reloadIfChanged = true; + serviceConfig = { + SyslogIdentifier = "urxvtd"; + ExecReload = "${pkgs.coreutils}/bin/echo NOP"; + ExecStart = "${pkgs.rxvt_unicode}/bin/urxvtd"; + Restart = "always"; + RestartSec = "2s"; + StartLimitBurst = 0; + User = cfg.user.name; + }; + }; +} diff --git a/jeschli/2configs/xserver/xserver.conf.nix b/jeschli/2configs/xserver/xserver.conf.nix new file mode 100644 index 000000000..6f34e0150 --- /dev/null +++ b/jeschli/2configs/xserver/xserver.conf.nix @@ -0,0 +1,40 @@ +{ config, lib, pkgs, ... }: + +with import ; + +let + cfg = config.services.xserver; +in + +pkgs.stdenv.mkDerivation { + name = "xserver.conf"; + + xfs = optionalString (cfg.useXFS != false) + ''FontPath "${toString cfg.useXFS}"''; + + inherit (cfg) config; + + buildCommand = + '' + echo 'Section "Files"' >> $out + echo $xfs >> $out + + for i in ${toString config.fonts.fonts}; do + if test "''${i:0:''${#NIX_STORE}}" == "$NIX_STORE"; then + for j in $(find $i -name fonts.dir); do + echo " FontPath \"$(dirname $j)\"" >> $out + done + fi + done + + for i in $(find ${toString cfg.modules} -type d); do + if test $(echo $i/*.so* | wc -w) -ne 0; then + echo " ModulePath \"$i\"" >> $out + fi + done + + echo 'EndSection' >> $out + + echo "$config" >> $out + ''; +} -- cgit v1.2.3