feat(nix): use module options instead of specialArgs for graphical
This commit is contained in:
parent
dd74ed210c
commit
2c6cd776ce
2 changed files with 9 additions and 16 deletions
|
@ -6,6 +6,7 @@
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (lib) nixosSystem;
|
inherit (lib) nixosSystem;
|
||||||
|
inherit (lib.lists) optional;
|
||||||
inherit (lib.attrsets) mapAttrs;
|
inherit (lib.attrsets) mapAttrs;
|
||||||
inherit (cfg.lib.modules) forAllUsers';
|
inherit (cfg.lib.modules) forAllUsers';
|
||||||
cfg = config.flake;
|
cfg = config.flake;
|
||||||
|
@ -22,16 +23,13 @@ let
|
||||||
name: value:
|
name: value:
|
||||||
if class == "nixos" then
|
if class == "nixos" then
|
||||||
nixosSystem {
|
nixosSystem {
|
||||||
specialArgs = {
|
specialArgs.hostName = name;
|
||||||
inherit (value) graphical;
|
|
||||||
hostName = name;
|
|
||||||
};
|
|
||||||
modules = [
|
modules = [
|
||||||
cfg.modules.nixos.default
|
cfg.modules.nixos.default
|
||||||
inputs.home-manager.nixosModules.home-manager
|
inputs.home-manager.nixosModules.home-manager
|
||||||
{ home-manager = globalCfg; }
|
{ home-manager = globalCfg; }
|
||||||
(value.extraCfg or { })
|
(value.extraCfg or { })
|
||||||
];
|
] ++ optional value.graphical cfg.modules.nixos.graphical;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ }
|
{ }
|
||||||
|
|
|
@ -1,19 +1,14 @@
|
||||||
{ lib, ... }:
|
{ lib, ... }:
|
||||||
let
|
let
|
||||||
inherit (lib.modules) mkIf;
|
|
||||||
inherit (lib.options) mkEnableOption;
|
inherit (lib.options) mkEnableOption;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
flake.modules.nixos.default =
|
flake.modules.nixos.graphical = {
|
||||||
{ graphical, ... }:
|
|
||||||
{
|
|
||||||
config = mkIf graphical {
|
|
||||||
home-manager.sharedModules = [ { graphical = true; } ];
|
home-manager.sharedModules = [ { graphical = true; } ];
|
||||||
services.pipewire = {
|
services.pipewire = {
|
||||||
enable = true;
|
enable = true;
|
||||||
pulse.enable = true;
|
pulse.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
flake.modules.homeManager.default.options.graphical = mkEnableOption "";
|
flake.modules.homeManager.default.options.graphical = mkEnableOption "";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue