diff --git a/default/.envrc b/default/.envrc index 26e7fb8..4a87cb9 100644 --- a/default/.envrc +++ b/default/.envrc @@ -1,2 +1,2 @@ -nix_direnv_watch_file ./flake.nix +nix_direnv_watch_file ./devshell.nix use flake diff --git a/default/devshell.nix b/default/devshell.nix new file mode 100644 index 0000000..2318429 --- /dev/null +++ b/default/devshell.nix @@ -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 diff --git a/default/devshell.toml b/default/devshell.toml deleted file mode 100644 index f3ffef1..0000000 --- a/default/devshell.toml +++ /dev/null @@ -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" diff --git a/default/flake.nix b/default/flake.nix index feb5952..38ab3a8 100644 --- a/default/flake.nix +++ b/default/flake.nix @@ -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; + } + ); }