shell: use devshell.toml
This commit is contained in:
parent
0e27b367d7
commit
b41c738f39
3 changed files with 42 additions and 31 deletions
|
@ -58,11 +58,11 @@
|
|||
},
|
||||
"devshell": {
|
||||
"locked": {
|
||||
"lastModified": 1612486691,
|
||||
"narHash": "sha256-WluAIsf/HMYeg8PnM1sODRmiEOzt1wjjY+l8tbttLSI=",
|
||||
"lastModified": 1613310953,
|
||||
"narHash": "sha256-GhAwxJ0Jfsj8LIQmEQylpVkcThUJgPChjo48DZeBQZA=",
|
||||
"owner": "numtide",
|
||||
"repo": "devshell",
|
||||
"rev": "02933029b06747c7523f3a6f677df06d4cfdfc7b",
|
||||
"rev": "f64db97388dda7c2c6f8fb7aa5d6d08365fb1e01",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -13,50 +13,32 @@ let
|
|||
|
||||
flk = pkgs.callPackage ./flk.nix { };
|
||||
|
||||
inherit (flk) name;
|
||||
in
|
||||
pkgs.devshell.mkShell {
|
||||
inherit name;
|
||||
pkgs.devshell.mkShell
|
||||
{
|
||||
imports = [ (pkgs.devshell.importTOML ./devshell.toml) ];
|
||||
|
||||
packages = with pkgs; with installPkgs; [
|
||||
git-crypt
|
||||
packages = with installPkgs; [
|
||||
nixos-install
|
||||
nixos-generate-config
|
||||
nixos-enter
|
||||
] ++ lib.optional (system == "x86_64-linux") deploy-rs;
|
||||
|
||||
env = { inherit name; };
|
||||
] ++ lib.optional (system == "x86_64-linux") pkgs.deploy-rs;
|
||||
|
||||
git.hooks = {
|
||||
enable = true;
|
||||
pre-commit.text = lib.fileContents ./pre-commit.sh;
|
||||
};
|
||||
|
||||
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
|
||||
mapCmd "main"
|
||||
(
|
||||
[ flk git ] ++
|
||||
lib.optional (system != "i686-linux") cachix
|
||||
) ++
|
||||
mapCmd "linters" [ nixpkgs-fmt editorconfig-checker ] ++
|
||||
mapCmd "documentation" [ python3Packages.grip mdbook ] ++ [
|
||||
commands = with pkgs; [
|
||||
{
|
||||
package = flk;
|
||||
}
|
||||
{
|
||||
name = "nix";
|
||||
help = nixFlakes.meta.description;
|
||||
category = "main";
|
||||
command = ''
|
||||
${nixFlakes}/bin/nix --option experimental-features \
|
||||
"nix-command flakes ca-references" "$@"
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
||||
] ++ lib.optional (system != "i686-linux") { package = cachix; };
|
||||
}
|
||||
|
|
29
shell/devshell.toml
Normal file
29
shell/devshell.toml
Normal file
|
@ -0,0 +1,29 @@
|
|||
imports = [ "git.hooks" ]
|
||||
|
||||
[devshell]
|
||||
packages = [
|
||||
"git-crypt"
|
||||
]
|
||||
|
||||
[[commands]]
|
||||
package = "git"
|
||||
category = "vcs"
|
||||
|
||||
[[commands]]
|
||||
package = "nixpkgs-fmt"
|
||||
category = "linters"
|
||||
|
||||
[[commands]]
|
||||
package = "editorconfig-checker"
|
||||
category = "linters"
|
||||
|
||||
[[commands]]
|
||||
package = "python3Packages.grip"
|
||||
category = "documentation"
|
||||
|
||||
[[commands]]
|
||||
package = "mdbook"
|
||||
category = "documentation"
|
||||
|
||||
[git.hooks]
|
||||
enable = true
|
Loading…
Reference in a new issue