oizys/lib/default.nix

67 lines
1.8 KiB
Nix
Raw Normal View History

2024-07-11 16:31:51 -05:00
inputs@{ nixpkgs, self, ... }:
2024-05-06 14:32:00 -05:00
let
2024-07-25 09:57:26 -05:00
lib = nixpkgs.lib.extend (import ./extended.nix inputs);
2024-03-01 00:26:52 -06:00
2024-07-03 13:05:25 -05:00
inherit (builtins) mapAttrs readDir listToAttrs;
2024-08-09 11:57:03 -05:00
inherit (lib) genAttrs pkgFromSystem pkgsFromSystem;
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-07-03 13:05:25 -05:00
inherit (import ./generators.nix { inherit lib self inputs; }) mkIso mkSystem;
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-08-28 11:08:58 -05:00
forAllSystems = f: genAttrs supportedSystems (system: f (import nixpkgs {
inherit system;
overlays = [inputs.nim2nix.overlays.default];
}));
2024-08-14 10:25:49 -05:00
2024-08-09 11:57:03 -05:00
inheritFlakePkgs =
pkgs: flakes:
listToAttrs (
map (name: {
inherit name;
value = pkgFromSystem pkgs.system name;
}) flakes
);
2024-07-11 16:31:51 -05:00
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);
2024-08-09 11:57:03 -05:00
packages = forAllSystems (
pkgs:
rec {
default = oizys-cli;
2024-08-28 11:08:58 -05:00
oizys-nim = pkgs.callPackage ../pkgs/oizys-nim { };
2024-08-09 11:57:03 -05:00
oizys-cli = pkgs.callPackage ../pkgs/oizys { };
iso = mkIso.config.system.build.isoImage;
roc = (pkgsFromSystem pkgs.system "roc").full;
}
// (inheritFlakePkgs pkgs [
"pixi"
"f1multiviewer"
"tsm"
])
);
2024-06-17 09:48:54 -05:00
devShells = forAllSystems (pkgs: {
2024-08-28 11:08:58 -05:00
oizys = pkgs.mkShell {
2024-06-17 09:48:54 -05:00
packages = with pkgs; [
2024-08-28 11:08:58 -05:00
openssl
nim
nimble
2024-06-17 09:48:54 -05:00
];
};
});
2024-06-17 10:06:58 -05:00
checks = forAllSystems (
pkgs:
import ./checks.nix {
2024-08-09 11:57:03 -05:00
inherit inputs lib self;
2024-06-17 10:06:58 -05:00
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-07-11 16:31:51 -05:00
in
{
inherit oizysFlake;
2024-01-23 11:51:13 -06:00
}