2021-04-25 23:36:48 +00:00
|
|
|
{ lib, devshell, deploy }:
|
|
|
|
|
|
|
|
{ pkgs }:
|
2021-01-19 07:51:23 +00:00
|
|
|
let
|
2021-04-10 17:59:10 +00:00
|
|
|
overlays = [
|
2021-04-18 01:46:20 +00:00
|
|
|
devshell.overlay
|
2021-04-19 03:40:53 +00:00
|
|
|
|
2021-04-10 17:59:10 +00:00
|
|
|
(final: prev: {
|
|
|
|
deploy-rs =
|
2021-04-18 01:46:20 +00:00
|
|
|
deploy.packages.${prev.system}.deploy-rs;
|
2021-04-10 17:59:10 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-04-25 23:36:48 +00:00
|
|
|
pkgs' = import pkgs.path {
|
|
|
|
inherit (pkgs) system;
|
|
|
|
inherit overlays;
|
|
|
|
};
|
2021-01-19 07:51:23 +00:00
|
|
|
|
2021-04-25 23:36:48 +00:00
|
|
|
flk = pkgs'.callPackage ./flk.nix { };
|
2021-02-14 09:29:17 +00:00
|
|
|
|
|
|
|
installPkgs = (lib.nixosSystem {
|
2021-04-25 23:36:48 +00:00
|
|
|
inherit (pkgs') system;
|
2021-02-14 09:29:17 +00:00
|
|
|
modules = [ ];
|
2021-01-19 07:51:23 +00:00
|
|
|
}).config.system.build;
|
|
|
|
in
|
2021-04-25 23:36:48 +00:00
|
|
|
pkgs'.devshell.mkShell {
|
|
|
|
imports = [ (pkgs'.devshell.importTOML ./devshell.toml) ];
|
2021-01-19 07:51:23 +00:00
|
|
|
|
2021-02-17 18:49:13 +00:00
|
|
|
packages = with installPkgs; [
|
2021-01-19 07:51:23 +00:00
|
|
|
nixos-install
|
|
|
|
nixos-generate-config
|
|
|
|
nixos-enter
|
2021-02-17 19:54:41 +00:00
|
|
|
];
|
2021-01-19 07:51:23 +00:00
|
|
|
|
2021-02-14 09:29:17 +00:00
|
|
|
git.hooks = {
|
|
|
|
pre-commit.text = lib.fileContents ./pre-commit.sh;
|
2021-01-27 15:31:17 +00:00
|
|
|
};
|
|
|
|
|
2021-04-25 23:36:48 +00:00
|
|
|
commands = with pkgs'; [
|
2021-03-17 04:11:56 +00:00
|
|
|
{ package = flk; }
|
2021-02-17 18:49:13 +00:00
|
|
|
{
|
2021-03-17 04:11:56 +00:00
|
|
|
name = "nix";
|
2021-04-25 23:36:48 +00:00
|
|
|
help = pkgs'.nixFlakes.meta.description;
|
2021-03-17 04:11:56 +00:00
|
|
|
command = ''
|
2021-04-25 23:36:48 +00:00
|
|
|
${pkgs'.nixFlakes}/bin/nix --experimental-features "nix-command flakes ca-references" "${"\${@}"}"
|
2021-03-17 04:11:56 +00:00
|
|
|
'';
|
2021-02-17 18:49:13 +00:00
|
|
|
}
|
2021-02-17 19:54:41 +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.";
|
|
|
|
};
|
2021-01-19 07:51:23 +00:00
|
|
|
}
|