2021-02-14 12:29:17 +03:00
|
|
|
{ self ? (import ../compat).defaultNix
|
|
|
|
, system ? builtins.currentSystem
|
2021-01-19 10:51:23 +03:00
|
|
|
}:
|
|
|
|
let
|
2021-02-14 12:29:17 +03:00
|
|
|
pkgs = (self.lib.genPkgs { inherit self; }).${system};
|
2021-01-19 10:51:23 +03:00
|
|
|
|
2021-02-14 12:29:17 +03:00
|
|
|
inherit (pkgs) lib;
|
|
|
|
|
|
|
|
installPkgs = (lib.nixosSystem {
|
|
|
|
inherit system;
|
|
|
|
modules = [ ];
|
2021-01-19 10:51:23 +03:00
|
|
|
}).config.system.build;
|
|
|
|
|
2021-02-14 12:29:17 +03:00
|
|
|
flk = pkgs.callPackage ./flk.nix { };
|
2021-01-19 10:51:23 +03:00
|
|
|
|
2021-02-14 12:29:17 +03:00
|
|
|
inherit (flk) name;
|
2021-01-19 10:51:23 +03:00
|
|
|
in
|
2021-01-27 18:31:17 +03:00
|
|
|
pkgs.devshell.mkShell {
|
2021-01-19 10:51:23 +03:00
|
|
|
inherit name;
|
|
|
|
|
|
|
|
packages = with pkgs; with installPkgs; [
|
|
|
|
git-crypt
|
|
|
|
nixos-install
|
|
|
|
nixos-generate-config
|
|
|
|
nixos-enter
|
2021-02-15 08:17:24 +03:00
|
|
|
] ++ lib.optional (system == "x86_64-linux") deploy-rs;
|
2021-01-19 10:51:23 +03:00
|
|
|
|
|
|
|
env = { inherit name; };
|
|
|
|
|
2021-02-14 12:29:17 +03:00
|
|
|
git.hooks = {
|
2021-01-27 18:31:17 +03:00
|
|
|
enable = true;
|
2021-02-14 12:29:17 +03:00
|
|
|
pre-commit.text = lib.fileContents ./pre-commit.sh;
|
2021-01-27 18:31:17 +03:00
|
|
|
};
|
|
|
|
|
2021-02-14 12:29:17 +03:00
|
|
|
commands = with pkgs; let
|
|
|
|
mkCommand = category: package: {
|
|
|
|
inherit package category;
|
|
|
|
name = package.pname or package.name;
|
|
|
|
help = package.meta.description;
|
|
|
|
};
|
|
|
|
|
|
|
|
mapCmd = category: map (mkCommand category);
|
|
|
|
in
|
2021-02-14 12:38:41 +03:00
|
|
|
mapCmd "main"
|
|
|
|
(
|
|
|
|
[ flk git ] ++
|
|
|
|
lib.optional (system != "i686-linux") cachix
|
|
|
|
) ++
|
2021-02-14 12:29:17 +03:00
|
|
|
mapCmd "linters" [ nixpkgs-fmt editorconfig-checker ] ++
|
|
|
|
mapCmd "documentation" [ python3Packages.grip mdbook ] ++ [
|
2021-01-19 10:51:23 +03:00
|
|
|
{
|
|
|
|
name = "nix";
|
|
|
|
help = nixFlakes.meta.description;
|
|
|
|
category = "main";
|
2021-02-14 12:29:17 +03:00
|
|
|
command = ''
|
|
|
|
${nixFlakes}/bin/nix --option experimental-features \
|
|
|
|
"nix-command flakes ca-references" "$@"
|
|
|
|
'';
|
2021-01-19 10:51:23 +03:00
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
}
|