aboutsummaryrefslogtreecommitdiff
path: root/xmonad.nix
diff options
context:
space:
mode:
Diffstat (limited to 'xmonad.nix')
-rw-r--r--xmonad.nix43
1 files changed, 10 insertions, 33 deletions
diff --git a/xmonad.nix b/xmonad.nix
index 7647094..41a9e51 100644
--- a/xmonad.nix
+++ b/xmonad.nix
@@ -5,39 +5,16 @@
enable = true;
enableContribAndExtras = true;
- # would be nice to have this as an actual haskell file, so I
- # could get syntax highlighting, but I also need to make sure
- # external programs are included as runtime dependencies
- config = pkgs.writeText "xmonad.hs" ''
- import XMonad
- import XMonad.Actions.Volume
- import XMonad.Actions.PhysicalScreens
- import XMonad.Util.Dzen
- import XMonad.Hooks.EwmhDesktops
- import XMonad.Util.EZConfig
-
- import Data.Default
-
- mymod = mod4Mask
- myKeys =
- [ ((mymod, xK_p), spawn "${pkgs.rofi}/bin/rofi -show run")
- , ((mymod, xK_i), lowerVolume 5 >>= alert)
- , ((mymod, xK_o), raiseVolume 5 >>= alert)
- ]
- ++
- [((mymod .|. mask, key), f sc)
- | (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
- , (f, mask) <- [(viewScreen def, 0), (sendToScreen def, shiftMask)]]
-
- alert = dzenConfig (timeout 3 >=> onCurr xScreen) . show . round
-
- main = xmonad $ ewmh $ def
- { terminal = "${pkgs.rxvt-unicode}/bin/urxvt"
- , modMask = mymod
- , borderWidth = 0
- , focusFollowsMouse = False
- } `additionalKeys` myKeys
- '';
+ config = pkgs.stdenv.mkDerivation {
+ name = "xmonad-config";
+ src = ./xmonad.hs;
+ dontUnpack = true;
+ terminal = "${pkgs.rxvt-unicode}/bin/urxvt";
+ dmenu = "${pkgs.rofi}/bin/rofi -combi-modi window,run -show combi -modi combi";
+ installPhase = ''
+ substituteAll "$src" "$out"
+ '';
+ };
};
xsession.enable = true;