refactor checks

This commit is contained in:
Daylin Morgan 2024-06-16 17:13:19 -05:00
parent 1042da2886
commit 097dc5677f
Signed by: daylin
GPG key ID: 950D13E9719334AD
2 changed files with 54 additions and 36 deletions

26
lib/checks.nix Normal file
View file

@ -0,0 +1,26 @@
{ inputs, pkgs }:
{
makePackages =
pkgs.runCommandLocal "build-third-party"
{
src = ./.;
nativeBuildInputs = [
pkgs.pixi
pkgs.swww
inputs.tsm.packages.${pkgs.system}.default
inputs.hyprman.packages.${pkgs.system}.default
inputs.roc.packages.${pkgs.system}.full
inputs.roc.packages.${pkgs.system}.lang-server
inputs.zls.outputs.packages.${pkgs.system}.default
inputs.zig2nix.outputs.packages.${pkgs.system}.zig.master.bin
];
}
''
mkdir "$out"
'';
}

View file

@ -25,19 +25,7 @@ let
in in
rec { rec {
forAllSystems = f: genAttrs supportedSystems (system: f (import nixpkgs { inherit system; })); forAllSystems = f: genAttrs supportedSystems (system: f (import nixpkgs { inherit system; }));
oizysModules = listToAttrs (findModulesList ../modules);
nixosModules = listToAttrs (findModulesList ../modules);
mkPackageCheck =
{ packages, pkgs }:
pkgs.runCommandLocal "build-third-party"
{
src = ./.;
nativeBuildInputs = [ packages ];
}
''
mkdir "$out"
'';
mkSystem = mkSystem =
hostName: hostName:
@ -70,7 +58,7 @@ rec {
oizys-go = pkgs.callPackage ../pkgs/oizys/oizys-go { }; oizys-go = pkgs.callPackage ../pkgs/oizys/oizys-go { };
default = oizys-go; default = oizys-go;
}); });
devShells = forAllSystems (pkgs: { oizysShells = forAllSystems (pkgs: {
default = pkgs.mkShell { default = pkgs.mkShell {
packages = with pkgs; [ packages = with pkgs; [
git git
@ -79,30 +67,34 @@ rec {
}; };
}); });
oizysChecks = forAllSystems (pkgs: import ./checks.nix { inherit pkgs inputs; });
oizysFormatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style);
oizysFlake = { oizysFlake = {
nixosModules = nixosModules; nixosModules = oizysModules;
nixosConfigurations = oizysHosts; nixosConfigurations = oizysHosts;
packages = oizysPkg; packages = oizysPkg;
devShells = devShells; devShells = oizysShells;
formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style); formatter = oizysFormatter;
checks = forAllSystems (pkgs: { checks = oizysChecks;
packageCheck = mkPackageCheck { # checks = forAllSystems (pkgs: {
inherit pkgs; # packageCheck = mkPackageCheck {
# make sure lix is in this? # inherit pkgs;
packages = [ # # make sure lix is in this?
pkgs.pixi # packages = [
pkgs.swww # pkgs.pixi
# pkgs.swww
inputs.tsm.packages.${pkgs.system}.default #
inputs.hyprman.packages.${pkgs.system}.default # inputs.tsm.packages.${pkgs.system}.default
# inputs.hyprman.packages.${pkgs.system}.default
inputs.roc.packages.${pkgs.system}.full #
inputs.roc.packages.${pkgs.system}.lang-server # inputs.roc.packages.${pkgs.system}.full
# inputs.roc.packages.${pkgs.system}.lang-server
inputs.zls.outputs.packages.${pkgs.system}.default #
inputs.zig2nix.outputs.packages.${pkgs.system}.zig.master.bin # inputs.zls.outputs.packages.${pkgs.system}.default
]; # inputs.zig2nix.outputs.packages.${pkgs.system}.zig.master.bin
}; # ];
}); #
# };
# });
}; };
} }