Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3ee4600
commit 9755952
Showing
9 changed files
with
87 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ lib, ... }: { | ||
_file = "haskell.nix/modules/hix-project.nix"; | ||
options = { | ||
# These are options that only the Hix command wrappers use. If you make a flake | ||
# with `haskell-nix.hix.project`, then they are ignored. | ||
haskellNix = lib.mkOption { | ||
type = lib.types.unspecified; | ||
default = null; | ||
}; | ||
nixpkgsPin = lib.mkOption { | ||
type = lib.types.str; | ||
default = "nixpkgs-unstable"; | ||
}; | ||
nixpkgs = lib.mkOption { | ||
type = lib.types.unspecified; | ||
default = null; | ||
}; | ||
nixpkgsArgs = lib.mkOption { | ||
type = lib.types.unspecified; | ||
default = null; | ||
}; | ||
overlays = lib.mkOption { | ||
type = lib.types.unspecified; | ||
default = []; | ||
}; | ||
pkgs = lib.mkOption { | ||
type = lib.types.unspecified; | ||
default = null; | ||
}; | ||
project = lib.mkOption { | ||
type = lib.types.unspecified; | ||
default = null; | ||
}; | ||
}; | ||
|
||
# Default values for other project options (things that do not have defaults for non hix projects) | ||
config = { | ||
compiler-nix-name = lib.mkDefault "ghc8105"; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ lib, ... }: | ||
with lib; | ||
with lib.types; | ||
{ | ||
_file = "haskell.nix/modules/project-common.nix"; | ||
options = { | ||
# Used by callCabalProjectToNix and callStackToNix | ||
name = mkOption { | ||
type = nullOr str; | ||
default = "haskell-project"; # TODO figure out why `config.src.name or null` breaks hix; | ||
description = "Optional name for better error messages"; | ||
}; | ||
src = mkOption { | ||
type = either path package; | ||
}; | ||
# Default shell arguments | ||
shell = mkOption { | ||
# TODO make this a submodule | ||
type = unspecified; | ||
default = {}; | ||
description = '' | ||
Arguments to use for the default shell `p.shell` (these are passed to p.shellFor). | ||
For instance to include `cabal` and `ghcjs` support use | ||
shell = { tools.cabal = {}; crossPlatforms = p: [ p.ghcjs ]; } | ||
''; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,9 @@ | ||
{ lib, config, pkgs, haskellLib, ... }: | ||
with lib; | ||
with types; | ||
let readIfExists = src: fileName: | ||
let origSrcDir = src.origSrcSubDir or src; | ||
in | ||
if builtins.elem ((__readDir origSrcDir)."${fileName}" or "") ["regular" "symlink"] | ||
then __readFile (origSrcDir + "/${fileName}") | ||
else null; | ||
in { | ||
{ lib, ... }: { | ||
_file = "haskell.nix/modules/project.nix"; | ||
options = { | ||
# Used by callCabalProjectToNix and callStackToNix | ||
name = mkOption { | ||
type = nullOr str; | ||
default = "haskell-project"; # TODO figure out why `config.src.name or null` breaks hix; | ||
description = "Optional name for better error messages"; | ||
}; | ||
src = mkOption { | ||
type = either path package; | ||
projectFileName = lib.mkOption { | ||
type = lib.types.nullOr lib.types.str; | ||
default = null; | ||
}; | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters