mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-11-05 01:53:15 -06:00
add iso builder package
This commit is contained in:
parent
938bdd6740
commit
07665aae2b
3 changed files with 76 additions and 43 deletions
|
@ -3,59 +3,21 @@ let
|
|||
inherit (inputs) nixpkgs self;
|
||||
lib = nixpkgs.lib.extend (import ./extended.nix);
|
||||
|
||||
inherit (builtins)
|
||||
mapAttrs
|
||||
readDir
|
||||
filter
|
||||
listToAttrs
|
||||
;
|
||||
inherit (lib)
|
||||
nixosSystem
|
||||
genAttrs
|
||||
isNixFile
|
||||
mkDefaultOizysModule
|
||||
mkOizysModule
|
||||
enabled
|
||||
enableAttrs
|
||||
;
|
||||
inherit (lib.filesystem) listFilesRecursive;
|
||||
inherit (builtins) mapAttrs readDir listToAttrs;
|
||||
inherit (lib) genAttrs;
|
||||
|
||||
inherit (import ./find-modules.nix { inherit lib; }) findModulesList;
|
||||
inherit (import ./generators.nix { inherit lib self inputs; }) mkIso mkSystem;
|
||||
#supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
|
||||
supportedSystems = [ "x86_64-linux" ];
|
||||
|
||||
forAllSystems = f: genAttrs supportedSystems (system: f (import nixpkgs { inherit system; }));
|
||||
|
||||
mkSystem =
|
||||
hostName:
|
||||
nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
../modules/oizys.nix
|
||||
../overlays
|
||||
inputs.lix-module.nixosModules.default
|
||||
inputs.hyprland.nixosModules.default
|
||||
] ++ filter isNixFile (listFilesRecursive (../. + "/hosts/${hostName}"));
|
||||
specialArgs = {
|
||||
inherit
|
||||
inputs
|
||||
lib
|
||||
self
|
||||
mkDefaultOizysModule
|
||||
mkOizysModule
|
||||
enabled
|
||||
enableAttrs
|
||||
hostName
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
in
|
||||
{
|
||||
oizysFlake = {
|
||||
nixosModules = listToAttrs (findModulesList ../modules);
|
||||
nixosConfigurations = mapAttrs (name: _: mkSystem name) (readDir ../hosts);
|
||||
packages = forAllSystems (pkgs: rec {
|
||||
iso = mkIso.config.system.build.isoImage;
|
||||
oizys-go = pkgs.callPackage ../pkgs/oizys { };
|
||||
default = oizys-go;
|
||||
});
|
||||
|
|
66
lib/generators.nix
Normal file
66
lib/generators.nix
Normal file
|
@ -0,0 +1,66 @@
|
|||
{
|
||||
inputs,
|
||||
self,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (builtins) filter;
|
||||
inherit (lib)
|
||||
nixosSystem
|
||||
isNixFile
|
||||
mkDefaultOizysModule
|
||||
mkOizysModule
|
||||
enabled
|
||||
enableAttrs
|
||||
;
|
||||
inherit (lib.filesystem) listFilesRecursive;
|
||||
|
||||
mkIso = nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
self.nixosModules.nix
|
||||
self.nixosModules.essentials
|
||||
(
|
||||
{ pkgs, modulesPath, ... }:
|
||||
{
|
||||
imports = [ (modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix") ];
|
||||
environment.systemPackages = with pkgs; [ neovim ];
|
||||
}
|
||||
)
|
||||
];
|
||||
specialArgs = {
|
||||
inherit
|
||||
inputs
|
||||
lib
|
||||
self
|
||||
enabled;
|
||||
};
|
||||
};
|
||||
mkSystem =
|
||||
hostName:
|
||||
nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
../modules/oizys.nix
|
||||
../overlays
|
||||
inputs.lix-module.nixosModules.default
|
||||
inputs.hyprland.nixosModules.default
|
||||
] ++ filter isNixFile (listFilesRecursive (../. + "/hosts/${hostName}"));
|
||||
specialArgs = {
|
||||
inherit
|
||||
inputs
|
||||
lib
|
||||
self
|
||||
mkDefaultOizysModule
|
||||
mkOizysModule
|
||||
enabled
|
||||
enableAttrs
|
||||
hostName
|
||||
;
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
inherit mkIso mkSystem;
|
||||
}
|
|
@ -5,7 +5,12 @@
|
|||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkOption mkIf types optional;
|
||||
inherit (lib)
|
||||
mkOption
|
||||
mkIf
|
||||
types
|
||||
optional
|
||||
;
|
||||
cfg = config.users.defaultUser;
|
||||
isDocker = config.oizys.docker.enable;
|
||||
isDesktop = config.oizys.desktop.enable;
|
||||
|
|
Loading…
Reference in a new issue