Skip to content

Commit

Permalink
shell: add packages from overlays to devshell
Browse files Browse the repository at this point in the history
following same logic as exporting packages, but don't filter out inputs
  • Loading branch information
Pacman99 committed May 12, 2021
1 parent 58ce1b8 commit be058ad
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
3 changes: 3 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
lib = nixpkgs.lib // lib;
};
};

devShell = lib.pkgs-lib.shell { inherit pkgs; };

packages = {
mkFlakeDoc = pkgs.writeText "mkFlakeOptions.md"
(
Expand Down
16 changes: 11 additions & 5 deletions pkgs-lib/shell/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,23 @@ let
})
];

pkgs' = import pkgs.path {
inherit (pkgs) system;
inherit overlays;
};
pkgs' = pkgs.appendOverlays overlays;

flk = pkgs'.callPackage ./flk.nix { };

installPkgs = (lib.nixosSystem {
inherit (pkgs') system;
modules = [ ];
}).config.system.build;

# Add all packages from overlays to shell
# Follow same logic as exporting packages except don't filter out inputs
allOverlays = lib.exporter.overlaysFromChannelsExporter {
# function requires system-spaced and channel-spaced package set
pkgs.${pkgs'.system}.channel = pkgs';
};
customPackages = lib.builder.packagesFromOverlaysBuilderConstructor allOverlays { pkgs = pkgs'; };

in
pkgs'.devshell.mkShell {
imports = [ (pkgs'.devshell.importTOML ./devshell.toml) ];
Expand All @@ -37,7 +43,7 @@ pkgs'.devshell.mkShell {
nixos-generate-config
nixos-enter
pkgs'.nixos-rebuild
];
] ++ (builtins.attrValues customPackages);

git.hooks = {
pre-commit.text = lib.fileContents ./pre-commit.sh;
Expand Down

0 comments on commit be058ad

Please sign in to comment.