summaryrefslogtreecommitdiffstats
path: root/lass/5pkgs
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2018-03-07 01:49:57 +0100
committermakefu <github@syntax-fehler.de>2018-03-07 01:49:57 +0100
commit6b647a237a5f4db23b7eff70f305be7106da7711 (patch)
tree3542eabb416599e0d2dea8a2f2358f27f4b911e2 /lass/5pkgs
parent194e7011d42ed75c76dc7a7efea450ba6497d2f1 (diff)
parent02f67eed443ba552d775d1a0ab7860d439f7552b (diff)
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'lass/5pkgs')
-rw-r--r--lass/5pkgs/custom/xmonad-lass/default.nix (renamed from lass/5pkgs/xmonad-lass.nix)9
-rw-r--r--lass/5pkgs/default.nix63
-rw-r--r--lass/5pkgs/xephyrify/default.nix42
3 files changed, 82 insertions, 32 deletions
diff --git a/lass/5pkgs/xmonad-lass.nix b/lass/5pkgs/custom/xmonad-lass/default.nix
index 59c95cff7..e658897da 100644
--- a/lass/5pkgs/xmonad-lass.nix
+++ b/lass/5pkgs/custom/xmonad-lass/default.nix
@@ -143,12 +143,21 @@ myKeyMap =
, ("M4-d", floatNext True >> spawn "${pkgs.copyq}/bin/copyq show")
+ , ("M4-<F4>", spawn "${pkgs.writeDash "nm-dmenu" ''
+ export PATH=$PATH:${pkgs.dmenu}/bin:${pkgs.networkmanagerapplet}/bin
+ exec ${pkgs.networkmanager_dmenu}/bin/networkmanager_dmenu "$@"
+ ''}")
+
, ("M4-<F5>", spawn "${pkgs.xorg.xbacklight}/bin/xbacklight -set 1")
, ("M4-<F6>", spawn "${pkgs.xorg.xbacklight}/bin/xbacklight -set 10")
, ("M4-<F7>", spawn "${pkgs.xorg.xbacklight}/bin/xbacklight -set 33")
, ("M4-<F8>", spawn "${pkgs.xorg.xbacklight}/bin/xbacklight -set 100")
, ("<Pause>", spawn "${pkgs.xcalib}/bin/xcalib -invert -alter")
+
+ --, ("M4-w", screenWorkspace 0 >>= (windows . W.greedyView))
+ --, ("M4-e", screenWorkspace 1 >>= (windows . W.greedyView))
+ --, ("M4-r", screenWorkspace 2 >>= (windows . W.greedyView))
]
forkFile :: FilePath -> [String] -> Maybe [(String, String)] -> X ()
diff --git a/lass/5pkgs/default.nix b/lass/5pkgs/default.nix
index a158cd3c6..28482eb91 100644
--- a/lass/5pkgs/default.nix
+++ b/lass/5pkgs/default.nix
@@ -1,40 +1,39 @@
-{ config, pkgs, ... }@args:
+with import <stockholm/lib>;
+self: super: let
-{
- nixpkgs.config.packageOverrides = rec {
- acronym = pkgs.callPackage ./acronym/default.nix {};
- dpass = pkgs.callPackage ./dpass {};
- firefoxPlugins = {
- noscript = pkgs.callPackage ./firefoxPlugins/noscript.nix {};
- ublock = pkgs.callPackage ./firefoxPlugins/ublock.nix {};
- vimperator = pkgs.callPackage ./firefoxPlugins/vimperator.nix {};
- };
- init = pkgs.callPackage ./init/default.nix args;
- logify = pkgs.callPackage ./logify/default.nix {};
- mk_sql_pair = pkgs.callPackage ./mk_sql_pair/default.nix {};
- mpv-poll = pkgs.callPackage ./mpv-poll/default.nix {};
- pop = pkgs.callPackage ./pop/default.nix {};
- q = pkgs.callPackage ./q {};
- rs = pkgs.callPackage ./rs/default.nix {};
- urban = pkgs.callPackage ./urban/default.nix {};
- xml2json = pkgs.callPackage ./xml2json/default.nix {};
- xmonad-lass = import ./xmonad-lass.nix { inherit config pkgs; };
- yt-next = pkgs.callPackage ./yt-next/default.nix {};
+ # This callPackage will try to detect obsolete overrides.
+ callPackage = path: args: let
+ override = super.callPackage path args;
+ upstream = optionalAttrs (override ? "name")
+ (super.${(parseDrvName override.name).name} or {});
+ in if upstream ? "name" &&
+ override ? "name" &&
+ compareVersions upstream.name override.name != -1
+ then
+ trace
+ "Upstream `${upstream.name}' gets overridden by `${override.name}'."
+ override
+ else override;
- bank = pkgs.writeDashBin "bank" ''
+ subdirsOf = path:
+ mapAttrs (name: _: path + "/${name}")
+ (filterAttrs (_: eq "directory") (readDir path));
+
+in {
+ bank = self.writeDashBin "bank" ''
tmp=$(mktemp)
- ${pkgs.pass}/bin/pass show hledger > $tmp
- ${pkgs.hledger}/bin/hledger --file=$tmp "$@"
- ${pkgs.pass}/bin/pass show hledger | if ${pkgs.diffutils}/bin/diff $tmp -; then
+ ${self.pass}/bin/pass show hledger > $tmp
+ ${self.hledger}/bin/hledger --file=$tmp "$@"
+ ${self.pass}/bin/pass show hledger | if ${self.diffutils}/bin/diff $tmp -; then
exit 0
else
- ${pkgs.coreutils}/bin/cat $tmp | ${pkgs.pass}/bin/pass insert -m hledger
+ ${self.coreutils}/bin/cat $tmp | ${self.pass}/bin/pass insert -m hledger
fi
- ${pkgs.coreutils}/bin/rm $tmp
- '';
- screengrab = pkgs.writeDashBin "screengrab" ''
- resolution="$(${pkgs.xorg.xrandr}/bin/xrandr | ${pkgs.gnugrep}/bin/grep '*' | ${pkgs.gawk}/bin/awk '{print $1}')"
- ${pkgs.ffmpeg}/bin/ffmpeg -f x11grab -r 25 -i :${toString config.services.xserver.display} -s $resolution -c:v huffyuv $1
+ ${self.coreutils}/bin/rm $tmp
'';
- };
+ rtl8814au = callPackage ./custom/rtl8814au { kernel = self.linux; };
}
+
+// mapAttrs (_: flip callPackage {})
+ (filterAttrs (_: dir: pathExists (dir + "/default.nix"))
+ (subdirsOf ./.))
diff --git a/lass/5pkgs/xephyrify/default.nix b/lass/5pkgs/xephyrify/default.nix
new file mode 100644
index 000000000..8b18ea949
--- /dev/null
+++ b/lass/5pkgs/xephyrify/default.nix
@@ -0,0 +1,42 @@
+{ writeDashBin, writeHaskell, coreutils, xorg, virtualgl, ... }:
+
+let
+
+ minimalXmonad = writeHaskell "minimalXmonad" {
+ executables.xmonad = {
+ extra-depends = [
+ "containers"
+ "xmonad"
+ ];
+ text = /* haskell */ ''
+ module Main where
+ import XMonad
+ import qualified Data.Map as Map
+
+ main :: IO ()
+ main = do
+ xmonad def
+ { workspaces = [ "1" ]
+ , layoutHook = myLayoutHook
+ , keys = myKeys
+ , normalBorderColor = "#000000"
+ , focusedBorderColor = "#000000"
+ }
+
+ myLayoutHook = Full
+ myKeys _ = Map.fromList []
+ '';
+ };
+ };
+
+in writeDashBin "xephyrify" ''
+ NDISPLAY=:$(${coreutils}/bin/shuf -i 100-65536 -n 1)
+ echo "using DISPLAY $NDISPLAY"
+ ${xorg.xorgserver}/bin/Xephyr -br -ac -reset -terminate -resizeable $NDISPLAY &
+ XEPHYR_PID=$!
+ DISPLAY=$NDISPLAY ${minimalXmonad}/bin/xmonad &
+ XMONAD_PID=$!
+ DISPLAY=$NDISPLAY ${virtualgl}/bin/vglrun "$@"
+ kill $XMONAD_PID
+ kill $XEPHYR_PID
+''