summary refs log tree commit diff
diff options
context:
space:
mode:
authorivanbrennan <ivan.brennan@gmail.com>2022-01-18 00:19:31 -0500
committerivanbrennan <ivan.brennan@gmail.com>2022-01-19 20:31:05 -0500
commit6c72deb51b13235adb4bd13ebba95e907f839e15 (patch)
tree6e36c6bb70753b3b22c1038278a58aaad128c877
parenta3ea1bc599f5c7dcea950b40c05f1abd3e5cd191 (diff)
downloadnixpkgs-6c72deb51b13235adb4bd13ebba95e907f839e15.tar
nixpkgs-6c72deb51b13235adb4bd13ebba95e907f839e15.tar.gz
nixpkgs-6c72deb51b13235adb4bd13ebba95e907f839e15.tar.bz2
nixpkgs-6c72deb51b13235adb4bd13ebba95e907f839e15.tar.lz
nixpkgs-6c72deb51b13235adb4bd13ebba95e907f839e15.tar.xz
nixpkgs-6c72deb51b13235adb4bd13ebba95e907f839e15.tar.zst
nixpkgs-6c72deb51b13235adb4bd13ebba95e907f839e15.zip
nixos/xmonad: update example config
Update the example config to show a working example for xmonad 0.17.0, which
added an argument to the `launch` function and adjusted the location of the
recompiled binary.
-rw-r--r--nixos/modules/services/x11/window-managers/xmonad.nix30
1 files changed, 24 insertions, 6 deletions
diff --git a/nixos/modules/services/x11/window-managers/xmonad.nix b/nixos/modules/services/x11/window-managers/xmonad.nix
index 4ac11541bea..68f97c2f504 100644
--- a/nixos/modules/services/x11/window-managers/xmonad.nix
+++ b/nixos/modules/services/x11/window-managers/xmonad.nix
@@ -121,6 +121,29 @@ in {
 
           compiledConfig = printf "xmonad-%s-%s" arch os
 
+          myConfig = defaultConfig
+            { modMask = mod4Mask -- Use Super instead of Alt
+            , terminal = "urxvt" }
+            `additionalKeys`
+            [ ( (mod4Mask,xK_r), compileRestart True)
+            , ( (mod4Mask,xK_q), restart "xmonad" True ) ]
+
+          --------------------------------------------
+          {- version 0.17.0 -}
+          --------------------------------------------
+          -- compileRestart resume =
+          --   dirs <- io getDirectories
+          --   whenX (recompile dirs True) $
+          --     when resume writeStateToFile
+          --       *> catchIO
+          --         ( do
+          --             args <- getArgs
+          --             executeFile (cacheDir dirs </> compiledConfig) False args Nothing
+          --         )
+          --
+          -- main = getDirectories >>= launch myConfig
+          --------------------------------------------
+
           compileRestart resume =
             whenX (recompile True) $
               when resume writeStateToFile
@@ -131,12 +154,7 @@ in {
                       executeFile (dir </> compiledConfig) False args Nothing
                   )
 
-          main = launch defaultConfig
-              { modMask = mod4Mask -- Use Super instead of Alt
-              , terminal = "urxvt" }
-              `additionalKeys`
-              [ ( (mod4Mask,xK_r), compileRestart True)
-              , ( (mod4Mask,xK_q), restart "xmonad" True ) ]
+          main = launch myConfig
         '';
       };