Compare commits

...

4 commits

4 changed files with 272 additions and 119 deletions

113
flake.lock generated
View file

@ -103,6 +103,22 @@
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1668681692,
@ -136,6 +152,45 @@
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"pre-commit-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1703887061,
"narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@ -362,6 +417,22 @@
"type": "github"
}
},
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1704874635,
"narHash": "sha256-YWuCrtsty5vVZvu+7BchAxmcYzTMfolSPP5io8+WYCg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3dc440faeee9e889fe2d1b4d25ad0f430d449356",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1705316053,
@ -441,6 +512,30 @@
"type": "gitlab"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils_2",
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable_2"
},
"locked": {
"lastModified": 1708018599,
"narHash": "sha256-M+Ng6+SePmA8g06CmUZWi1AjG2tFBX9WCXElBHEKnyM=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "5df5a70ad7575f6601d91f0efec95dd9bc619431",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"agenix": "agenix",
@ -452,13 +547,14 @@
"nixpkgs": "nixpkgs",
"nixpkgs-droid": "nixpkgs-droid",
"nixpkgs-unstable": "nixpkgs-unstable",
"pre-commit-hooks": "pre-commit-hooks",
"snm": "snm"
}
},
"snm": {
"inputs": {
"blobs": "blobs",
"flake-compat": "flake-compat",
"flake-compat": "flake-compat_2",
"nixpkgs": "nixpkgs_2",
"nixpkgs-22_11": "nixpkgs-22_11",
"nixpkgs-23_05": "nixpkgs-23_05",
@ -494,6 +590,21 @@
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"locked": {
"lastModified": 1659877975,

View file

@ -4,6 +4,9 @@
nixpkgs-droid.url = "github:NixOS/nixpkgs/nixos-23.05";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs";
home-manager = {
url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs";
@ -45,7 +48,25 @@
disko.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { home-manager, nixpkgs, nixpkgs-unstable, ... }@inputs: {
outputs = { self, home-manager, nixpkgs, nixpkgs-unstable, pre-commit-hooks
, ... }@inputs: {
checks."x86_64-linux" = let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
in {
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.;
settings = { ormolu.defaultExtensions = [ "GHC2021" ]; };
tools.fourmolu = pkgs.haskellPackages.fourmolu;
hooks = {
nixfmt.enable = true;
fourmolu.enable = true;
hpack.enable = true;
hlint.enable = true;
};
};
};
nixosConfigurations."thrall" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
@ -91,5 +112,30 @@
{ nix.nixPath = [ "nixpkgs=${nixpkgs-droid}" ]; }
];
};
devShells."x86_64-linux".default = let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
in pkgs.haskellPackages.shellFor {
inherit (self.checks.${system}.pre-commit-check) shellHook;
packages = p: [ p.xmonad p.xmonad-contrib ];
withHoogle = true;
nativeBuildInputs = with pkgs; [
haskellPackages.haskell-language-server
haskellPackages.fourmolu
haskellPackages.hspec-discover
haskellPackages.doctest
haskellPackages.xmonad
haskellPackages.xmonad-contrib
cabal-install
ghcid
nixfmt
hpack
hlint
];
};
};
}

View file

@ -121,11 +121,11 @@
;; will define elisp functions for the given lsp code actions, prefixing the
;; given function names with "lsp"
(lsp-make-interactive-code-action wingman-fill-hole "refactor.wingman.fillHole")
(lsp-make-interactive-code-action wingman-case-split "refactor.wingman.caseSplit")
(lsp-make-interactive-code-action wingman-refine "refactor.wingman.refine")
(lsp-make-interactive-code-action wingman-split-func-args "refactor.wingman.spltFuncArgs")
(lsp-make-interactive-code-action wingman-use-constructor "refactor.wingman.useConstructor")
;;(lsp-make-interactive-code-action wingman-fill-hole "refactor.wingman.fillHole")
;;(lsp-make-interactive-code-action wingman-case-split "refactor.wingman.caseSplit")
;;(lsp-make-interactive-code-action wingman-refine "refactor.wingman.refine")
;;(lsp-make-interactive-code-action wingman-split-func-args "refactor.wingman.spltFuncArgs")
;;(lsp-make-interactive-code-action wingman-use-constructor "refactor.wingman.useConstructor")
;; example key bindings
;; (define-key haskell-mode-map (kbd "C-c d") #'lsp-wingman-case-split)

View file

@ -1,23 +1,23 @@
import XMonad
import XMonad.Actions.CycleWS qualified as WS
import XMonad.Actions.Navigation2D (navigation2DP, windowGo, windowSwap)
import qualified XMonad.Actions.CycleWS as WS
import XMonad.Util.Ungrab (unGrab)
import XMonad.Layout.ThreeColumns
import XMonad.Layout.ToggleLayouts (ToggleLayout(..), toggleLayouts)
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.ManageDocks qualified as Docks
import XMonad.Hooks.SetWMName
import XMonad.Layout.BinarySpacePartition
import XMonad.Layout.BorderResize (borderResize)
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.SetWMName
import qualified XMonad.Hooks.ManageDocks as Docks
import qualified XMonad.Util.EZConfig as EZ
import XMonad.Layout.ThreeColumns
import XMonad.Layout.ToggleLayouts (ToggleLayout (..), toggleLayouts)
import XMonad.Util.EZConfig qualified as EZ
import XMonad.Util.Ungrab (unGrab)
import Numeric.Natural
import Control.Monad (when)
import Text.Printf (printf)
import System.Posix.Process (executeFile)
import System.Info (arch,os)
import Numeric.Natural
import System.Environment (getArgs)
import System.FilePath ((</>))
import System.Info (arch, os)
import System.Posix.Process (executeFile)
import Text.Printf (printf)
compiledConfig = printf "xmonad-%s-%s" arch os
@ -31,14 +31,9 @@ compileRestart resume = do
executeFile (cacheDir dirs </> compiledConfig) False args Nothing
)
myLayout = borderResize $ Docks.avoidStruts $ layout
myLayout = borderResize $ Docks.avoidStruts layout
where
layout = (emptyBSP ||| columns ||| tiled ||| Full)
tiled = Tall nmaster delta ratio
columns = ThreeColMid nmaster delta ratio
nmaster = 1 -- default number of windows in the master pane
ratio = 1/2 -- default proportion occupied by master pane
delta = 3/100 -- percent of screen to increment when resizing
layout = emptyBSP ||| Full
main :: IO ()
main = getDirectories >>= launch myConfig
@ -48,7 +43,8 @@ main = getDirectories >>= launch myConfig
windowMoveSplit :: Direction2D -> Bool -> X ()
windowMoveSplit direction _ = sendMessage $ MoveSplit direction
data VolumeCommand = ToggleVolume
data VolumeCommand
= ToggleVolume
| LowerVolume Natural
| RaiseVolume Natural
@ -63,15 +59,19 @@ interpretVolumeCommand command = "amixer -q set Master " <> cmd
changeVolume :: VolumeCommand -> X ()
changeVolume = spawn . interpretVolumeCommand
myConfig = ewmhFullscreen $ ewmh $ Docks.docks $ nav $ def
myConfig =
Docks.docks
. ewmh
. ewmhFullscreen
. nav
$ def
{ modMask = mod4Mask -- Use Super instead of Alt
, terminal = "alacritty"
, layoutHook = myLayout
-- this seems to be necessary to make java gui applications work :(
, startupHook = ewmhDesktopsStartup >> setWMName "LG3D"
, -- this seems to be necessary to make java gui applications work :(
startupHook = ewmhDesktopsStartup >> setWMName "LG3D"
}
`EZ.additionalKeysP`
[ ("M-S-z", spawn "xscreensaver-command -lock")
`EZ.additionalKeysP` [ ("M-S-z", spawn "xscreensaver-command -lock")
, ("M-S-r", compileRestart True)
, ("M-S-q", restart "xmonad" True)
, ("M-C-s", unGrab *> spawn "scrot -s")
@ -83,20 +83,17 @@ myConfig = ewmhFullscreen $ ewmh $ Docks.docks $ nav $ def
, ("M-l", WS.toggleWS)
, ("M-g", WS.prevWS)
, ("M-r", WS.nextWS)
, -- backlight control
-- backlight control
, ("<XF86MonBrightnessDown>", spawn "xbacklight -dec 5")
("<XF86MonBrightnessDown>", spawn "xbacklight -dec 5")
, ("<XF86MonBrightnessUp>", spawn "xbacklight -inc 5")
, ("<F5>", spawn "xbacklight -dec 5")
, ("<F6>", spawn "xbacklight -inc 5")
, -- volume control
-- volume control
, ("<XF86AudioMute>", changeVolume ToggleVolume)
("<XF86AudioMute>", changeVolume ToggleVolume)
, ("<XF86AudioLowerVolume>", changeVolume $ LowerVolume 5)
, ("<XF86AudioRaiseVolume>", changeVolume $ RaiseVolume 5)
, ("M-a", sendMessage Balance)
, ("M-S-a", sendMessage Equalize)
, ("M-o", sendMessage Rotate)
@ -107,7 +104,6 @@ myConfig = ewmhFullscreen $ ewmh $ Docks.docks $ nav $ def
appLauncher = "rofi -show combi -modes combi -combi-modes window,drun,run,ssh"
passLauncher = "rofi-pass"
-- myManageHook :: ManageHook
-- myManageHook = composeAll
-- [ className =? "Gimp" --> doFloat