treewide: alejandra -> nixfmt

This commit is contained in:
Mihai Fufezan 2026-03-02 15:57:50 +02:00
parent 340a792e3b
commit e63f3a7933
Signed by: fufexan
SSH key fingerprint: SHA256:SdnKmEpJrDu1+2UO1QpB/Eg4HKcdDi6n+xSRqFNJVpg
2 changed files with 39 additions and 29 deletions

View file

@ -6,26 +6,31 @@
systems.url = "github:nix-systems/default-linux";
};
outputs = {
self,
nixpkgs,
systems,
}: let
inherit (nixpkgs) lib;
eachSystem = lib.genAttrs (import systems);
pkgsFor = eachSystem (system:
import nixpkgs {
localSystem.system = system;
overlays = with self.overlays; [hyprutils];
outputs =
{
self,
nixpkgs,
systems,
}:
let
inherit (nixpkgs) lib;
eachSystem = lib.genAttrs (import systems);
pkgsFor = eachSystem (
system:
import nixpkgs {
localSystem.system = system;
overlays = with self.overlays; [ hyprutils ];
}
);
in
{
overlays = import ./nix/overlays.nix { inherit self lib; };
packages = eachSystem (system: {
default = self.packages.${system}.hyprutils;
inherit (pkgsFor.${system}) hyprutils hyprutils-debug hyprutils-with-tests;
});
in {
overlays = import ./nix/overlays.nix {inherit self lib;};
packages = eachSystem (system: {
default = self.packages.${system}.hyprutils;
inherit (pkgsFor.${system}) hyprutils hyprutils-debug hyprutils-with-tests;
});
formatter = eachSystem (system: pkgsFor.${system}.alejandra);
};
formatter = eachSystem (system: pkgsFor.${system}.nixfmt-tree);
};
}

View file

@ -1,23 +1,28 @@
{
self,
lib,
}: let
mkDate = longDate: (lib.concatStringsSep "-" [
(builtins.substring 0 4 longDate)
(builtins.substring 4 2 longDate)
(builtins.substring 6 2 longDate)
]);
}:
let
mkDate =
longDate:
(lib.concatStringsSep "-" [
(builtins.substring 0 4 longDate)
(builtins.substring 4 2 longDate)
(builtins.substring 6 2 longDate)
]);
ver = lib.removeSuffix "\n" (builtins.readFile ../VERSION);
version = ver + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
in {
version =
ver + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
in
{
default = self.overlays.hyprutils;
hyprutils = final: prev: {
hyprutils = final.callPackage ./default.nix {
stdenv = final.gcc15Stdenv;
inherit version;
};
hyprutils-debug = final.hyprutils.override {debug = true;};
hyprutils-debug = final.hyprutils.override { debug = true; };
hyprutils-with-tests = final.hyprutils-debug;
};
}