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 outputs = _: let
sources = import ./npins; sources = import ./npins;
nixpkgs = (import sources.flake-compat {src = sources.nixpkgs;}).outputs; nixpkgs = (import sources.flake-compat {src = sources.nixpkgs;}).outputs;
inherit (nixpkgs) lib; inherit (nixpkgs) lib;
eachSystem = lib.genAttrs (import sources.systems);
pkgsFor = nixpkgs.legacyPackages; pkgsFor = nixpkgs.legacyPackages;
inputs = sources; inputs = sources;
in { in {
nixosConfigurations = import ./default.nix; nixosConfigurations = import ./default.nix;
formatter = eachSystem (system: pkgsFor.${system}.alejandra);
packages = packages =
lib.mapAttrs ( lib.mapAttrs (
_: pkgs: { _: pkgs: {
inherit inherit
(import ./packages { (import ./packages {
inherit inputs pkgs; inherit inputs pkgs sources;
}) })
fish fish
helix helix
@ -44,24 +40,6 @@
) )
pkgsFor; 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; templates = import ./templates;
}; };
} }

View file

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

View file

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

View file

@ -84,6 +84,22 @@
"url": "https://github.com/nix-community/nh/archive/a90e3124111d9c3eb64e97a5334db09a8e2a4bae.tar.gz", "url": "https://github.com/nix-community/nh/archive/a90e3124111d9c3eb64e97a5334db09a8e2a4bae.tar.gz",
"hash": "sha256-KKaUEg1/ntHVsG61CkKFr2mfdsoK9Nj5FM/W1PBhe5o=" "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": { "nixpkgs": {
"type": "Channel", "type": "Channel",
"name": "nixpkgs-unstable", "name": "nixpkgs-unstable",

View file

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

View file

@ -1,5 +1,5 @@
{ {
alejandra, sources,
basedpyright, basedpyright,
bash-language-server, bash-language-server,
callPackage, callPackage,
@ -61,7 +61,7 @@
toml = formats.toml {}; 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); colorscheme = toml.generate "colorscheme.toml" (import ./colorscheme.nix);
helix-config = { helix-config = {

View file

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