clean nix files a bit

This commit is contained in:
nek0 2023-12-16 06:30:30 +01:00
parent 169a76bd9c
commit df8b17ec36
3 changed files with 13 additions and 16 deletions

5
default.nix Normal file
View file

@ -0,0 +1,5 @@
{ pkgs ? import <nixpkgs> {}, self ? ./., packageName ? "chaoszone" }:
let
gitignore = dir: pkgs.nix-gitignore.gitignoreSource [] dir;
in
pkgs.haskellPackages.callCabal2nix packageName (gitignore self) {}

View file

@ -18,22 +18,11 @@
packageName = "chaoszone";
in rec {
packages.${packageName} = # (ref:haskell-package-def)
haskellPackages.callCabal2nix packageName self rec {
};
packages.${packageName} = import ./default.nix {inherit pkgs self;};
defaultPackage = self.packages.${system}.${packageName};
devShell = haskellPackages.shellFor {
packages = p: [ defaultPackage ];
withHoogle = true;
buildInputs = with haskellPackages; with pkgs; [
vim
haskell-language-server
ghcid
cabal-install
];
};
devShell = import ./shell.nix {inherit pkgs; chaoszone = defaultPackage;};
#devShell = pkgs.mkShell {
# buildInputs = with haskellPackages; [
# haskell-language-server

View file

@ -1,8 +1,11 @@
{ pkgs ? import <nixpkgs> {}}:
{ pkgs ? import <nixpkgs> {}, chaoszone ? null}:
let
chaoszone_cz =
pkgs.haskellPackages.callCabal2nix "chaoszone" (gitignore ./.) {};
chaoszone_cz = if isNull chaoszone
then
(import ./default.nix {inherit pkgs; packageName = "chaoszone";})
else
chaoszone;
gitignore = dir: pkgs.nix-gitignore.gitignoreSource [] dir;
in
pkgs.haskellPackages.shellFor {