oizys/lib/default.nix

101 lines
2.7 KiB
Nix
Raw Normal View History

2024-05-06 14:32:00 -05:00
inputs:
let
2024-05-13 16:31:10 -05:00
inherit (inputs) nixpkgs self zig2nix;
2024-03-01 00:26:52 -06:00
lib = nixpkgs.lib.extend (import ./extended.nix);
2024-05-06 14:32:00 -05:00
inherit (builtins)
mapAttrs
readDir
filter
listToAttrs
;
inherit (lib)
nixosSystem
genAttrs
isNixFile
mkDefaultOizysModule
mkOizysModule
enabled
;
2024-03-01 00:26:52 -06:00
inherit (lib.filesystem) listFilesRecursive;
2024-01-24 14:12:52 -06:00
2024-05-06 14:32:00 -05:00
inherit (import ./find-modules.nix { inherit lib; }) findModulesList;
2024-02-27 10:27:41 -06:00
#supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
2024-05-06 14:32:00 -05:00
supportedSystems = [ "x86_64-linux" ];
in
rec {
forAllSystems = f: genAttrs supportedSystems (system: f (import nixpkgs { inherit system; }));
2024-06-16 17:13:19 -05:00
oizysModules = listToAttrs (findModulesList ../modules);
2024-05-06 14:32:00 -05:00
mkSystem =
2024-05-12 14:50:33 -05:00
hostName:
2024-01-23 11:51:13 -06:00
nixosSystem {
system = "x86_64-linux";
2024-05-12 14:50:33 -05:00
modules = [
../modules/oizys.nix
../overlays
inputs.lix-module.nixosModules.default
] ++ filter isNixFile (listFilesRecursive (../. + "/hosts/${hostName}"));
2024-02-15 10:57:13 -06:00
2024-05-06 14:32:00 -05:00
specialArgs = {
inherit
inputs
lib
self
mkDefaultOizysModule
mkOizysModule
enabled
2024-05-12 14:50:33 -05:00
hostName
2024-05-06 14:32:00 -05:00
;
};
2024-01-23 11:51:13 -06:00
};
2024-03-20 10:43:35 -05:00
oizysHosts = mapAttrs (name: _: mkSystem name) (readDir ../hosts);
2024-05-06 14:32:00 -05:00
oizysPkg = forAllSystems (pkgs: rec {
2024-05-13 16:31:10 -05:00
oizys-zig = pkgs.callPackage ../pkgs/oizys/oizys-zig { inherit zig2nix; };
2024-05-06 14:32:00 -05:00
oizys-nim = pkgs.callPackage ../pkgs/oizys/oizys-nim { };
oizys-rs = pkgs.callPackage ../pkgs/oizys/oizys-rs { };
oizys-go = pkgs.callPackage ../pkgs/oizys/oizys-go { };
2024-05-14 12:23:13 -05:00
default = oizys-go;
2024-05-06 14:32:00 -05:00
});
2024-06-16 17:13:19 -05:00
oizysShells = forAllSystems (pkgs: {
2024-05-06 14:32:00 -05:00
default = pkgs.mkShell {
packages = with pkgs; [
git
deadnix
];
};
});
2024-02-21 14:36:33 -06:00
2024-06-16 17:13:19 -05:00
oizysChecks = forAllSystems (pkgs: import ./checks.nix { inherit pkgs inputs; });
oizysFormatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style);
2024-03-21 11:06:07 -05:00
oizysFlake = {
2024-06-16 17:13:19 -05:00
nixosModules = oizysModules;
2024-03-20 10:43:35 -05:00
nixosConfigurations = oizysHosts;
packages = oizysPkg;
2024-06-16 17:13:19 -05:00
devShells = oizysShells;
formatter = oizysFormatter;
checks = oizysChecks;
# checks = forAllSystems (pkgs: {
# packageCheck = mkPackageCheck {
# inherit pkgs;
# # make sure lix is in this?
# packages = [
# 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
# ];
#
# };
# });
2024-02-21 14:36:33 -06:00
};
2024-01-23 11:51:13 -06:00
}