2024-03-26 09:42:22 -05:00
|
|
|
inputs: let
|
|
|
|
inherit (inputs) nixpkgs self;
|
2024-03-01 00:26:52 -06:00
|
|
|
lib = nixpkgs.lib.extend (import ./extended.nix);
|
|
|
|
|
2024-03-17 06:17:19 -05:00
|
|
|
inherit (builtins) mapAttrs readDir filter listToAttrs;
|
2024-04-28 09:12:56 -05:00
|
|
|
inherit (lib) nixosSystem genAttrs isNixFile mkDefaultOizysModule mkOizysModule enabled mkRune;
|
2024-03-01 00:26:52 -06:00
|
|
|
inherit (lib.filesystem) listFilesRecursive;
|
2024-01-24 14:12:52 -06:00
|
|
|
|
2024-03-17 06:17:19 -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"];
|
|
|
|
supportedSystems = ["x86_64-linux"];
|
|
|
|
in rec {
|
2024-03-31 16:40:21 -05:00
|
|
|
forAllSystems = f: genAttrs supportedSystems (system: f (import nixpkgs {inherit system;}));
|
2024-02-27 10:41:27 -06:00
|
|
|
|
2024-03-20 10:43:35 -05:00
|
|
|
nixosModules = listToAttrs (findModulesList ../modules);
|
2024-01-24 14:12:52 -06:00
|
|
|
|
2024-01-23 11:51:13 -06:00
|
|
|
mkSystem = hostname:
|
|
|
|
nixosSystem {
|
|
|
|
system = "x86_64-linux";
|
2024-02-15 12:01:08 -06:00
|
|
|
modules =
|
|
|
|
[
|
2024-03-19 09:49:43 -05:00
|
|
|
../modules/oizys.nix
|
2024-02-15 12:01:08 -06:00
|
|
|
../overlays
|
2024-02-15 10:57:13 -06:00
|
|
|
]
|
2024-02-15 12:01:08 -06:00
|
|
|
++ filter
|
|
|
|
isNixFile
|
|
|
|
(listFilesRecursive (../. + "/hosts/${hostname}"));
|
2024-02-15 10:57:13 -06:00
|
|
|
|
2024-04-28 09:12:56 -05:00
|
|
|
specialArgs = {inherit inputs lib self mkDefaultOizysModule mkOizysModule enabled mkRune;};
|
2024-01-23 11:51:13 -06:00
|
|
|
};
|
2024-03-20 10:43:35 -05:00
|
|
|
|
|
|
|
oizysHosts = mapAttrs (name: _: mkSystem name) (readDir ../hosts);
|
2024-03-21 15:48:48 -05:00
|
|
|
oizysPkg = forAllSystems (
|
|
|
|
pkgs: rec {
|
2024-04-05 09:59:46 -05:00
|
|
|
oizys-zig = pkgs.callPackage ../pkgs/oizys/oizys-zig {zig2nix = inputs.zig2nix;};
|
2024-03-27 03:33:39 -05:00
|
|
|
oizys-nim = pkgs.callPackage ../pkgs/oizys/oizys-nim {};
|
2024-03-31 16:40:21 -05:00
|
|
|
oizys-rs = pkgs.callPackage ../pkgs/oizys/oizys-rs {};
|
|
|
|
default = oizys-zig;
|
2024-03-20 10:43:35 -05:00
|
|
|
}
|
|
|
|
);
|
|
|
|
devShells = forAllSystems (
|
|
|
|
pkgs: {
|
|
|
|
default = pkgs.mkShell {
|
|
|
|
packages = with pkgs; [git deadnix];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
);
|
2024-02-21 14:36:33 -06:00
|
|
|
|
2024-03-21 11:06:07 -05:00
|
|
|
oizysFlake = {
|
2024-03-20 10:43:35 -05:00
|
|
|
nixosModules = nixosModules;
|
|
|
|
nixosConfigurations = oizysHosts;
|
|
|
|
packages = oizysPkg;
|
|
|
|
devShells = devShells;
|
2024-02-21 14:36:33 -06:00
|
|
|
formatter = forAllSystems (pkgs: pkgs.alejandra);
|
|
|
|
};
|
2024-01-23 11:51:13 -06:00
|
|
|
}
|