Add alejandra nix formatter and integrate into NixOS flake

This commit is contained in:
2026-02-19 15:40:15 +01:00
parent 6e682b315b
commit 637def6ca3
3 changed files with 88 additions and 2 deletions

79
flake.lock generated
View File

@ -1,5 +1,28 @@
{
"nodes": {
"alejandra": {
"inputs": {
"fenix": "fenix",
"flakeCompat": "flakeCompat",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1744324181,
"narHash": "sha256-Oi1n2ncF4/AWeY6X55o2FddIRICokbciqFYK64XorYk=",
"owner": "kamadorueda",
"repo": "alejandra",
"rev": "3e2a85506627062313e131bf8a85315f3387c8e0",
"type": "github"
},
"original": {
"owner": "kamadorueda",
"ref": "4.0.0",
"repo": "alejandra",
"type": "github"
}
},
"base16": {
"inputs": {
"fromYaml": "fromYaml"
@ -68,6 +91,28 @@
"type": "github"
}
},
"fenix": {
"inputs": {
"nixpkgs": [
"alejandra",
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1730615655,
"narHash": "sha256-2HBR3zLn57LXKNRtxBb+O+uDqHM4n0pz51rPayMl4cg=",
"owner": "nix-community",
"repo": "fenix",
"rev": "efeb50e2535b17ffd4a135e6e3e5fd60a525180c",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "fenix",
"type": "github"
}
},
"firefox-gnome-theme": {
"flake": false,
"locked": {
@ -126,6 +171,22 @@
"type": "github"
}
},
"flakeCompat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"fromYaml": {
"flake": false,
"locked": {
@ -449,6 +510,7 @@
},
"root": {
"inputs": {
"alejandra": "alejandra",
"grub2-themes": "grub2-themes",
"home-manager": "home-manager",
"niri": "niri",
@ -462,6 +524,23 @@
"zen-browser": "zen-browser"
}
},
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1730555913,
"narHash": "sha256-KNHZUlqsEibg3YtfUyOFQSofP8hp1HKoY+laoesBxRM=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "f17a5bbfd0969ba2e63a74505a80e55ecb174ed9",
"type": "github"
},
"original": {
"owner": "rust-lang",
"ref": "nightly",
"repo": "rust-analyzer",
"type": "github"
}
},
"stylix": {
"inputs": {
"base16": "base16",

View File

@ -37,12 +37,17 @@
inputs.nixpkgs.follows = "nixpkgs";
};
alejandra = {
url = "github:kamadorueda/alejandra/4.0.0";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-flatpak.url = "github:gmodena/nix-flatpak";
grub2-themes.url = "github:vinceliuice/grub2-themes";
};
outputs = inputs@{ nixpkgs, home-manager, plasma-manager, nixos-hardware, stylix, niri, zen-browser, grub2-themes, nix-flatpak, ... }:
outputs = inputs@{ nixpkgs, alejandra, home-manager, plasma-manager, nixos-hardware, stylix, niri, zen-browser, grub2-themes, nix-flatpak, ... }:
let
username = "cookiez";
hostname = "nixos";
@ -63,6 +68,7 @@
inherit version;
inherit system;
inherit project;
inherit alejandra;
host = hostname;
};
modules = [

View File

@ -1,4 +1,4 @@
{config, pkgs, libs, inputs, nix-flatpak, ...}:
{config, pkgs, libs, inputs, system, alejandra, ...}:
{
environment.systemPackages = with pkgs; [
#Essentials (CLI Only)
@ -45,5 +45,6 @@
kdePackages.ksshaskpass
ntfs3g
appimage-run
alejandra.defaultPackage.${system}
];
}