Update shells a bit

This commit is contained in:
Charlotte Van Petegem 2023-03-14 11:39:45 +01:00
parent 1414da9c00
commit 57f21d8d0d
No known key found for this signature in database
GPG key ID: 019E764B7184435A
8 changed files with 98 additions and 85 deletions

View file

@ -1,10 +1,23 @@
{ pkgs, inputs }: pkgs.devshell.mkShell {
name = "NixOS config";
commands = [
{
name = "format-all";
category = "general commands";
help = "Format all nix files in the project";
command = "find $PRJ_ROOT -type f -name '*.nix' -print0 | xargs -0 nixpkgs-fmt";
}
{
name = "fetchpatch";
category = "general commands";
help = "Fetch a patch from a nixpkgs PR by its ID";
command = "curl -L https://github.com/NixOS/nixpkgs/pull/$1.patch -o $PRJ_ROOT/patches/$1.patch";
}
];
packages = [
pkgs.agenix
# Use nixos-rebuild from flake, since it might be patched
pkgs.nixos-rebuild
pkgs.nixpkgs-fmt
(pkgs.writeShellScriptBin "fetchpatch" "curl -L https://github.com/NixOS/nixpkgs/pull/$1.patch -o patches/$1.patch")
inputs.agenix.packages.${pkgs.system}.default
];
}