style(treewide): Switch to nixfmt

This commit is contained in:
Tristan Daniël Maat 2025-11-20 15:46:17 +08:00
parent 4b0e6f0a8c
commit 82c1d22d3d
Signed by: tlater
GPG key ID: 02E935006CF2E8E7
8 changed files with 154 additions and 126 deletions

View file

@ -1,9 +1,8 @@
{ pkgs, self }:
let
callPackage = pkgs.lib.callPackageWith (pkgs // { inherit self; });
in
{
pkgs,
self,
}: let
callPackage = pkgs.lib.callPackageWith (pkgs // {inherit self;});
in {
lintNix = callPackage ./lint-nix.nix {};
openHomepage = callPackage ./open-homepage.nix {};
lintNix = callPackage ./lint-nix.nix { };
openHomepage = callPackage ./open-homepage.nix { };
}

View file

@ -2,26 +2,31 @@
self,
lib,
stdenv,
alejandra,
nixfmt-rfc-style,
deadnix,
statix,
}: let
}:
let
inherit (lib) sourceFilesBySuffices;
in
stdenv.mkDerivation {
dontPatch = true;
dontConfigure = true;
dontBuild = true;
dontInstall = true;
doCheck = true;
stdenv.mkDerivation {
dontPatch = true;
dontConfigure = true;
dontBuild = true;
dontInstall = true;
doCheck = true;
name = "lint-nix";
src = sourceFilesBySuffices self [".nix"];
checkInputs = [alejandra deadnix statix];
checkPhase = ''
mkdir -p $out
alejandra --check . | tee $out/alejandra.log
deadnix --fail | tee $out/deadnix.log
statix check | tee $out/statix.log
'';
}
name = "lint-nix";
src = sourceFilesBySuffices self [ ".nix" ];
checkInputs = [
nixfmt-rfc-style
deadnix
statix
];
checkPhase = ''
mkdir -p $out
nixfmt --strict --check . | tee $out/nixfmt.log
deadnix --fail | tee $out/deadnix.log
statix check | tee $out/statix.log
'';
}

View file

@ -1,19 +1,16 @@
{
self,
nixosTest,
}:
{ self, nixosTest }:
nixosTest {
name = "open-homepage";
nodes = {
# Host with just the default configuration
defaults = {
imports = [self.nixosModules.default];
imports = [ self.nixosModules.default ];
services.tlaternet-webserver.enable = true;
};
host = {
imports = [self.nixosModules.default];
imports = [ self.nixosModules.default ];
services.tlaternet-webserver = {
enable = true;
@ -23,10 +20,10 @@ nixosTest {
};
};
networking.firewall.allowedTCPPorts = [8080];
networking.firewall.allowedTCPPorts = [ 8080 ];
};
client = {};
client = { };
};
testScript = ''