os/shell/devos.nix
teutat3s 02c145697b
Pull in upstream commits from https://github.com/divnix/digga/pull/490
Improved flake-compat

Get the rev from the flake.lock file. Shouldn't be an issue for
first time users as the guide instructs users to generate a lock
file. `builtins.file` was used in accordance with nix.dev
reccommendations.

https://nix.dev/anti-patterns/language#reproducibility-referencing-top-level-directory-with

Rm tempfix
2022-11-07 11:24:59 +01:00

54 lines
1.2 KiB
Nix

{ pkgs, extraModulesPath, inputs, lib, ... }:
let
inherit (pkgs)
agenix
cachix
editorconfig-checker
mdbook
nix
nixpkgs-fmt
nvfetcher
;
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";
commands = with pkgs; [
(devos nix)
(devos agenix)
{
category = "devos";
name = pkgs.nvfetcher.pname;
help = pkgs.nvfetcher.meta.description;
command = "cd $PRJ_ROOT/pkgs; ${pkgs.nvfetcher}/bin/nvfetcher -c ./sources.toml $@";
}
(linter nixpkgs-fmt)
(linter editorconfig-checker)
(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)
]
;
}