2023-05-03 13:31:18 +02:00
|
|
|
{
|
|
|
|
self,
|
2023-05-22 14:25:00 +02:00
|
|
|
nixpkgs,
|
2023-05-03 13:31:18 +02:00
|
|
|
colmena,
|
2023-05-22 14:25:00 +02:00
|
|
|
devshell,
|
2023-05-03 13:31:18 +02:00
|
|
|
...
|
2023-05-22 14:25:00 +02:00
|
|
|
}: system: let
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [devshell.overlays.default];
|
|
|
|
};
|
|
|
|
in
|
|
|
|
pkgs.devshell.mkShell {
|
2023-05-02 15:08:36 +02:00
|
|
|
name = "nix-config";
|
2023-05-22 14:25:00 +02:00
|
|
|
packages = with pkgs; [
|
2023-05-02 15:08:36 +02:00
|
|
|
# Nix
|
|
|
|
nil
|
|
|
|
|
|
|
|
# Lua
|
|
|
|
stylua
|
|
|
|
(luajit.withPackages (p: with p; [luacheck]))
|
|
|
|
lua-language-server
|
|
|
|
|
|
|
|
# Misc
|
|
|
|
shellcheck
|
|
|
|
pre-commit
|
|
|
|
rage
|
|
|
|
];
|
2023-05-23 07:45:57 +02:00
|
|
|
commands = with pkgs; [
|
|
|
|
{
|
|
|
|
package =
|
|
|
|
colmena.packages.${system}.colmena;
|
|
|
|
help = "Apply nix configurations";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
package =
|
|
|
|
alejandra;
|
|
|
|
help = "Format nix code";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
package = statix;
|
|
|
|
help = "Linter for nix";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
package = update-nix-fetchgit;
|
|
|
|
help = "Update fetcher inside nix files";
|
|
|
|
}
|
2023-07-28 16:21:31 +02:00
|
|
|
];
|
|
|
|
env = [
|
|
|
|
{
|
|
|
|
name = "NIX_CONFIG";
|
2023-07-29 12:28:33 +02:00
|
|
|
# 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
|
2023-07-28 16:21:31 +02:00
|
|
|
value = ''
|
2023-07-29 12:28:33 +02:00
|
|
|
plugin-files = ${(pkgs.nix-plugins.override {inherit (pkgs) nix;}).overrideAttrs rec {
|
|
|
|
version = "10.0.0";
|
|
|
|
|
|
|
|
src = pkgs.fetchFromGitHub {
|
|
|
|
owner = "shlevy";
|
|
|
|
repo = "nix-plugins";
|
|
|
|
rev = version;
|
|
|
|
hash = "sha256-7Lo+YxpiRz0+ZLFDvYMJWWK2j0CyPDRoP1wAc+OaPJY=";
|
|
|
|
};
|
|
|
|
}}/lib/nix/plugins
|
2023-07-28 16:21:31 +02:00
|
|
|
extra-builtins-file = ${../nix}/extra-builtins.nix
|
|
|
|
'';
|
|
|
|
}
|
2023-05-23 07:45:57 +02:00
|
|
|
];
|
2023-05-02 15:08:36 +02:00
|
|
|
|
2023-05-22 14:25:00 +02:00
|
|
|
devshell.startup.pre-commit.text = self.checks.${system}.pre-commit-check.shellHook;
|
2023-05-02 15:08:36 +02:00
|
|
|
}
|