os/shell/devos.nix

68 lines
1.3 KiB
Nix

{
pkgs,
extraModulesPath,
inputs,
lib,
...
}: let
inherit
(pkgs)
agenix
cachix
editorconfig-checker
mdbook
nix
alejandra
nvfetcher
shellcheck
shfmt
treefmt
;
inherit
(pkgs.nodePackages)
prettier
;
hooks = import ./hooks;
pkgWithCategory = category: package: {inherit package category;};
devos = pkgWithCategory "devos";
linter = pkgWithCategory "linter";
docs = pkgWithCategory "docs";
in {
_file = toString ./.;
imports = ["${extraModulesPath}/git/hooks.nix"];
git = {inherit hooks;};
# override for our own welcome
devshell.name = pkgs.lib.mkForce "PubSolarOS";
devshell.startup.aliases.text = ''
alias nvfetcher="nvfetcher --config $PRJ_ROOT/sources.toml --build-dir PRJ_ROOT/pkgs/_sources"
'';
commands = with pkgs;
[
(devos nix)
(devos agenix)
(devos nvfetcher)
(linter alejandra)
(linter editorconfig-checker)
(linter nodePackages.prettier)
(linter shfmt)
(linter shellcheck)
(linter treefmt)
(docs mdbook)
]
++ lib.optionals (!pkgs.stdenv.buildPlatform.isi686) [
(devos cachix)
]
++ lib.optionals (pkgs.stdenv.hostPlatform.isLinux && !pkgs.stdenv.buildPlatform.isDarwin) [
(devos inputs.nixos-generators.defaultPackage.${pkgs.system})
(devos deploy-rs)
];
}