Skip to content

Commit

Permalink
nix: Make devshell a module
Browse files Browse the repository at this point in the history
  • Loading branch information
srid committed Jul 25, 2024
1 parent a4cb079 commit 969b96b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
22 changes: 1 addition & 21 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,6 @@
systems = import inputs.systems;

# See ./nix/modules/*.nix for the modules that are imported here.
imports =
with builtins; map
(fn: ./nix/modules/${fn})
(attrNames (readDir ./nix/modules));

perSystem = { self', lib, config, pkgs, ... }: {
# Default shell.
devShells.default = pkgs.mkShell {
name = "haskell-template";
meta.description = "Haskell development environment";
# See https://community.flake.parts/haskell-flake/devshell#composing-devshells
inputsFrom = [
config.haskellProjects.default.outputs.devShell # See ./nix/modules/haskell.nix
config.treefmt.build.devShell # See ./nix/modules/formatter.nix
];
packages = with pkgs; [
just
nixd
];
};
};
imports = with builtins; map (fn: ./nix/modules/${fn}) (attrNames (readDir ./nix/modules));
};
}
18 changes: 18 additions & 0 deletions nix/modules/devshell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
perSystem = { config, pkgs, ... }: {
# Default shell.
devShells.default = pkgs.mkShell {
name = "haskell-template";
meta.description = "Haskell development environment";
# See https://community.flake.parts/haskell-flake/devshell#composing-devshells
inputsFrom = [
config.haskellProjects.default.outputs.devShell # See ./nix/modules/haskell.nix
config.treefmt.build.devShell # See ./nix/modules/formatter.nix
];
packages = with pkgs; [
just
nixd
];
};
};
}

0 comments on commit 969b96b

Please sign in to comment.