diff --git a/flake.nix b/flake.nix index 7c10a6c0..32d79ea1 100644 --- a/flake.nix +++ b/flake.nix @@ -32,6 +32,15 @@ legacyPackages = devshell; devShell = devshell.fromTOML ./devshell.toml; }; + flakeTOML = nixpkgs: path: eachSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}.extend self.overlay; + devshell = import ./. { inherit system pkgs; }; + in + { + devShell = devshell.fromTOML path; + } + ); in { defaultTemplate.path = ./template; @@ -39,6 +48,7 @@ # Import this overlay into your instance of nixpkgs overlay = import ./overlay.nix; lib = { + inherit flakeTOML; importTOML = import ./nix/importTOML.nix; }; } diff --git a/template/flake.nix b/template/flake.nix index fb42e8a6..2d5143b1 100644 --- a/template/flake.nix +++ b/template/flake.nix @@ -2,19 +2,7 @@ description = "virtual environments"; inputs.devshell.url = "github:numtide/devshell"; - inputs.flake-utils.url = "github:numtide/flake-utils"; - outputs = { self, flake-utils, devshell, nixpkgs }: - flake-utils.lib.eachDefaultSystem (system: { - devShell = - let pkgs = import nixpkgs { - inherit system; - - overlays = [ devshell.overlay ]; - }; - in - pkgs.devshell.mkShell { - imports = [ (pkgs.devshell.importTOML ./devshell.toml) ]; - }; - }); + outputs = { self, devshell, nixpkgs }: + devshell.lib.flakeTOML nixpkgs ./devshell.toml; }