From 05d186d304d8318bb82ec490b6d0ac92dab560e5 Mon Sep 17 00:00:00 2001 From: MagicRB Date: Tue, 3 Oct 2023 16:54:07 +0200 Subject: [PATCH] Redo xmonad config, allows for new packages and LSP Signed-off-by: MagicRB --- flake.nix | 62 ++++++-- home-manager/modules/xmonad/.gitignore | 2 + home-manager/modules/xmonad/Setup.hs | 2 + .../modules/xmonad/{xmonad.hs => app/Main.hs} | 30 ++-- home-manager/modules/xmonad/default.nix | 147 ++++++------------ home-manager/modules/xmonad/hie.yaml | 10 ++ home-manager/modules/xmonad/package.yaml | 64 ++++++++ .../modules/xmonad/scripts/auxmenu.sh | 59 +++++++ .../modules/xmonad/scripts/polybar-mm.sh | 3 + .../modules/xmonad/scripts/toggle-touchpad.sh | 8 + .../modules/xmonad/scripts/xmonad-reload.sh | 9 ++ home-manager/modules/xmonad/src/Lib.hs | 6 + home-manager/modules/xmonad/stack.yaml | 69 ++++++++ home-manager/modules/xmonad/stack.yaml.lock | 12 ++ home-manager/modules/xmonad/test/Spec.hs | 2 + .../modules/xmonad/xmonad-config.cabal | 80 ++++++++++ 16 files changed, 441 insertions(+), 124 deletions(-) create mode 100644 home-manager/modules/xmonad/.gitignore create mode 100644 home-manager/modules/xmonad/Setup.hs rename home-manager/modules/xmonad/{xmonad.hs => app/Main.hs} (92%) create mode 100644 home-manager/modules/xmonad/hie.yaml create mode 100644 home-manager/modules/xmonad/package.yaml create mode 100644 home-manager/modules/xmonad/scripts/auxmenu.sh create mode 100644 home-manager/modules/xmonad/scripts/polybar-mm.sh create mode 100644 home-manager/modules/xmonad/scripts/toggle-touchpad.sh create mode 100644 home-manager/modules/xmonad/scripts/xmonad-reload.sh create mode 100644 home-manager/modules/xmonad/src/Lib.hs create mode 100644 home-manager/modules/xmonad/stack.yaml create mode 100644 home-manager/modules/xmonad/stack.yaml.lock create mode 100644 home-manager/modules/xmonad/test/Spec.hs create mode 100644 home-manager/modules/xmonad/xmonad-config.cabal diff --git a/flake.nix b/flake.nix index 2f83f45..b2dbf98 100644 --- a/flake.nix +++ b/flake.nix @@ -199,15 +199,59 @@ matlab; }; - devShells.default = pkgs.mkShell { - nativeBuildInputs = with pkgs; [ - (pkgs.writeShellScriptBin "update-secret" '' - nix flake lock --update-input secret - '') - nil - nomad consul vault - ]; - }; + devShells.default = + let + unpackSrc = package: pkgs.stdenv.mkDerivation { + pname = package.pname; + version = package.version; + + src = package.src; + + phases = [ "unpackPhase" "installPhase" ]; + + installPhase = '' + mkdir $out + cp -r . $out + ''; + }; + prepareDeps = pkgs.writeShellScript "prepare-deps.sh" '' + cd "$(git rev-parse --show-toplevel)/home-manager/modules/xmonad" + mkdir -p .packages + + _rsync_args=("--no-perms" "--no-owner" "--no-group" "--del" "--exclude=.stack-work" "--chmod=ugo=rwX" "-crvP") + rsync "''${_rsync_args[@]}" ${unpackSrc pkgs.haskell.packages.ghc946.xmonad}/. .packages/xmonad >/dev/null 2>&1 + rsync "''${_rsync_args[@]}" ${unpackSrc pkgs.haskell.packages.ghc946.xmonad-contrib}/. .packages/xmonad-contrib >/dev/null 2>&1 + rsync "''${_rsync_args[@]}" ${unpackSrc pkgs.haskell.packages.ghc946.xmobar}/. .packages/xmobar >/dev/null 2>&1 + ''; + stack-wrapped = pkgs.symlinkJoin { + name = "stack"; # will be available as the usual `stack` in terminal + paths = [ pkgs.stack ]; + buildInputs = [ pkgs.makeWrapper ]; + postBuild = '' + wrapProgram $out/bin/stack \ + --run "${prepareDeps}"\ + --add-flags "\ + --no-nix \ + --system-ghc \ + --no-install-ghc \ + " + ''; + }; + in + pkgs.mkShell { + nativeBuildInputs = with pkgs; [ + (pkgs.writeShellScriptBin "update-secret" '' + nix flake lock --update-input secret + '') + nil + nomad consul vault + + haskell.compiler.ghc946 + stack-wrapped + pkg-config + haskell.packages.ghc946.haskell-language-server + ] ++ (lib.foldl (acc: x: acc ++ x) [] (map (x: pkgs.haskell.packages.ghc946.${x}.buildInputs) [ "gi-pangocairo" "X11" "cairo" "glib" ])); + }; }; flake.patches = { diff --git a/home-manager/modules/xmonad/.gitignore b/home-manager/modules/xmonad/.gitignore new file mode 100644 index 0000000..b09d66f --- /dev/null +++ b/home-manager/modules/xmonad/.gitignore @@ -0,0 +1,2 @@ +.packages +.stack-work diff --git a/home-manager/modules/xmonad/Setup.hs b/home-manager/modules/xmonad/Setup.hs new file mode 100644 index 0000000..9a994af --- /dev/null +++ b/home-manager/modules/xmonad/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/home-manager/modules/xmonad/xmonad.hs b/home-manager/modules/xmonad/app/Main.hs similarity index 92% rename from home-manager/modules/xmonad/xmonad.hs rename to home-manager/modules/xmonad/app/Main.hs index 2e382f0..6ba5a2d 100644 --- a/home-manager/modules/xmonad/xmonad.hs +++ b/home-manager/modules/xmonad/app/Main.hs @@ -21,6 +21,7 @@ import Data.Maybe import Data.Function import Data.Functor import System.Exit +import System.Environment import XMonad.Util.EZConfig import XMonad.Util.SpawnOnce import XMonad.Util.WindowProperties @@ -68,7 +69,7 @@ myKeymap c = [ ("M-S-", spawn "alacritty") -- launch dmenu - , ("M-e", spawn "@dmenu_run@") + , ("M-e", spawn "dmenu_run") -- close focused window , ("M-S-q", io (exitWith ExitSuccess)) @@ -121,9 +122,9 @@ myKeymap c = , ("M-d", warpToWindow 0.5 0.5) -- , ("M-b", spawn ("pkill xmobar && " ++ xmobarCmd)) - , ("", spawn "sleep 0.1 ; @screenshot@ select") - , ("S-", spawn "@screenshot@ screen && sleep 0.1 && @notify@ -t 5000 \"snap\"") - , ("C-S-", spawn "@screenshot@ focused && sleep 0.1 && @notify@ -t 5000 \"snap\"") + , ("", spawn "sleep 0.1 ; screenshot select") + , ("S-", spawn "screenshot screen && sleep 0.1 && notify -t 5000 \"snap\"") + , ("C-S-", spawn "screenshot focused && sleep 0.1 && notify -t 5000 \"snap\"") -- Toggle the status bar gap -- Use this binding with avoidStruts from Hooks.ManageDocks. @@ -135,7 +136,7 @@ myKeymap c = , ("M-S-k", kill) -- Restart xmonad - , ("M-k", spawn "@reload@") + , ("M-k", spawn "reload") -- float keys , ("M-g", withFocused (keysResizeWindow (-10, 0) (0, 0))) @@ -152,17 +153,17 @@ myKeymap c = , ("" , spawn "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle") , ("" , spawn "wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+") , ("" , spawn "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-") - , ("" , spawn "@brightnessctl@ set +5%") - , ("" , spawn "@brightnessctl@ set 5%-") + , ("" , spawn "brightnessctl set +5%") + , ("" , spawn "brightnessctl set 5%-") - , ("" , spawn "@notify@ -t 5000 \"Music: Play\"" >> spawn "@playerctl@ play-pause") - , ("" , spawn "@notify@ -t 5000 \"Music: Stop\"" >> spawn "@playerctl@ stop") - , ("" , spawn "@notify@ -t 5000 \"Music: Prev\"" >> spawn "@playerctl@ previous") - , ("" , spawn "@notify@ -t 5000 \"Music: Next\"" >> spawn "@playerctl@ next") + , ("" , spawn "notify -t 5000 \"Music: Play\"" >> spawn "playerctl play-pause") + , ("" , spawn "notify -t 5000 \"Music: Stop\"" >> spawn "playerctl stop") + , ("" , spawn "notify -t 5000 \"Music: Prev\"" >> spawn "playerctl previous") + , ("" , spawn "notify -t 5000 \"Music: Next\"" >> spawn "playerctl next") - , ("" , spawn "@toggle_touchpad@") + , ("" , spawn "toggle-touchpad") - , ("M-", spawn "@auxmenu@") + , ("M-", spawn "auxmenu") , ("M-", withDisplay $ \dpy -> withFocused $ \win -> do wmstate <- getAtom "_NET_WM_STATE" @@ -262,7 +263,7 @@ myPP = def } spawnBar :: ScreenId -> IO StatusBarConfig -spawnBar screen = pure $ statusBarPropTo ("_XMONAD_LOG_" <> screenString ) ("@polybar@ " <> screenString) (pure myPP) +spawnBar screen = pure $ statusBarPropTo ("_XMONAD_LOG_" <> screenString ) ("polybar-mm " <> screenString) (pure myPP) where screenString = show (fromIntegral screen :: Int) ------------------------------------------------------------------------ @@ -272,6 +273,7 @@ spawnBar screen = pure $ statusBarPropTo ("_XMONAD_LOG_" <> screenString ) ("@po -- -- main = xmonad $ ewmh $ docks $ defaults main = do + getEnv "PATH" >>= \path -> setEnv "PATH" (path <> ":/home/main/.xmonad/runenv/bin") pure defaults <&> dynamicSBs spawnBar <&> docks >>= xmonad getNetWMState :: Window -> X [Atom] diff --git a/home-manager/modules/xmonad/default.nix b/home-manager/modules/xmonad/default.nix index ba4586a..4c36ad3 100644 --- a/home-manager/modules/xmonad/default.nix +++ b/home-manager/modules/xmonad/default.nix @@ -1,105 +1,50 @@ -{ pkgs, lib, ... }: +{ pkgs, lib, inputs', ... }: { - home.file.".xmonad/xmonad.hs".source = pkgs.writeSubstitutedFile { - name = "xmonad.hs"; - file = ./xmonad.hs; - substitutes = { - "brightnessctl" = lib.getExe pkgs.brightnessctl; - "playerctl" = lib.getExe pkgs.playerctl; - "dmenu_run" = "${pkgs.dmenu}/bin/dmenu_run"; - "polybar" = pkgs.writeShellScript "polybar" - '' - export PATH=${lib.makeBinPath [ pkgs.polybarFull ]}:$PATH + home.file.".xmonad/build".executable = true; + home.file.".xmonad/build".text = '' + #!/usr/bin/env bash + cd ~/dotfiles/home-manager/modules/xmonad + eval "$(direnv export bash)" + stack build + rm "$1" + cp "$(stack path --local-install-root)/bin/xmonad-exe" "$1" + ''; - monitors=$(polybar --list-monitors | cut -f 1 -d':' | tr '\n' ' ') - monitors=($monitors) - MONITOR=''${monitors[$1]} polybar -c ${./polybar.ini} top - ''; - "reload" = pkgs.writeShellScript "xmonad-reload" - '' - ${lib.getExe pkgs.libnotify} -t 5000 "recompiling xmonad" - - if xmonad --recompile - then - ${lib.getExe pkgs.libnotify} -t 5000 "compilation succeeded" - xmonad --restart - else - ${lib.getExe pkgs.libnotify} -t 5000 "compilation failed" - fi - ''; - "toggle_touchpad" = pkgs.writeShellScript "toggle-touchpad" - '' - read TPdevice <<< $( xinput | sed -nre '/TouchPad|Touchpad/s/.*id=([0-9]*).*/\1/p' ) - state=$( xinput list-props "$TPdevice" | grep "Device Enabled" | grep -o "[01]$" ) - - if [ "$state" -eq '1' ];then - xinput --disable "$TPdevice" && notify-send -i emblem-nowrite "Touchpad" "Disabled" - else - xinput --enable "$TPdevice" && notify-send -i emblem-nowrite "Touchpad" "Enabled" - fi - ''; - "auxmenu" = pkgs.writeShellScript "auxmenu" - '' - export SUDO_ASKPASS=${pkgs.x11_ssh_askpass}/libexec/x11-ssh-askpass - - _options="toggle-mic\ntoggle-wifi\ntoggle-bluetooth\nscreenshot-all\nscreenshot-select\nscreenshot-focused\nsuspend\nreboot\nkexec\npoweroff\nlogout\nnmtui" - - _option="$(echo -e $_options | emacs-rofi "command: " 90 30 | awk '{print $1}' | tr -d '\r\n')" - if [ ''${#_option} -gt 0 ] - then - case $_option in - toggle-mic) - wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle - ;; - toggle-wifi) - if [ "$(nmcli radio wifi)" = "enabled" ] - then - nmcli radio wifi off - else - nmcli radio wifi on - fi - ;; - toggle-bluetooth) - if [ "$(nmcli radio wifi)" = "enabled" ] - then - nmcli radio wifi off - else - nmcli radio wifi on - fi - ;; - screenshot-all) - ${lib.getExe pkgs.magic-screenshot} screen - ;; - screenshot-select) - ${lib.getExe pkgs.magic-screenshot} select - ;; - screenshot-focused) - ${lib.getExe pkgs.magic-screenshot} focused - ;; - suspend) - systemctl suspend - ;; - reboot) - systemctl reboot - ;; - poweroff) - systemctl poweroff - ;; - kexec) - sudo -A kexec -l /run/current-system/kernel --initrd=/run/current-system/initrd --reuse-cmdline - systemctl kexec - ;; - logout) - loginctl terminate-session $XDG_SESSION_ID - ;; - nmtui) - alacritty -e nmtui - ;; - *) - ;; - esac - fi - ''; + home.file.".xmonad/buildenv".source = + pkgs.buildEnv { + name = "xmonad-buildenv"; + ignoreCollisions = true; + paths = inputs'.self.devShells.${pkgs.stdenv.system}.default.nativeBuildInputs; }; - }; + + home.file.".xmonad/runenv".source = + let + polybar-mm = + pkgs.writeShellScriptBin "polybar-mm" + (builtins.readFile ./scripts/polybar-mm.sh); + reload = + pkgs.writeShellScriptBin "xmonad-reload" + (builtins.readFile ./scripts/polybar-mm.sh); + toggle-touchpad = + pkgs.writeShellScriptBin "toggle-touchpad" + (builtins.readFile ./scripts/toggle-touchpad.sh); + auxmenu = + pkgs.writeShellScriptBin "auxmenu" + (builtins.readFile ./scripts/auxmenu.sh); + in + pkgs.buildEnv { + name = "xmonad-runenv"; + paths = with pkgs; [ + brightnessctl + playerctl + dmenu + polybar-mm + polybar + reload + toggle-touchpad + auxmenu + libnotify + x11_ssh_askpass + ]; + }; } diff --git a/home-manager/modules/xmonad/hie.yaml b/home-manager/modules/xmonad/hie.yaml new file mode 100644 index 0000000..cba6934 --- /dev/null +++ b/home-manager/modules/xmonad/hie.yaml @@ -0,0 +1,10 @@ +cradle: + stack: + - path: "./src" + component: "xmonad-config:lib" + + - path: "./app/Main.hs" + component: "xmonad-config:exe:xmonad-exe" + + - path: "./test" + component: "xmonad-config:test:xmonad-test" diff --git a/home-manager/modules/xmonad/package.yaml b/home-manager/modules/xmonad/package.yaml new file mode 100644 index 0000000..6862433 --- /dev/null +++ b/home-manager/modules/xmonad/package.yaml @@ -0,0 +1,64 @@ +name: xmonad-config +version: 0.1.0.0 +github: "githubuser/xmonad" +license: BSD-3-Clause +author: "Author name here" +maintainer: "example@example.com" +copyright: "2023 Author name here" + +extra-source-files: +- README.md +- CHANGELOG.md + +# Metadata used when publishing your package +# synopsis: Short description of your package +# category: Web + +# To avoid duplicated efforts in documentation and dealing with the +# complications of embedding Haddock markup inside cabal files, it is +# common to point users to the README.md file. +description: Please see the README on GitHub at + +dependencies: +- base >= 4.7 && < 5 +- containers +- text +- xmobar +- xmonad +- xmonad-contrib + +ghc-options: +- -Wall +- -Wcompat +- -Widentities +- -Wincomplete-record-updates +- -Wincomplete-uni-patterns +- -Wmissing-export-lists +- -Wmissing-home-modules +- -Wpartial-fields +- -Wredundant-constraints + +library: + source-dirs: src + +executables: + xmonad-exe: + main: Main.hs + source-dirs: app + ghc-options: + - -threaded + - -rtsopts + - -with-rtsopts=-N + dependencies: + - xmonad-config + +tests: + xmonad-test: + main: Spec.hs + source-dirs: test + ghc-options: + - -threaded + - -rtsopts + - -with-rtsopts=-N + dependencies: + - xmonad diff --git a/home-manager/modules/xmonad/scripts/auxmenu.sh b/home-manager/modules/xmonad/scripts/auxmenu.sh new file mode 100644 index 0000000..2d26ae5 --- /dev/null +++ b/home-manager/modules/xmonad/scripts/auxmenu.sh @@ -0,0 +1,59 @@ +export SUDO_ASKPASS=/home/main/.xmonad/runenv/libexec/x11-ssh-askpass + +_options="toggle-mic\ntoggle-wifi\ntoggle-bluetooth\nscreenshot-all\nscreenshot-select\nscreenshot-focused\nsuspend\nreboot\nkexec\npoweroff\nlogout\nnmtui" + +_option="$(echo -e $_options | emacs-rofi "command: " 90 30 | awk '{print $1}' | tr -d '\r\n')" +if [ ''${#_option} -gt 0 ] +then + case $_option in + toggle-mic) + wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle + ;; + toggle-wifi) + if [ "$(nmcli radio wifi)" = "enabled" ] + then + nmcli radio wifi off + else + nmcli radio wifi on + fi + ;; + toggle-bluetooth) + if [ "$(nmcli radio wifi)" = "enabled" ] + then + nmcli radio wifi off + else + nmcli radio wifi on + fi + ;; + screenshot-all) + screenshot screen + ;; + screenshot-select) + screenshot select + ;; + screenshot-focused) + screenshot focused + ;; + suspend) + systemctl suspend + ;; + reboot) + systemctl reboot + ;; + poweroff) + systemctl poweroff + ;; + kexec) + sudo -A kexec -l /run/current-system/kernel --initrd=/run/current-system/initrd --reuse-cmdline + systemctl kexec + ;; + logout) + loginctl terminate-session $XDG_SESSION_ID + ;; + nmtui) + alacritty -e nmtui + ;; + *) + ;; + esac +fi diff --git a/home-manager/modules/xmonad/scripts/polybar-mm.sh b/home-manager/modules/xmonad/scripts/polybar-mm.sh new file mode 100644 index 0000000..53bde93 --- /dev/null +++ b/home-manager/modules/xmonad/scripts/polybar-mm.sh @@ -0,0 +1,3 @@ +monitors=$(polybar --list-monitors | cut -f 1 -d':' | tr '\n' ' ') +monitors=($monitors) +MONITOR=''${monitors[$1]} polybar -c /home/main/dotfiles/home-manager/modules/xmonad/polybar.ini top diff --git a/home-manager/modules/xmonad/scripts/toggle-touchpad.sh b/home-manager/modules/xmonad/scripts/toggle-touchpad.sh new file mode 100644 index 0000000..82405b9 --- /dev/null +++ b/home-manager/modules/xmonad/scripts/toggle-touchpad.sh @@ -0,0 +1,8 @@ +read TPdevice <<< $( xinput | sed -nre '/TouchPad|Touchpad/s/.*id=([0-9]*).*/\1/p' ) +state=$( xinput list-props "$TPdevice" | grep "Device Enabled" | grep -o "[01]$" ) + +if [ "$state" -eq '1' ];then + xinput --disable "$TPdevice" && notify-send -i emblem-nowrite "Touchpad" "Disabled" +else + xinput --enable "$TPdevice" && notify-send -i emblem-nowrite "Touchpad" "Enabled" +fi diff --git a/home-manager/modules/xmonad/scripts/xmonad-reload.sh b/home-manager/modules/xmonad/scripts/xmonad-reload.sh new file mode 100644 index 0000000..7658601 --- /dev/null +++ b/home-manager/modules/xmonad/scripts/xmonad-reload.sh @@ -0,0 +1,9 @@ +notify-send -t 5000 "recompiling xmonad" + +if xmonad --recompile +then + notify-send -t 5000 "compilation succeeded" + xmonad --restart +else + notify-send -t 5000 "compilation failed" +fi diff --git a/home-manager/modules/xmonad/src/Lib.hs b/home-manager/modules/xmonad/src/Lib.hs new file mode 100644 index 0000000..d36ff27 --- /dev/null +++ b/home-manager/modules/xmonad/src/Lib.hs @@ -0,0 +1,6 @@ +module Lib + ( someFunc + ) where + +someFunc :: IO () +someFunc = putStrLn "someFunc" diff --git a/home-manager/modules/xmonad/stack.yaml b/home-manager/modules/xmonad/stack.yaml new file mode 100644 index 0000000..bff1483 --- /dev/null +++ b/home-manager/modules/xmonad/stack.yaml @@ -0,0 +1,69 @@ +# This file was automatically generated by 'stack init' +# +# Some commonly used options have been documented as comments in this file. +# For advanced use and comprehensive documentation of the format, please see: +# https://docs.haskellstack.org/en/stable/yaml_configuration/ + +# Resolver to choose a 'specific' stackage snapshot or a compiler version. +# A snapshot resolver dictates the compiler version and the set of packages +# to be used for project dependencies. For example: +# +# resolver: lts-3.5 +# resolver: nightly-2015-09-21 +# resolver: ghc-7.10.2 +# +# The location of a snapshot can be provided as a file or url. Stack assumes +# a snapshot provided as a file might change, whereas a url resource does not. +# +# resolver: ./custom-snapshot.yaml +# resolver: https://example.com/snapshots/2018-01-01.yaml +resolver: lts-21.11 + +# User packages to be built. +# Various formats can be used as shown in the example below. +# +# packages: +# - some-directory +# - https://example.com/foo/bar/baz-0.0.2.tar.gz +# subdirs: +# - auto-update +# - wai +packages: + - . +# Dependency packages to be pulled from upstream that are not in the resolver. +# These entries can reference officially published versions as well as +# forks / in-progress versions pinned to a git hash. For example: +# +extra-deps: + - .packages/xmobar + - .packages/xmonad-contrib + - .packages/xmonad +# +# extra-deps: [] + +# Override default flag values for local packages and extra-deps +flags: + # xmobar: + # all_extensions: true + +# Extra package databases containing global packages +# extra-package-dbs: [] + +# Control whether we use the GHC we find on the path +# system-ghc: true +# +# Require a specific version of Stack, using version ranges +# require-stack-version: -any # Default +# require-stack-version: ">=2.11" +# +# Override the architecture used by Stack, especially useful on Windows +# arch: i386 +# arch: x86_64 +# +# Extra directories used by Stack for building +# extra-include-dirs: [/path/to/dir] +# extra-lib-dirs: [/path/to/dir] +# +# Allow a newer minor version of GHC than the snapshot specifies +# compiler-check: newer-minor +allow-newer: true diff --git a/home-manager/modules/xmonad/stack.yaml.lock b/home-manager/modules/xmonad/stack.yaml.lock new file mode 100644 index 0000000..30cbd43 --- /dev/null +++ b/home-manager/modules/xmonad/stack.yaml.lock @@ -0,0 +1,12 @@ +# This file was autogenerated by Stack. +# You should not edit this file by hand. +# For more information, please see the documentation at: +# https://docs.haskellstack.org/en/stable/lock_files + +packages: [] +snapshots: +- completed: + sha256: 64d66303f927e87ffe6b8ccf736229bf608731e80d7afdf62bdd63c59f857740 + size: 640037 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/21/11.yaml + original: lts-21.11 diff --git a/home-manager/modules/xmonad/test/Spec.hs b/home-manager/modules/xmonad/test/Spec.hs new file mode 100644 index 0000000..cd4753f --- /dev/null +++ b/home-manager/modules/xmonad/test/Spec.hs @@ -0,0 +1,2 @@ +main :: IO () +main = putStrLn "Test suite not yet implemented" diff --git a/home-manager/modules/xmonad/xmonad-config.cabal b/home-manager/modules/xmonad/xmonad-config.cabal new file mode 100644 index 0000000..0399558 --- /dev/null +++ b/home-manager/modules/xmonad/xmonad-config.cabal @@ -0,0 +1,80 @@ +cabal-version: 2.2 + +-- This file has been generated from package.yaml by hpack version 0.35.2. +-- +-- see: https://github.com/sol/hpack + +name: xmonad-config +version: 0.1.0.0 +description: Please see the README on GitHub at +homepage: https://github.com/githubuser/xmonad#readme +bug-reports: https://github.com/githubuser/xmonad/issues +author: Author name here +maintainer: example@example.com +copyright: 2023 Author name here +license: BSD-3-Clause +build-type: Simple +extra-source-files: + README.md + CHANGELOG.md + +source-repository head + type: git + location: https://github.com/githubuser/xmonad + +library + exposed-modules: + Lib + other-modules: + Paths_xmonad_config + autogen-modules: + Paths_xmonad_config + hs-source-dirs: + src + ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints + build-depends: + base >=4.7 && <5 + , containers + , text + , xmobar + , xmonad + , xmonad-contrib + default-language: Haskell2010 + +executable xmonad-exe + main-is: Main.hs + other-modules: + Paths_xmonad_config + autogen-modules: + Paths_xmonad_config + hs-source-dirs: + app + ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N + build-depends: + base >=4.7 && <5 + , containers + , text + , xmobar + , xmonad + , xmonad-config + , xmonad-contrib + default-language: Haskell2010 + +test-suite xmonad-test + type: exitcode-stdio-1.0 + main-is: Spec.hs + other-modules: + Paths_xmonad_config + autogen-modules: + Paths_xmonad_config + hs-source-dirs: + test + ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N + build-depends: + base >=4.7 && <5 + , containers + , text + , xmobar + , xmonad + , xmonad-contrib + default-language: Haskell2010