2022-08-13 19:50:23 +00:00
|
|
|
{ pkgs, extraModulesPath, inputs, lib, ... }:
|
2021-07-21 04:36:41 +00:00
|
|
|
let
|
|
|
|
|
2022-08-13 19:50:23 +00:00
|
|
|
inherit (pkgs)
|
|
|
|
agenix
|
|
|
|
cachix
|
|
|
|
editorconfig-checker
|
|
|
|
mdbook
|
2022-08-23 22:53:38 +00:00
|
|
|
nix
|
2022-08-13 19:50:23 +00:00
|
|
|
nixpkgs-fmt
|
|
|
|
nvfetcher
|
|
|
|
;
|
|
|
|
|
2021-07-21 04:36:41 +00:00
|
|
|
hooks = import ./hooks;
|
|
|
|
|
|
|
|
pkgWithCategory = category: package: { inherit package category; };
|
2022-08-13 19:50:23 +00:00
|
|
|
devos = pkgWithCategory "devos";
|
2021-07-21 04:36:41 +00:00
|
|
|
linter = pkgWithCategory "linter";
|
|
|
|
docs = pkgWithCategory "docs";
|
|
|
|
|
|
|
|
in
|
|
|
|
{
|
|
|
|
_file = toString ./.;
|
|
|
|
|
|
|
|
imports = [ "${extraModulesPath}/git/hooks.nix" ];
|
|
|
|
git = { inherit hooks; };
|
|
|
|
|
2022-01-19 00:13:15 +00:00
|
|
|
# override for our own welcome
|
|
|
|
devshell.name = pkgs.lib.mkForce "PubSolarOS";
|
|
|
|
|
2021-07-21 04:36:41 +00:00
|
|
|
# tempfix: remove when merged https://github.com/numtide/devshell/pull/123
|
|
|
|
devshell.startup.load_profiles = pkgs.lib.mkForce (pkgs.lib.noDepEntry ''
|
|
|
|
# PATH is devshell's exorbitant privilige:
|
|
|
|
# fence against its pollution
|
|
|
|
_PATH=''${PATH}
|
|
|
|
# Load installed profiles
|
|
|
|
for file in "$DEVSHELL_DIR/etc/profile.d/"*.sh; do
|
|
|
|
# If that folder doesn't exist, bash loves to return the whole glob
|
|
|
|
[[ -f "$file" ]] && source "$file"
|
|
|
|
done
|
|
|
|
# Exert exorbitant privilige and leave no trace
|
|
|
|
export PATH=''${_PATH}
|
|
|
|
unset _PATH
|
|
|
|
'');
|
|
|
|
|
|
|
|
commands = with pkgs; [
|
2022-08-14 12:23:37 +00:00
|
|
|
(devos nix)
|
2021-07-21 04:36:41 +00:00
|
|
|
(devos agenix)
|
|
|
|
{
|
|
|
|
category = "devos";
|
2022-08-09 09:54:19 +00:00
|
|
|
name = pkgs.nvfetcher.pname;
|
|
|
|
help = pkgs.nvfetcher.meta.description;
|
|
|
|
command = "cd $PRJ_ROOT/pkgs; ${pkgs.nvfetcher}/bin/nvfetcher -c ./sources.toml $@";
|
2021-07-21 04:36:41 +00:00
|
|
|
}
|
|
|
|
(linter nixpkgs-fmt)
|
|
|
|
(linter editorconfig-checker)
|
2022-08-13 19:50:23 +00:00
|
|
|
|
2021-07-21 04:36:41 +00:00
|
|
|
(docs mdbook)
|
|
|
|
]
|
2022-08-13 19:50:23 +00:00
|
|
|
++ lib.optionals (!pkgs.stdenv.buildPlatform.isi686) [
|
2021-07-21 04:36:41 +00:00
|
|
|
(devos cachix)
|
2022-08-13 19:50:23 +00:00
|
|
|
]
|
|
|
|
++ lib.optionals (pkgs.stdenv.hostPlatform.isLinux && !pkgs.stdenv.buildPlatform.isDarwin) [
|
2022-04-09 13:54:15 +00:00
|
|
|
(devos inputs.nixos-generators.defaultPackage.${pkgs.system})
|
2022-08-13 19:50:23 +00:00
|
|
|
(devos deploy-rs)
|
|
|
|
]
|
2021-07-21 04:36:41 +00:00
|
|
|
;
|
|
|
|
}
|