feat: bundle external nixosModules with liminalOS module

This commit is contained in:
Youwen Wu 2024-12-25 23:11:43 -08:00
parent d66cce9fa1
commit e9c6c54ee1
Signed by: youwen5
GPG key ID: 865658ED1FE61EC3
11 changed files with 49 additions and 45 deletions

View file

@ -106,6 +106,7 @@
nixpkgs, nixpkgs,
nix-darwin, nix-darwin,
flake-parts, flake-parts,
self,
... ...
}: }:
let let
@ -120,9 +121,13 @@
]; ];
flake = { flake = {
nixosConfigurations = { nixosConfigurations = {
demeter = buildLiminalOS { demeter = nixpkgs.lib.nixosSystem {
inherit inputs nixpkgs; specialArgs = {
systemModule = ./reference/hosts/demeter; inherit inputs self;
};
modules = [
./reference/hosts/demeter
];
}; };
callisto = buildLiminalOS { callisto = buildLiminalOS {
inherit nixpkgs inputs; inherit nixpkgs inputs;
@ -145,6 +150,39 @@
./hosts/phobos ./hosts/phobos
]; ];
}; };
nixosModules = rec {
default = liminalOS;
liminalOS = {
imports = [
inputs.nix-flatpak.nixosModules.nix-flatpak
inputs.home-manager.nixosModules.home-manager
inputs.nixos-wsl.nixosModules.default
inputs.stylix.nixosModules.stylix
./modules/default.nix
(
{ pkgs, ... }:
{
home-manager.extraSpecialArgs = {
spicepkgs = inputs.spicetify.legacyPackages.${pkgs.system};
inherit inputs self;
};
}
)
];
};
};
homeManagerModules = rec {
default = liminalOS;
liminalOS = {
imports = [
inputs.nix-index-database.hmModules.nix-index
inputs.spicetify.homeManagerModules.default
./hm/modules/default.nix
];
};
};
}; };
perSystem = perSystem =
{ {
@ -170,16 +208,6 @@
inputs.viminal.packages.${system}.default inputs.viminal.packages.${system}.default
]; ];
}; };
nixosModules = {
default = config.nixosModules.liminalOS;
liminalOS = ./modules/default.nix;
};
homeManagerModules = {
default = config.homeManagerModules.liminalOS;
liminalOS = ./hm/modules/default.nix;
};
}; };
}; };
} }

View file

@ -8,10 +8,6 @@ let
cfg = config.liminalOS; cfg = config.liminalOS;
in in
{ {
imports = [
inputs.home-manager.nixosModules.home-manager
];
options.liminalOS.integrateHomeManager = lib.mkOption { options.liminalOS.integrateHomeManager = lib.mkOption {
type = lib.types.bool; type = lib.types.bool;
default = cfg.enable; default = cfg.enable;

View file

@ -1,7 +1,6 @@
{ {
config, config,
lib, lib,
inputs,
pkgs, pkgs,
osConfig, osConfig,
... ...
@ -11,7 +10,6 @@ let
in in
{ {
imports = [ imports = [
inputs.nix-index-database.hmModules.nix-index
./fastfetch ./fastfetch
]; ];

View file

@ -1,19 +1,11 @@
{ {
inputs, spicepkgs,
pkgs,
config, config,
osConfig, osConfig,
lib, lib,
... ...
}: }:
let
spicepkgs = inputs.spicetify.legacyPackages.${pkgs.system};
in
{ {
imports = [
inputs.spicetify.homeManagerModules.default
];
config = lib.mkIf (config.liminalOS.programs.enable && osConfig.liminalOS.config.allowUnfree) { config = lib.mkIf (config.liminalOS.programs.enable && osConfig.liminalOS.config.allowUnfree) {
programs.spicetify = { programs.spicetify = {
enable = true; enable = true;

View file

@ -10,6 +10,7 @@ in
{ {
imports = [ imports = [
./linux ./linux
../hm
]; ];
options.liminalOS = { options.liminalOS = {
darwin.enable = lib.mkOption { darwin.enable = lib.mkOption {

View file

@ -183,8 +183,8 @@ in
programs.fish.enable = true; programs.fish.enable = true;
services.tlp.enable = lib.mkIf (cfg.formFactor == "laptop") true; services.tlp.enable = lib.mkIf (config.liminalOS.formFactor == "laptop") true;
programs.light.enable = lib.mkIf (cfg.formFactor == "laptop") true; programs.light.enable = lib.mkIf (config.liminalOS.formFactor == "laptop") true;
hardware.bluetooth = lib.mkIf cfg.bluetooth.enable { hardware.bluetooth = lib.mkIf cfg.bluetooth.enable {
enable = true; enable = true;

View file

@ -12,10 +12,6 @@ let
cfg = config.liminalOS.programs.flatpak; cfg = config.liminalOS.programs.flatpak;
in in
{ {
imports = [
inputs.nix-flatpak.nixosModules.nix-flatpak
];
options.liminalOS.programs.flatpak = { options.liminalOS.programs.flatpak = {
enable = lib.mkOption { enable = lib.mkOption {
type = lib.types.bool; type = lib.types.bool;

View file

@ -26,10 +26,6 @@ in
}; };
}; };
imports = [
inputs.stylix.nixosModules.stylix
];
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
stylix = { stylix = {
enable = true; enable = true;

View file

@ -8,10 +8,6 @@ let
cfg = config.liminalOS.wsl; cfg = config.liminalOS.wsl;
in in
{ {
imports = [
inputs.nixos-wsl.nixosModules.default
];
options.liminalOS.wsl = { options.liminalOS.wsl = {
enable = lib.mkEnableOption "WSL"; enable = lib.mkEnableOption "WSL";
}; };

View file

@ -1,13 +1,13 @@
{ {
inputs, inputs,
self,
... ...
}: }:
{ {
imports = imports =
[ [
./configuration.nix ./configuration.nix
../../../modules/linux self.nixosModules.liminalOS
../../../hm
../../../overlays ../../../overlays
{ {
home-manager.users.youwen = { home-manager.users.youwen = {

View file

@ -1,6 +1,7 @@
{ self, ... }:
{ {
imports = [ imports = [
../../../hm/modules self.homeManagerModules.liminalOS
]; ];
home = { home = {