clean nix files a bit
This commit is contained in:
parent
169a76bd9c
commit
df8b17ec36
3 changed files with 13 additions and 16 deletions
5
default.nix
Normal file
5
default.nix
Normal 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) {}
|
15
flake.nix
15
flake.nix
|
@ -18,22 +18,11 @@
|
||||||
|
|
||||||
packageName = "chaoszone";
|
packageName = "chaoszone";
|
||||||
in rec {
|
in rec {
|
||||||
packages.${packageName} = # (ref:haskell-package-def)
|
packages.${packageName} = import ./default.nix {inherit pkgs self;};
|
||||||
haskellPackages.callCabal2nix packageName self rec {
|
|
||||||
};
|
|
||||||
|
|
||||||
defaultPackage = self.packages.${system}.${packageName};
|
defaultPackage = self.packages.${system}.${packageName};
|
||||||
|
|
||||||
devShell = haskellPackages.shellFor {
|
devShell = import ./shell.nix {inherit pkgs; chaoszone = defaultPackage;};
|
||||||
packages = p: [ defaultPackage ];
|
|
||||||
withHoogle = true;
|
|
||||||
buildInputs = with haskellPackages; with pkgs; [
|
|
||||||
vim
|
|
||||||
haskell-language-server
|
|
||||||
ghcid
|
|
||||||
cabal-install
|
|
||||||
];
|
|
||||||
};
|
|
||||||
#devShell = pkgs.mkShell {
|
#devShell = pkgs.mkShell {
|
||||||
# buildInputs = with haskellPackages; [
|
# buildInputs = with haskellPackages; [
|
||||||
# haskell-language-server
|
# haskell-language-server
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
{ pkgs ? import <nixpkgs> {}}:
|
{ pkgs ? import <nixpkgs> {}, chaoszone ? null}:
|
||||||
|
|
||||||
let
|
let
|
||||||
chaoszone_cz =
|
chaoszone_cz = if isNull chaoszone
|
||||||
pkgs.haskellPackages.callCabal2nix "chaoszone" (gitignore ./.) {};
|
then
|
||||||
|
(import ./default.nix {inherit pkgs; packageName = "chaoszone";})
|
||||||
|
else
|
||||||
|
chaoszone;
|
||||||
gitignore = dir: pkgs.nix-gitignore.gitignoreSource [] dir;
|
gitignore = dir: pkgs.nix-gitignore.gitignoreSource [] dir;
|
||||||
in
|
in
|
||||||
pkgs.haskellPackages.shellFor {
|
pkgs.haskellPackages.shellFor {
|
||||||
|
|
Loading…
Reference in a new issue