tooling: switch from alejandra to nixfmt

Signed-off-by: Bloxx12 <charlie@charlieroot.dev>
Change-Id: I6a6a696436b90e48895139b7e0b59b75c0e64cae
This commit is contained in:
Bloxx12 2025-07-20 00:48:11 +02:00
commit f4464732e3
Signed by: faukah
SSH key fingerprint: SHA256:jpYIt4Vkz1NBTQcks/N9OPTfTFxE6KF2W/rV7hrfrIw
7 changed files with 31 additions and 33 deletions

View file

@ -6,22 +6,18 @@
outputs = _: let
sources = import ./npins;
nixpkgs = (import sources.flake-compat {src = sources.nixpkgs;}).outputs;
inherit (nixpkgs) lib;
eachSystem = lib.genAttrs (import sources.systems);
pkgsFor = nixpkgs.legacyPackages;
inputs = sources;
in {
nixosConfigurations = import ./default.nix;
formatter = eachSystem (system: pkgsFor.${system}.alejandra);
packages =
lib.mapAttrs (
_: pkgs: {
inherit
(import ./packages {
inherit inputs pkgs;
inherit inputs pkgs sources;
})
fish
helix
@ -44,24 +40,6 @@
)
pkgsFor;
apps = eachSystem (system: let
inherit (inputs.self.packages.${system}) fish helix nushell;
in {
default = inputs.self.apps.${system}.nushell;
helix = {
type = "app";
program = "${helix}/bin/hx";
};
nushell = {
type = "app";
program = "${nushell}/bin/nu";
};
fish = {
type = "app";
program = "${fish}/bin/fish";
};
});
templates = import ./templates;
};
}

View file

@ -6,11 +6,13 @@
lib,
self,
pkgs,
sources,
...
}: let
inherit (lib.meta) hiPrioSet;
helix = pkgs.callPackage (self + "/packages/helix") {};
fish = pkgs.callPackage (self + "/packages/fish") {};
helix = pkgs.callPackage (self + "/packages/helix") {inherit sources;};
fish = pkgs.callPackage (self + "/packages/fish") {inherit sources;};
in {
environment.systemPackages =
builtins.attrValues {

View file

@ -23,7 +23,6 @@ in {
(pkgs)
abook
aerc
alejandra
aichat
alsa-utils
anki

View file

@ -84,6 +84,22 @@
"url": "https://github.com/nix-community/nh/archive/a90e3124111d9c3eb64e97a5334db09a8e2a4bae.tar.gz",
"hash": "sha256-KKaUEg1/ntHVsG61CkKFr2mfdsoK9Nj5FM/W1PBhe5o="
},
"nixfmt": {
"type": "GitRelease",
"repository": {
"type": "GitHub",
"owner": "nixos",
"repo": "nixfmt"
},
"pre_releases": false,
"version_upper_bound": null,
"release_prefix": null,
"submodules": false,
"version": "v1.0.0",
"revision": "1f2589cb7198529c6c1eec9699eccd4d507d3600",
"url": "https://api.github.com/repos/nixos/nixfmt/tarball/refs/tags/v1.0.0",
"hash": "sha256-d8SYpFoCpi1GrqlKwxxq9qhyjDANeLgr8WWJNRK6wkc="
},
"nixpkgs": {
"type": "Channel",
"name": "nixpkgs-unstable",

View file

@ -1,6 +1,7 @@
{
inputs,
pkgs,
sources,
}: let
inherit (pkgs) lib;
helix = pkgs.callPackage ./helix {};

View file

@ -1,5 +1,5 @@
{
alejandra,
sources,
basedpyright,
bash-language-server,
callPackage,
@ -61,7 +61,7 @@
toml = formats.toml {};
helix-languages = callPackage ./languages.nix {inherit lib;};
helix-languages = callPackage ./languages.nix {inherit lib sources;};
colorscheme = toml.generate "colorscheme.toml" (import ./colorscheme.nix);
helix-config = {

View file

@ -1,21 +1,22 @@
{
fetchFromGitHub,
rustPlatform,
alejandra,
sources,
basedpyright,
bash-language-server,
callPackage,
clang-tools,
cmake-format,
cmake-language-server,
deadnix,
deno,
dprint,
fetchFromGitHub,
formats,
gdb,
kdePackages,
lib,
nil,
ruff,
rustPlatform,
shfmt,
typescript-language-server,
vscode-langservers-extracted,
@ -26,6 +27,8 @@
toml = formats.toml {};
nixfmt = callPackage "${sources.nixfmt}/default.nix" {};
# a newer nil version, for pipes support.
new-nil = nil.overrideAttrs (_: {
version = "unstable-18-07-2025";
@ -233,9 +236,8 @@
nil = {
command = getExe new-nil;
# alejandro
config.nil = {
formatting.command = ["${getExe alejandra}" "-q"];
formatting.command = ["${getExe nixfmt}"];
diagnostics = {
bindingEndHintMinLines = 3;
};