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,
nix-darwin,
flake-parts,
self,
...
}:
let
@ -120,9 +121,13 @@
];
flake = {
nixosConfigurations = {
demeter = buildLiminalOS {
inherit inputs nixpkgs;
systemModule = ./reference/hosts/demeter;
demeter = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs self;
};
modules = [
./reference/hosts/demeter
];
};
callisto = buildLiminalOS {
inherit nixpkgs inputs;
@ -145,6 +150,39 @@
./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 =
{
@ -170,16 +208,6 @@
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;
in
{
imports = [
inputs.home-manager.nixosModules.home-manager
];
options.liminalOS.integrateHomeManager = lib.mkOption {
type = lib.types.bool;
default = cfg.enable;

View file

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

View file

@ -1,19 +1,11 @@
{
inputs,
pkgs,
spicepkgs,
config,
osConfig,
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) {
programs.spicetify = {
enable = true;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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