mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
Merge pull request #589 from IvanMalison/customizableNixDevelop
Provide a mechanism by which users can customize the nix devShell
This commit is contained in:
commit
974c10dca7
1
.gitignore
vendored
1
.gitignore
vendored
@ -27,3 +27,4 @@ tags
|
|||||||
|
|
||||||
stack.yaml.lock
|
stack.yaml.lock
|
||||||
|
|
||||||
|
flake.lock
|
||||||
|
17
NIX.md
Normal file
17
NIX.md
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# `nix` integration for XMonad
|
||||||
|
|
||||||
|
## Customizing the `nix-shell`
|
||||||
|
|
||||||
|
It's possible to use a file `develop.nix` to customize the `devShell`
|
||||||
|
provided by the flake. This is useful if e.g. you want to have the
|
||||||
|
`haskell-language-server` or other developer tools in the shell properly
|
||||||
|
configured (correct GHC versions, and the like).
|
||||||
|
|
||||||
|
Here is an example `develop.nix` for `haskell-language-server`:
|
||||||
|
|
||||||
|
``` nix
|
||||||
|
pkgs: devInputs: devInputs // {
|
||||||
|
nativeBuildInputs = with pkgs.haskellPackages;
|
||||||
|
[ cabal-install hlint ghcid ormolu implicit-hie haskell-language-server ];
|
||||||
|
}
|
||||||
|
```
|
11
flake.nix
11
flake.nix
@ -18,13 +18,18 @@
|
|||||||
};
|
};
|
||||||
overlays = xmonad.overlays ++ [ overlay ];
|
overlays = xmonad.overlays ++ [ overlay ];
|
||||||
in flake-utils.lib.eachDefaultSystem (system:
|
in flake-utils.lib.eachDefaultSystem (system:
|
||||||
let pkgs = import nixpkgs { inherit system overlays; };
|
let
|
||||||
|
pkgs = import nixpkgs { inherit system overlays; };
|
||||||
|
modifyDevShell =
|
||||||
|
if builtins.pathExists ./develop.nix
|
||||||
|
then import ./develop.nix
|
||||||
|
else _: x: x;
|
||||||
in
|
in
|
||||||
rec {
|
rec {
|
||||||
devShell = pkgs.haskellPackages.shellFor {
|
devShell = pkgs.haskellPackages.shellFor (modifyDevShell pkgs {
|
||||||
packages = p: [ p.xmonad-contrib ];
|
packages = p: [ p.xmonad-contrib ];
|
||||||
nativeBuildInputs = [ pkgs.cabal-install ];
|
nativeBuildInputs = [ pkgs.cabal-install ];
|
||||||
};
|
});
|
||||||
defaultPackage = pkgs.haskellPackages.xmonad-contrib;
|
defaultPackage = pkgs.haskellPackages.xmonad-contrib;
|
||||||
}) // { inherit overlay overlays; } ;
|
}) // { inherit overlay overlays; } ;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ license: BSD3
|
|||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Spencer Janssen & others
|
author: Spencer Janssen & others
|
||||||
maintainer: xmonad@haskell.org
|
maintainer: xmonad@haskell.org
|
||||||
extra-source-files: README.md CHANGES.md scripts/generate-configs scripts/run-xmonad.sh
|
extra-source-files: README.md CHANGES.md NIX.md scripts/generate-configs scripts/run-xmonad.sh
|
||||||
scripts/window-properties.sh
|
scripts/window-properties.sh
|
||||||
scripts/xinitrc scripts/xmonad-acpi.c
|
scripts/xinitrc scripts/xmonad-acpi.c
|
||||||
scripts/xmonad-clock.c
|
scripts/xmonad-clock.c
|
||||||
|
Loading…
x
Reference in New Issue
Block a user