oizys/lib/default.nix

80 lines
1.8 KiB
Nix
Raw Normal View History

2024-05-06 14:32:00 -05:00
inputs:
let
2024-06-25 16:03:50 -05:00
inherit (inputs) nixpkgs self;
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-07-03 10:52:28 -05:00
enableAttrs
2024-05-06 14:32:00 -05:00
;
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" ];
2024-06-17 09:48:54 -05:00
2024-05-06 14:32:00 -05:00
forAllSystems = f: genAttrs supportedSystems (system: f (import nixpkgs { inherit system; }));
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
2024-06-18 10:45:51 -05:00
inputs.hyprland.nixosModules.default
2024-05-12 14:50:33 -05:00
] ++ filter isNixFile (listFilesRecursive (../. + "/hosts/${hostName}"));
2024-05-06 14:32:00 -05:00
specialArgs = {
inherit
inputs
lib
self
mkDefaultOizysModule
mkOizysModule
enabled
2024-07-03 10:52:28 -05:00
enableAttrs
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
2024-06-17 09:48:54 -05:00
in
{
2024-03-21 11:06:07 -05:00
oizysFlake = {
2024-06-17 09:48:54 -05:00
nixosModules = listToAttrs (findModulesList ../modules);
nixosConfigurations = mapAttrs (name: _: mkSystem name) (readDir ../hosts);
packages = forAllSystems (pkgs: rec {
2024-06-28 10:17:08 -05:00
oizys-go = pkgs.callPackage ../pkgs/oizys { };
2024-06-17 09:48:54 -05:00
default = oizys-go;
});
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
packages = with pkgs; [
git
deadnix
];
};
});
2024-06-17 10:06:58 -05:00
checks = forAllSystems (
pkgs:
import ./checks.nix {
inherit inputs;
system = pkgs.system;
}
);
2024-06-17 09:48:54 -05:00
formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style);
2024-02-21 14:36:33 -06:00
};
2024-01-23 11:51:13 -06:00
}