diff options
author | Azat Bahawi <azahi@teknik.io> | 2021-11-22 00:46:38 +0300 |
---|---|---|
committer | Azat Bahawi <azahi@teknik.io> | 2021-11-22 00:46:38 +0300 |
commit | 49f1d6b3acece70f886e3d52f7a8cb336b7f3f63 (patch) | |
tree | 9dd71b3db9df8b6c0d26a6e2d2e68cb3048df341 | |
parent | Whoops (diff) |
Making progress
Diffstat (limited to '')
-rw-r--r-- | cabal.project | 8 | ||||
-rw-r--r-- | flake.lock | 281 | ||||
-rw-r--r-- | flake.nix | 57 | ||||
-rw-r--r-- | src/Main.hs | 32 | ||||
-rw-r--r-- | src/XMonad/Custom/Layout.hs | 2 | ||||
-rw-r--r-- | src/XMonad/Custom/Log.hs | 1 | ||||
-rw-r--r-- | src/XMonad/Custom/Misc.hs | 1 | ||||
-rw-r--r-- | src/XMonad/Custom/Startup.hs | 1 | ||||
-rw-r--r-- | xmonad-ng.cabal | 3 |
9 files changed, 64 insertions, 322 deletions
diff --git a/cabal.project b/cabal.project index 6f92079..6866765 100644 --- a/cabal.project +++ b/cabal.project @@ -1 +1,7 @@ -packages: ./ +packages: ./. + +package xmonad-contrib + flags: +with_xft + +package xmobar + flags: +with_xft diff --git a/flake.lock b/flake.lock index daa8f27..f9f38e6 100644 --- a/flake.lock +++ b/flake.lock @@ -1,242 +1,12 @@ { "nodes": { - "HTTP": { - "flake": false, + "nixpkgs": { "locked": { - "lastModified": 1451647621, - "narHash": "sha256-oHIyw3x0iKBexEo49YeUDV1k74ZtyYKGR2gNJXXRxts=", - "owner": "phadej", - "repo": "HTTP", - "rev": "9bc0996d412fef1787449d841277ef663ad9a915", - "type": "github" - }, - "original": { - "owner": "phadej", - "repo": "HTTP", - "type": "github" - } - }, - "cabal-32": { - "flake": false, - "locked": { - "lastModified": 1603716527, - "narHash": "sha256-sDbrmur9Zfp4mPKohCD8IDZfXJ0Tjxpmr2R+kg5PpSY=", - "owner": "haskell", - "repo": "cabal", - "rev": "94aaa8e4720081f9c75497e2735b90f6a819b08e", - "type": "github" - }, - "original": { - "owner": "haskell", - "ref": "3.2", - "repo": "cabal", - "type": "github" - } - }, - "cabal-34": { - "flake": false, - "locked": { - "lastModified": 1622475795, - "narHash": "sha256-chwTL304Cav+7p38d9mcb+egABWmxo2Aq+xgVBgEb/U=", - "owner": "haskell", - "repo": "cabal", - "rev": "b086c1995cdd616fc8d91f46a21e905cc50a1049", - "type": "github" - }, - "original": { - "owner": "haskell", - "ref": "3.4", - "repo": "cabal", - "type": "github" - } - }, - "cardano-shell": { - "flake": false, - "locked": { - "lastModified": 1608537748, - "narHash": "sha256-PulY1GfiMgKVnBci3ex4ptk2UNYMXqGjJOxcPy2KYT4=", - "owner": "input-output-hk", - "repo": "cardano-shell", - "rev": "9392c75087cb9a3d453998f4230930dea3a95725", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "repo": "cardano-shell", - "type": "github" - } - }, - "flake-utils": { - "locked": { - "lastModified": 1623875721, - "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "f7e004a55b120c02ecb6219596820fcd32ca8772", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "ghc-8.6.5-iohk": { - "flake": false, - "locked": { - "lastModified": 1600920045, - "narHash": "sha256-DO6kxJz248djebZLpSzTGD6s8WRpNI9BTwUeOf5RwY8=", - "owner": "input-output-hk", - "repo": "ghc", - "rev": "95713a6ecce4551240da7c96b6176f980af75cae", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "ref": "release/8.6.5-iohk", - "repo": "ghc", - "type": "github" - } - }, - "hackage": { - "flake": false, - "locked": { - "lastModified": 1635037915, - "narHash": "sha256-I+mPG1w2homLMzqwbs32IsSlmJtLaoer3n5jczWl65o=", - "owner": "input-output-hk", - "repo": "hackage.nix", - "rev": "38dc0a55e3efd065c7e9f0c5e7ff2d056e421fe7", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "repo": "hackage.nix", - "type": "github" - } - }, - "haskell-nix": { - "inputs": { - "HTTP": "HTTP", - "cabal-32": "cabal-32", - "cabal-34": "cabal-34", - "cardano-shell": "cardano-shell", - "flake-utils": "flake-utils", - "ghc-8.6.5-iohk": "ghc-8.6.5-iohk", - "hackage": "hackage", - "hpc-coveralls": "hpc-coveralls", - "nix-tools": "nix-tools", - "nixpkgs": [ - "haskell-nix", - "nixpkgs-2105" - ], - "nixpkgs-2003": "nixpkgs-2003", - "nixpkgs-2009": "nixpkgs-2009", - "nixpkgs-2105": "nixpkgs-2105", - "nixpkgs-unstable": "nixpkgs-unstable", - "old-ghc-nix": "old-ghc-nix", - "stackage": "stackage" - }, - "locked": { - "lastModified": 1635038099, - "narHash": "sha256-ULhJ/nsZ1bvy99VASxNIAXSm8SePnANInTuHGZbgOg4=", - "owner": "input-output-hk", - "repo": "haskell.nix", - "rev": "c4e4d8dd7c23cb66df5ecc8ceb0733b27e9d1525", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "repo": "haskell.nix", - "type": "github" - } - }, - "hpc-coveralls": { - "flake": false, - "locked": { - "lastModified": 1607498076, - "narHash": "sha256-8uqsEtivphgZWYeUo5RDUhp6bO9j2vaaProQxHBltQk=", - "owner": "sevanspowell", - "repo": "hpc-coveralls", - "rev": "14df0f7d229f4cd2e79f8eabb1a740097fdfa430", - "type": "github" - }, - "original": { - "owner": "sevanspowell", - "repo": "hpc-coveralls", - "type": "github" - } - }, - "nix-tools": { - "flake": false, - "locked": { - "lastModified": 1627889534, - "narHash": "sha256-9eEbK2nrRp6rYGQoBv6LO9IA/ANZpofwAkxMuGBD45Y=", - "owner": "input-output-hk", - "repo": "nix-tools", - "rev": "15d2e4b61cb63ff351f3c490c12c4d89eafd31a1", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "repo": "nix-tools", - "type": "github" - } - }, - "nixpkgs-2003": { - "locked": { - "lastModified": 1620055814, - "narHash": "sha256-8LEHoYSJiL901bTMVatq+rf8y7QtWuZhwwpKE2fyaRY=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "1db42b7fe3878f3f5f7a4f2dc210772fd080e205", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-20.03-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-2009": { - "locked": { - "lastModified": 1624271064, - "narHash": "sha256-qns/uRW7MR2EfVf6VEeLgCsCp7pIOjDeR44JzTF09MA=", + "lastModified": 1637453606, + "narHash": "sha256-Gy6cwUswft9xqsjWxFYEnx/63/qzaFUwatcbV5GF/GQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "46d1c3f28ca991601a53e9a14fdd53fcd3dd8416", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-20.09-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-2105": { - "locked": { - "lastModified": 1630481079, - "narHash": "sha256-leWXLchbAbqOlLT6tju631G40SzQWPqaAXQG3zH1Imw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "110a2c9ebbf5d4a94486854f18a37a938cfacbbb", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-21.05-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-unstable": { - "locked": { - "lastModified": 1628785280, - "narHash": "sha256-2B5eMrEr6O8ff2aQNeVxTB+9WrGE80OB4+oM6T7fOcc=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "6525bbc06a39f26750ad8ee0d40000ddfdc24acb", + "rev": "8afc4e543663ca0a6a4f496262cd05233737e732", "type": "github" }, "original": { @@ -246,50 +16,9 @@ "type": "github" } }, - "old-ghc-nix": { - "flake": false, - "locked": { - "lastModified": 1631092763, - "narHash": "sha256-sIKgO+z7tj4lw3u6oBZxqIhDrzSkvpHtv0Kki+lh9Fg=", - "owner": "angerman", - "repo": "old-ghc-nix", - "rev": "af48a7a7353e418119b6dfe3cd1463a657f342b8", - "type": "github" - }, - "original": { - "owner": "angerman", - "ref": "master", - "repo": "old-ghc-nix", - "type": "github" - } - }, "root": { "inputs": { - "flake-utils": [ - "haskell-nix", - "flake-utils" - ], - "haskell-nix": "haskell-nix", - "nixpkgs": [ - "haskell-nix", - "nixpkgs-unstable" - ] - } - }, - "stackage": { - "flake": false, - "locked": { - "lastModified": 1635038033, - "narHash": "sha256-3AliGUxmwAhWIlsA5oAj1PsGpytq4CWEKAnyZSpjfwU=", - "owner": "input-output-hk", - "repo": "stackage.nix", - "rev": "248b1a35980778c95543fbdc38841bb4a1a6385c", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "repo": "stackage.nix", - "type": "github" + "nixpkgs": "nixpkgs" } } }, diff --git a/flake.nix b/flake.nix index 6d8dda1..1fb71dc 100644 --- a/flake.nix +++ b/flake.nix @@ -1,43 +1,34 @@ { description = "Personal XMonad configuration."; - inputs = { - haskell-nix.url = "github:input-output-hk/haskell.nix"; - nixpkgs.follows = "haskell-nix/nixpkgs-unstable"; - flake-utils.follows = "haskell-nix/flake-utils"; + inputs.nixpkgs = { + type = "github"; + owner = "NixOS"; + repo = "nixpkgs"; + ref = "nixpkgs-unstable"; }; - outputs = { nixpkgs, flake-utils, haskell-nix, ... }: - flake-utils.lib.eachDefaultSystem (system: - let - pkgs = import nixpkgs { - inherit system overlays; - inherit (haskell-nix) config; - }; - overlays = [ - haskell-nix.overlay - (final: _: { - xmonad-ng = final.haskell-nix.project' { - src = ./.; - - compiler-nix-name = "ghc8107"; + outputs = { nixpkgs, ... }: + let + system = "x86_64-linux"; - shell = { - tools = { - brittany = { }; - cabal = { }; - haskell-language-server = { }; - hlint = { }; - }; + pkgs = import nixpkgs { inherit system; }; - buildInputs = with pkgs; [ nixfmt ]; - }; + project = returnShellEnv: + pkgs.haskellPackages.developPackage { + inherit returnShellEnv; + name = "xmonad-ng"; + root = ./.; + withHoogle = false; + overrides = self: super: + with pkgs.haskell.lib; + { + # TODO Override xmobar. }; - }) - ]; + }; + in { + defaultPackage.${system} = project false; - flake = pkgs.xmonad-ng.flake { }; - in flake // { - defaultPackage = flake.packages."xmonad-ng:exe:xmonad-ng"; - }); + devShell.${system} = project true; + }; } diff --git a/src/Main.hs b/src/Main.hs index 23514e1..74b63a1 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -5,13 +5,31 @@ -- Maintainer : Azat Bahawi <azahi@teknik.io> -- Stability : unstable -- Portability : unportable --- module Main where -import XMonad -import XMonad.Actions.DynamicProjects -import XMonad.Actions.Navigation2D +import XMonad ( Default(def) + , XConfig + ( borderWidth + , clickJustFocuses + , focusFollowsMouse + , focusedBorderColor + , handleEventHook + , keys + , layoutHook + , logHook + , manageHook + , modMask + , mouseBindings + , normalBorderColor + , startupHook + , terminal + , workspaces + ) + , xmonad + ) +import XMonad.Actions.DynamicProjects ( dynamicProjects ) +import XMonad.Actions.Navigation2D ( withNavigation2DConfig ) import qualified XMonad.Custom.Bindings as C import qualified XMonad.Custom.Event as C import qualified XMonad.Custom.Layout as C @@ -23,9 +41,9 @@ import qualified XMonad.Custom.Projects as C import qualified XMonad.Custom.Startup as C import qualified XMonad.Custom.Theme as C import qualified XMonad.Custom.Workspaces as C -import XMonad.Hooks.EwmhDesktops -import XMonad.Hooks.ManageDocks -import XMonad.Layout.Fullscreen +import XMonad.Hooks.EwmhDesktops ( ewmh ) +import XMonad.Hooks.ManageDocks ( docks ) +import XMonad.Layout.Fullscreen ( fullscreenSupport ) main :: IO () main = diff --git a/src/XMonad/Custom/Layout.hs b/src/XMonad/Custom/Layout.hs index c7989b4..fe9224a 100644 --- a/src/XMonad/Custom/Layout.hs +++ b/src/XMonad/Custom/Layout.hs @@ -50,7 +50,7 @@ layoutHook = $ mkToggle (single NBFULL) $ avoidStruts $ applySpacing - -- $ mkToggle (single GAPS) + $ mkToggle (single GAPS) $ mkToggle (single REFLECTX) $ mkToggle (single REFLECTY) $ windowNavigation diff --git a/src/XMonad/Custom/Log.hs b/src/XMonad/Custom/Log.hs index bfd7093..6b7af37 100644 --- a/src/XMonad/Custom/Log.hs +++ b/src/XMonad/Custom/Log.hs @@ -5,7 +5,6 @@ -- Maintainer : Azat Bahawi <azahi@teknik.io> -- Stability : unstable -- Portability : unportable --- module XMonad.Custom.Log ( logHook diff --git a/src/XMonad/Custom/Misc.hs b/src/XMonad/Custom/Misc.hs index e43e171..aa48ee2 100644 --- a/src/XMonad/Custom/Misc.hs +++ b/src/XMonad/Custom/Misc.hs @@ -7,7 +7,6 @@ -- Maintainer : Azat Bahawi <azahi@teknik.io> -- Stability : unstable -- Portability : unportable --- module XMonad.Custom.Misc ( Applications(..) diff --git a/src/XMonad/Custom/Startup.hs b/src/XMonad/Custom/Startup.hs index 5a755b2..cdd63ac 100644 --- a/src/XMonad/Custom/Startup.hs +++ b/src/XMonad/Custom/Startup.hs @@ -5,7 +5,6 @@ -- Maintainer : Azat Bahawi <azahi@teknik.io> -- Stability : unstable -- Portability : unportable --- module XMonad.Custom.Startup ( startupHook diff --git a/xmonad-ng.cabal b/xmonad-ng.cabal index 7fa6973..d8804b2 100644 --- a/xmonad-ng.cabal +++ b/xmonad-ng.cabal @@ -55,6 +55,7 @@ executable xmonad-ng , text ^>=1.2 , time ^>=1.9 , X11 ^>=1.10 + , xmobar ^>=0.40 , xmonad ^>=0.15 , xmonad-contrib ^>=0.16 @@ -66,4 +67,4 @@ executable xmonad-ng MultiParamTypeClasses TypeSynonymInstances - ghc-options: -Wall + ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -v0 -O2 -threaded -rtsopts -with-rtsopts=-N |