Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,23 @@
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;
defaultTemplate.description = "nix flake new 'github:numtide/devshell'";
# Import this overlay into your instance of nixpkgs
overlay = import ./overlay.nix;
lib = {
inherit flakeTOML;
importTOML = import ./nix/importTOML.nix;
};
}
Expand Down
16 changes: 2 additions & 14 deletions template/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}