11.stylix/flake/dev-shell.nix
awwpotato 8b015b5fa0
flake: use flake-parts (#1208)
Link: https://github.com/danth/stylix/pull/1208

Reviewed-by: Matt Sturgeon <matt@sturgeon.me.uk>
Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
2025-05-16 11:52:15 -07:00

51 lines
1.2 KiB
Nix

{
perSystem =
{
pkgs,
config,
inputs',
...
}:
let
stylix-check = pkgs.writeShellApplication {
name = "stylix-check";
runtimeInputs = with pkgs; [
nix
nix-fast-build
];
text = ''
cores="$(nproc)"
system="$(nix eval --expr builtins.currentSystem --impure --raw)"
nix-fast-build \
--eval-max-memory-size 512 \
--eval-workers "$cores" \
--flake ".#checks.$system" \
--no-link \
--skip-cached \
"$@"
'';
};
in
{
devShells = {
default = pkgs.mkShell {
# Install git-hooks when activating the shell
shellHook = config.pre-commit.installationScript;
packages =
[
stylix-check
inputs'.home-manager.packages.default
config.formatter
]
++ config.pre-commit.settings.enabledPackages
++ config.formatter.runtimeInputs;
};
ghc = pkgs.mkShell {
inputsFrom = [ config.devShells.default ];
packages = [ pkgs.ghc ];
};
};
};
}