feat: switched to purely nix based devshell

This commit is contained in:
Patrick Großmann 2023-05-26 16:02:52 +09:00
parent bc43c0120c
commit 8b8ae5a73f
Signed by: patrick
GPG key ID: 451F95EFB8BECD0F
4 changed files with 47 additions and 28 deletions

View file

@ -1,2 +1,2 @@
nix_direnv_watch_file ./flake.nix
nix_direnv_watch_file ./devshell.nix
use flake

40
default/devshell.nix Normal file
View file

@ -0,0 +1,40 @@
{
nixpkgs,
devshell,
...
}: system: let
pkgs = import nixpkgs {
inherit system;
overlays = [devshell.overlays.default];
};
shell = with pkgs; {
name = "devshell template";
packages = [
nil
sl
];
commands = [
{
package = statix;
help = "The nix linter";
}
{
package = alejandra;
help = "The nix formatter";
}
{
name = "test";
help = "very helpful";
command = "echo hehe";
}
];
env = [
{
name = "lol";
value = "lel";
}
];
};
in
pkgs.devshell.mkShell shell

View file

@ -1,16 +0,0 @@
[devshell]
name = "Patricks tolle devshell"
packages = [
"nil",
"sl"
]
[[env]]
name = "lol"
value = "lel"
[[commands]]
name = "test"
help = "very helpful"
command = "echo lul"

View file

@ -12,15 +12,10 @@
nixpkgs,
flake-utils,
devshell,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [devshell.overlays.default];
};
in {
devShell = pkgs.devshell.mkShell {
imports = [(pkgs.devshell.importTOML ./devshell.toml)];
};
});
} @ inputs:
flake-utils.lib.eachDefaultSystem (
system: {
devShell = import ./devshell.nix inputs system;
}
);
}