Skip to content

Commit

Permalink
Finally merge hm standalone and module!
Browse files Browse the repository at this point in the history
  • Loading branch information
arunoruto committed Oct 14, 2024
1 parent 7d4bbd0 commit bc057b5
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 18 deletions.
21 changes: 14 additions & 7 deletions modules/home-manager/home.nix
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
{
osConfig,
pkgs,
lib,
# lib,
user,
...
}: {
imports = [
./hosts
./pc
./theming
# ./pc
# ./theming
./environment.nix
./imports.nix
./module.nix
];

pc.enable = lib.mkDefault osConfig.gui.enable;
theming.enable = lib.mkDefault osConfig.gui.enable;
# pc.enable =
# lib.mkDefault
# (
# if (args ? nixosConfig)
# then osConfig.gui.enable
# else false
# );
# theming.enable =
# if (args ? nixosConfig)
# then lib.mkDefault osConfig.gui.enable
# else false;
environment.enable = true;

# Allow unfree software
Expand Down
23 changes: 22 additions & 1 deletion modules/home-manager/imports.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
{...}: {
{
osConfig,
lib,
...
} @ args: {
imports = [
./media
./pc
./server
./theming
];

config = lib.mkIf (args ? nixosConfig) {
pc.enable = lib.mkDefault osConfig.gui.enable;

hostname = lib.mkDefault osConfig.networking.hostName;
keyboard = {
layout = lib.mkDefault osConfig.services.xserver.xkb.layout;
variant = lib.mkDefault osConfig.services.xserver.xkb.variant;
};
theming = {
enable = lib.mkDefault osConfig.gui.enable;
image = lib.mkDefault osConfig.theming.image;
scheme = lib.mkDefault osConfig.theming.scheme;
};
};
}
25 changes: 15 additions & 10 deletions modules/home-manager/module.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
{osConfig, ...}: {
args @ {
osConfig,
lib,
...
}: {
# imports = [
# ./standalone.nix
# ];

hostname = osConfig.networking.hostName;
keyboard = {
layout = osConfig.services.xserver.xkb.layout;
variant = osConfig.services.xserver.xkb.variant;
};
theming = {
image = osConfig.theming.image;
scheme = osConfig.theming.scheme;
config = lib.mkIf (args ? nixosConfig) {
hostname = osConfig.networking.hostName;
keyboard = {
layout = osConfig.services.xserver.xkb.layout;
variant = osConfig.services.xserver.xkb.variant;
};
theming = {
image = osConfig.theming.image;
scheme = osConfig.theming.scheme;
};
};
}

0 comments on commit bc057b5

Please sign in to comment.