refactor(hmModules): moved home-manager to module
This commit is contained in:
parent
0b393ab562
commit
cb42df54ec
4 changed files with 36 additions and 22 deletions
|
@ -1,20 +1,5 @@
|
||||||
|
{ config, ... }:
|
||||||
{
|
{
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
specialArgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
inputs.home-manager.nixosModules.home-manager
|
|
||||||
];
|
|
||||||
|
|
||||||
home-manager = {
|
|
||||||
useGlobalPkgs = true;
|
|
||||||
useUserPackages = true;
|
|
||||||
extraSpecialArgs = specialArgs;
|
|
||||||
};
|
|
||||||
|
|
||||||
time.timeZone = "Asia/Singapore";
|
time.timeZone = "Asia/Singapore";
|
||||||
i18n.defaultLocale = "en_SG.UTF-8";
|
i18n.defaultLocale = "en_SG.UTF-8";
|
||||||
|
|
||||||
|
@ -42,10 +27,4 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager.users.rafiq.home = {
|
|
||||||
username = "rafiq";
|
|
||||||
homeDirectory = "/home/rafiq";
|
|
||||||
stateVersion = "25.05";
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
specialArgs = args;
|
specialArgs = args;
|
||||||
modules = [
|
modules = [
|
||||||
./modules/nixos
|
./modules/nixos
|
||||||
|
./modules/hm
|
||||||
./hosts/common.nix
|
./hosts/common.nix
|
||||||
./hosts/${hostname}.nix
|
./hosts/${hostname}.nix
|
||||||
];
|
];
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
../configs/graphical.nix
|
../configs/graphical.nix
|
||||||
];
|
];
|
||||||
nixosModules.enable = true;
|
nixosModules.enable = true;
|
||||||
|
hmModules.enable = true;
|
||||||
nix-config.enable = true;
|
nix-config.enable = true;
|
||||||
boot-config.enable = true;
|
boot-config.enable = true;
|
||||||
hardware-config.usbAutoMount = true;
|
hardware-config.usbAutoMount = true;
|
||||||
|
|
33
modules/hm/default.nix
Normal file
33
modules/hm/default.nix
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
{
|
||||||
|
inputs,
|
||||||
|
config,
|
||||||
|
specialArgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
moduleName = "hmModules";
|
||||||
|
cfg = config."${moduleName}";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [ inputs.home-manager.nixosModules.home-manager ];
|
||||||
|
|
||||||
|
options = {
|
||||||
|
"${moduleName}" = {
|
||||||
|
enable = lib.mkEnableOption "Enable ${moduleName}.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
home-manager = {
|
||||||
|
useGlobalPkgs = true;
|
||||||
|
useUserPackages = true;
|
||||||
|
extraSpecialArgs = specialArgs;
|
||||||
|
users.rafiq.home = {
|
||||||
|
username = "rafiq";
|
||||||
|
homeDirectory = "/home/rafiq";
|
||||||
|
stateVersion = "25.05";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue