pub-solar-os/lib/pkgs-lib/shell/default.nix

53 lines
1.1 KiB
Nix
Raw Normal View History

2021-04-19 03:40:53 +00:00
{ lib, nixpkgs, devshell, deploy, system }:
let
overlays = [
2021-04-19 03:40:53 +00:00
2021-04-18 01:46:20 +00:00
devshell.overlay
2021-04-19 03:40:53 +00:00
(final: prev: {
deploy-rs =
2021-04-18 01:46:20 +00:00
deploy.packages.${prev.system}.deploy-rs;
})
2021-04-19 03:40:53 +00:00
];
pkgs = import nixpkgs { inherit system overlays; config = { }; };
flk = pkgs.callPackage ./flk.nix { };
installPkgs = (lib.nixosSystem {
inherit system;
modules = [ ];
}).config.system.build;
in
pkgs.devshell.mkShell {
2021-02-17 18:49:13 +00:00
imports = [ (pkgs.devshell.importTOML ./devshell.toml) ];
2021-02-17 18:49:13 +00:00
packages = with installPkgs; [
nixos-install
nixos-generate-config
nixos-enter
];
git.hooks = {
pre-commit.text = lib.fileContents ./pre-commit.sh;
};
2021-02-17 18:49:13 +00:00
commands = with pkgs; [
{ package = flk; }
2021-02-17 18:49:13 +00:00
{
name = "nix";
help = pkgs.nixFlakes.meta.description;
command = ''
${pkgs.nixFlakes}/bin/nix --experimental-features "nix-command flakes ca-references" "${"\${@}"}"
'';
2021-02-17 18:49:13 +00:00
}
]
++ lib.optional (system != "i686-linux") { package = cachix; }
++ lib.optional (system == "x86_64-linux") {
name = "deploy";
package = deploy-rs;
help = "A simple multi-profile Nix-flake deploy tool.";
};
}