flake: move devShell to perSystem, add formatter

This commit is contained in:
NullBite 2025-02-28 19:10:03 -05:00
parent ee9f7ff199
commit 004770c410
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A

View File

@ -151,6 +151,7 @@
perSystem = { perSystem = {
config, config,
pkgs, pkgs,
self',
... ...
}: { }: {
treefmt = { treefmt = {
@ -158,6 +159,32 @@
alejandra.enable = true; alejandra.enable = true;
}; };
}; };
devShells = {
ci = pkgs.mkShell {
buildInputs = with pkgs; [
nix-update
nix-fast-build
];
};
default = let
formatter =
pkgs.runCommandNoCC "flake-formatter" {
formatter = lib.getExe self'.formatter;
} ''
mkdir -p $out/bin
ln -s "$formatter" "$out/bin/formatter"
'';
in
pkgs.mkShell {
buildInputs = with pkgs; [
alejandra
nix-update
formatter
inputs.agenix.packages.${system}.default
];
};
};
}; };
nixfiles = { nixfiles = {
@ -250,24 +277,6 @@
}; };
# }}} # }}}
in { in {
devShells = eachSystem (system: let
pkgs = import nixpkgs-unstable {inherit system;};
in {
ci = pkgs.mkShell {
buildInputs = with pkgs; [
nix-update
nix-fast-build
];
};
default = pkgs.mkShell {
buildInputs = with pkgs; [
alejandra
nix-update
inputs.agenix.packages.${system}.default
];
};
});
# nix flake modules are meant to be portable so we cannot rely on # nix flake modules are meant to be portable so we cannot rely on
# (extraS|s)pecialArgs to pass variables # (extraS|s)pecialArgs to pass variables
nixosModules = (import ./modules/nixos) moduleInputs; nixosModules = (import ./modules/nixos) moduleInputs;