nix-config/nix/devshell.nix

78 lines
1.6 KiB
Nix
Raw Normal View History

{
self,
nixpkgs,
colmena,
devshell,
agenix-rekey,
...
}: system: let
pkgs = import nixpkgs {
inherit system;
overlays = [
devshell.overlays.default
agenix-rekey.overlays.default
];
};
in
pkgs.devshell.mkShell {
name = "nix-config";
packages = with pkgs; [
# Nix
nil
# Lua
stylua
(luajit.withPackages (p: with p; [luacheck]))
lua-language-server
# Misc
shellcheck
pre-commit
rage
2023-09-02 20:11:06 +02:00
nix
];
commands = with pkgs; [
{
package =
colmena.packages.${system}.colmena;
help = "Apply nix configurations";
}
{
package = pkgs.agenix-rekey;
help = "Edit and rekey repository secrets";
}
{
package =
alejandra;
help = "Format nix code";
}
{
package = statix;
help = "Linter for nix";
}
{
package = deadnix;
help = "Remove dead nix code";
}
{
package = update-nix-fetchgit;
help = "Update fetcher inside nix files";
}
];
env = [
{
name = "NIX_CONFIG";
# Nix plugins braucht nix version 2.16
# Nixpkgs hat aber aktuell 2.15 also main version
# Daher der folgenda hack um zu verhindern das mein NixOS mit einer anderen nix version gebaut wird
# als der intendeten
value = ''
2023-09-02 20:11:06 +02:00
plugin-files = ${pkgs.nix-plugins}/lib/nix/plugins
extra-builtins-file = ${../nix}/extra-builtins.nix
'';
}
];
devshell.startup.pre-commit.text = self.checks.${system}.pre-commit-check.shellHook;
}