Skip to content

Commit

Permalink
Merge pull request #3 from br4ch1st0chr0n3/master
Browse files Browse the repository at this point in the history
add manager, hls + ghc 92
  • Loading branch information
LevT2 authored Nov 13, 2022
2 parents b2ec3c2 + 24bb7ec commit 2fe548c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
26 changes: 18 additions & 8 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
drv-tools.url = "github:br4ch1st0chr0n3/flakes?dir=drv-tools";
flake-tools.url = "github:br4ch1st0chr0n3/flakes?dir=flake-tools";
haskell-tools.url = "github:br4ch1st0chr0n3/flakes?dir=language-tools/haskell";
manager.url = "github:br4ch1st0chr0n3/flakes?dir=manager";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
Expand All @@ -21,6 +22,7 @@
, drv-tools
, haskell-tools
, flake-tools
, manager
, ...
}:
flake-utils.lib.eachDefaultSystem (system:
Expand All @@ -43,22 +45,24 @@
toolsGHC
;
hsShellTools = haskell-tools.toolSets.${system}.shellTools;
ghc92 = "92";
inherit (toolsGHC ghc92) stack hls;
inherit (toolsGHC "92") staticExecutable stack hls;

writeSettings = writeSettingsJSON {
inherit (settingsNix) haskell todo-tree files editor gitlens git nix-ide workbench;
inherit (settingsNix) haskell todo-tree files editor gitlens
git nix-ide workbench markdown-all-in-one;
};

tools = (builtins.attrValues hsShellTools) ++ [
pkgs.cabal-install
manager.packages.${system}.default
stack
writeSettings
hls
pkgs.jq
];

codium = mkCodium {
extensions = { inherit (extensions) nix haskell misc github; };
extensions = { inherit (extensions) nix haskell misc github markdown; };
runtimeDependencies = tools;
};

Expand All @@ -67,7 +71,6 @@
{
packages = {
default = codium;
inherit writeSettings;
pushToCachix = flakesUtils.flakesPushToCachix;
updateLocks = flakesUtils.flakesUpdate;
};
Expand All @@ -77,15 +80,22 @@
packages = [ codium ] ++ tools;
bash = {
extra = ''
cabal update
source <(manager --bash-completion-script '$(which manager)')
'';
};
commands = [
{
name = "codium, ${writeSettings.name}, ghcid";
name = "codium, ghcid, stack";
help = "available in codium";
}
{
name = "stack, cabal";
name = "${writeSettings.name}";
help = "write .vscode/settings.json";
}
{
name = "manager";
category = "tools";
help = "manage Haskell modules and template files";
}
];
};
Expand Down
12 changes: 12 additions & 0 deletions stack.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{ ghcVersion ? "924" }: (
(import
(
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
)
{ src = ./.; }
).defaultNix
).outputs.stack-shell.${builtins.currentSystem} { inherit ghcVersion; }

0 comments on commit 2fe548c

Please sign in to comment.