fix: Flake | use nixfmt=classic to format nix files

This commit is contained in:
2025-02-17 19:24:25 +05:00
parent 234e52f051
commit 7eab398f6d
41 changed files with 189 additions and 370 deletions

View File

@@ -40,33 +40,33 @@
};
};
outputs = {nixpkgs, ...} @ inputs: let
inherit (nixpkgs) lib;
mkHost = host: {
${host} = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs;
outputs = { nixpkgs, ... }@inputs:
let
inherit (nixpkgs) lib;
mkHost = host: {
${host} = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs;
# Extend lib with lib.custom
lib = nixpkgs.lib.extend (self: super: { custom = import ./lib { inherit (nixpkgs) lib; }; });
# Extend lib with lib.custom
lib = nixpkgs.lib.extend (self: super: {
custom = import ./lib { inherit (nixpkgs) lib; };
});
};
modules = [ ./hosts/nixos/${host} ];
};
};
mkHostConfigs = hosts:
lib.foldl (acc: set: acc // set) { }
(lib.map (host: mkHost host) hosts);
readHosts = folder: lib.attrNames (builtins.readDir ./hosts/${folder});
in {
nixosConfigurations = mkHostConfigs (readHosts "nixos");
modules = [ ./hosts/nixos/${host} ];
devShell.x86_64-linux = let pkgs = nixpkgs.legacyPackages.x86_64-linux;
in pkgs.mkShell {
buildInputs = with pkgs; [ nil nixfmt-classic lua-language-server ];
};
};
mkHostConfigs = hosts: lib.foldl (acc: set: acc // set) { } (lib.map (host: mkHost host) hosts);
readHosts = folder: lib.attrNames (builtins.readDir ./hosts/${folder});
in {
nixosConfigurations = mkHostConfigs (readHosts "nixos");
devShell.x86_64-linux = let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
in pkgs.mkShell {
buildInputs = with pkgs; [
nil
alejandra
lua-language-server
];
};
};
}