{ description = "Personal XMonad configuration."; inputs = { nixpkgs = { type = "github"; owner = "NixOS"; repo = "nixpkgs"; ref = "nixpkgs-unstable"; }; flake-utils = { type = "github"; owner = "numtide"; repo = "flake-utils"; ref = "master"; inputs.nixpkgs.follows = "nixpkgs"; }; flake-compat = { type = "github"; owner = "edolstra"; repo = "flake-compat"; ref = "master"; flake = false; }; pre-commit-hooks = { type = "github"; owner = "cachix"; repo = "pre-commit-hooks.nix"; ref = "master"; inputs = { nixpkgs.follows = "nixpkgs"; flake-utils.follows = "flake-utils"; }; }; }; outputs = inputs: with inputs; let name = "xmonad-ng"; in flake-utils.lib.eachSystem [ "x86_64-linux" ] (system: let pkgs = nixpkgs.legacyPackages.${system}; project = returnShellEnv: pkgs.haskellPackages.developPackage { inherit name returnShellEnv; root = ./.; overrides = self: _: with pkgs.haskell.lib; let mkPackage = packageName: dontCheck (self.callHackage packageName "0.17.0" { }); in { xmonad = mkPackage "xmonad"; xmonad-contrib = mkPackage "xmonad-contrib"; }; modifier = drv: pkgs.haskell.lib.addBuildTools drv (with pkgs.haskellPackages; [ brittany cabal-install haskell-language-server hlint hpack stack ]); }; in { defaultPackage = project false; checks.preCommit = pre-commit-hooks.lib.${system}.run { src = ./.; hooks = { nix-linter.enable = true; nixfmt.enable = true; hpack.enable = true; hlint.enable = true; yamllint.enable = true; brittany.enable = true; shellcheck.enable = true; shfmt = { enable = true; name = "shfmt"; entry = "${pkgs.shfmt}/bin/shfmt -s -w"; types = [ "shell" ]; }; prettier = { enable = true; types = [ ]; files = "\\.((yaml)|\\d)$"; }; }; }; shells = { dev = project true; commit = pkgs.mkShell { inherit (self.checks.${system}.preCommit) shellHook; }; }; devShell = self.shells.${system}.dev; }) // { overlay = _: _: { ${name} = self.defaultPackage; }; }; }