mirror of
https://github.com/donovanglover/nix-config.git
synced 2024-11-21 15:53:32 +01:00
feat: Simplify imports by importing with specialArgs
This change makes it possible to import the modules that are required from the flake inputs in the output modules themselves, thus preventing users from having to manually import those modules. This simplifies things overall and was made possible by the specialArgs option that allowed these flake inputs to be passed into our container.
This commit is contained in:
parent
267dda3224
commit
b368817c52
@ -42,8 +42,6 @@
|
||||
system = "x86_64-linux";
|
||||
specialArgs = attrs;
|
||||
modules = [
|
||||
home-manager.nixosModules.home-manager
|
||||
stylix.nixosModules.stylix
|
||||
./hardware/laptop.nix
|
||||
{
|
||||
environment.pathsToLink = [
|
||||
|
@ -37,6 +37,11 @@ let
|
||||
node = "/dev/dri/renderD128";
|
||||
}
|
||||
];
|
||||
|
||||
specialArgs = {
|
||||
inherit home-manager;
|
||||
inherit stylix;
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
@ -50,8 +55,6 @@ in
|
||||
|
||||
config = { lib, pkgs, ... }: {
|
||||
imports = [
|
||||
stylix.nixosModules.stylix
|
||||
home-manager.nixosModules.home-manager
|
||||
../containers/shared.nix
|
||||
];
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
{ pkgs, config, lib, ... }:
|
||||
{ home-manager, stylix, pkgs, config, lib, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf mkMerge;
|
||||
@ -13,6 +13,11 @@ let
|
||||
cfg = config.modules.desktop;
|
||||
in
|
||||
{
|
||||
imports = attrValues {
|
||||
inherit (home-manager.nixosModules) home-manager;
|
||||
inherit (stylix.nixosModules) stylix;
|
||||
};
|
||||
|
||||
options.modules.desktop = {
|
||||
japanese = mkEnableOption "Japanese support (fcitx, anki, kanjidraw, etc.)";
|
||||
bloat = mkEnableOption "GUI applications like Logseq";
|
||||
|
@ -6,8 +6,6 @@ in (import ./lib.nix) {
|
||||
|
||||
nodes.machine = { self, pkgs, ... }: {
|
||||
imports = attrValues {
|
||||
inherit (self.inputs.home-manager.nixosModules) home-manager;
|
||||
inherit (self.inputs.stylix.nixosModules) stylix;
|
||||
inherit (self.nixosModules) system desktop;
|
||||
};
|
||||
};
|
||||
|
@ -6,7 +6,6 @@ in (import ./lib.nix) {
|
||||
|
||||
nodes.machine = { self, pkgs, ... }: {
|
||||
imports = attrValues {
|
||||
inherit (self.inputs.home-manager.nixosModules) home-manager;
|
||||
inherit (self.nixosModules) system shell;
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user