refactor: my.home -> my.hm for disambiguilty (e.g. my.home.home)

This commit is contained in:
2025-10-03 22:17:04 +08:00
parent 1eaee50e82
commit faba8a05e6
44 changed files with 54 additions and 56 deletions

View File

@@ -15,7 +15,7 @@
systemd.services."systemd-machine-id-commit".enable = !config.my.persist.enable; systemd.services."systemd-machine-id-commit".enable = !config.my.persist.enable;
my = { my = {
home = { hm = {
# nicely reload system units when changing configs # nicely reload system units when changing configs
systemd.user.startServices = "sd-switch"; systemd.user.startServices = "sd-switch";
home.stateVersion = "24.11"; home.stateVersion = "24.11";

View File

@@ -1,6 +1,6 @@
{ lib, username, ... }: { lib, username, ... }:
{ {
my.home.programs.zsh.shellAliases = { my.hm.programs.zsh.shellAliases = {
localproxy_on = "export http_proxy=http://192.168.128.1:7890 https_proxy=http://192.168.128.1:7890 all_proxy=socks://192.168.128.1:7890"; localproxy_on = "export http_proxy=http://192.168.128.1:7890 https_proxy=http://192.168.128.1:7890 all_proxy=socks://192.168.128.1:7890";
}; };
my = { my = {

View File

@@ -4,7 +4,7 @@
... ...
}: }:
{ {
my.home = { my.hm = {
home.packages = with pkgs; [ home.packages = with pkgs; [
localsend localsend

View File

@@ -4,7 +4,7 @@
... ...
}: }:
{ {
my.home = { my.hm = {
home.packages = with pkgs; [ home.packages = with pkgs; [
localsend localsend

View File

@@ -193,7 +193,7 @@
recursive = true; recursive = true;
}) })
++ [ ++ [
(lib.mkAliasOptionModule [ "my" "home" ] [ "home-manager" "users" vars.username ]) (lib.mkAliasOptionModule [ "my" "hm" ] [ "home-manager" "users" vars.username ])
./config/base.nix ./config/base.nix
./config/hosts/${hostname} ./config/hosts/${hostname}
inputs.chaotic.nixosModules.default inputs.chaotic.nixosModules.default

View File

@@ -36,7 +36,7 @@
optionName = packageName; optionName = packageName;
config' = lib.mkMerge [ config' = lib.mkMerge [
{ {
my.home.home.packages = [ (lib.getAttrFromPath packagePath pkgs) ]; my.hm.home.packages = [ (lib.getAttrFromPath packagePath pkgs) ];
} }
extraConfig extraConfig
]; ];
@@ -55,7 +55,7 @@
config' = lib.mkMerge [ config' = lib.mkMerge [
{ {
my.home.programs = lib.setAttrByPath [ programName "enable" ] true; my.hm.programs = lib.setAttrByPath [ programName "enable" ] true;
} }
extraConfig extraConfig
]; ];

View File

@@ -21,6 +21,6 @@ lib.my.makeSwitch {
}; };
users.extraUsers.${username}.extraGroups = [ "audio" ]; users.extraUsers.${username}.extraGroups = [ "audio" ];
my.persist.homeDirs = [ ".local/state/wireplumber" ]; my.persist.homeDirs = [ ".local/state/wireplumber" ];
my.home.home.packages = [ pkgs.pwvucontrol ]; my.hm.home.packages = [ pkgs.pwvucontrol ];
}; };
} }

View File

@@ -15,7 +15,7 @@ lib.my.makeSwitch {
]; ];
config' = { config' = {
my = { my = {
home = { hm = {
home.packages = with pkgs; [ home.packages = with pkgs; [
playerctl playerctl
go-musicfox go-musicfox
@@ -23,7 +23,7 @@ lib.my.makeSwitch {
sops.secrets.go-musicfox = { sops.secrets.go-musicfox = {
sopsFile = secrets."go-musicfox.ini"; sopsFile = secrets."go-musicfox.ini";
format = "binary"; format = "binary";
path = "${config.my.home.xdg.configHome}/go-musicfox/go-musicfox.ini"; path = "${config.my.hm.xdg.configHome}/go-musicfox/go-musicfox.ini";
}; };
}; };

View File

@@ -13,7 +13,7 @@ lib.my.makeSwitch {
"mpd" "mpd"
]; ];
config' = { config' = {
my.home = { my.hm = {
home.packages = with pkgs.stable; [ home.packages = with pkgs.stable; [
mpd mpd
mpc-cli mpc-cli

View File

@@ -48,7 +48,7 @@ lib.my.makeSwitch {
programs.dconf.enable = true; programs.dconf.enable = true;
my.home = { my.hm = {
home.packages = with pkgs; [ home.packages = with pkgs; [
lsd lsd
fd fd

View File

@@ -14,7 +14,7 @@ lib.my.makeHomePackageConfig {
"btop" "btop"
]; ];
extraConfig = { extraConfig = {
my.home.xdg.configFile."btop" = { my.hm.xdg.configFile."btop" = {
source = ./config; source = ./config;
recursive = true; recursive = true;
}; };

View File

@@ -15,9 +15,9 @@ lib.my.makeSwitch {
]; ];
config' = { config' = {
my.persist.homeDirs = [ ".local/share/zoxide" ]; my.persist.homeDirs = [ ".local/share/zoxide" ];
my.home = my.hm =
let let
stateHome = config.my.home.xdg.stateHome; stateHome = config.my.hm.xdg.stateHome;
zsh-syntax-highlighting = pkgs.fetchFromGitHub { zsh-syntax-highlighting = pkgs.fetchFromGitHub {
owner = "zsh-users"; owner = "zsh-users";
repo = "zsh-syntax-highlighting"; repo = "zsh-syntax-highlighting";
@@ -78,7 +78,7 @@ lib.my.makeSwitch {
}; };
programs.zsh = { programs.zsh = {
enable = true; enable = true;
dotDir = "${config.my.home.xdg.configHome}/zsh"; dotDir = "${config.my.hm.xdg.configHome}/zsh";
history = { history = {
path = "${stateHome}/zsh_history"; path = "${stateHome}/zsh_history";
ignorePatterns = [ ignorePatterns = [

View File

@@ -16,7 +16,7 @@ lib.my.makeHomeProgramConfig {
"git" "git"
]; ];
extraConfig = { extraConfig = {
my.home = { my.hm = {
programs.git = { programs.git = {
userName = "${userfullname}"; userName = "${userfullname}";
userEmail = "${useremail}"; userEmail = "${useremail}";

View File

@@ -16,7 +16,7 @@ lib.my.makeHomeProgramConfig {
"jj" "jj"
]; ];
extraConfig = { extraConfig = {
my.home = { my.hm = {
programs.jujutsu = { programs.jujutsu = {
settings = { settings = {
user = { user = {

View File

@@ -13,7 +13,7 @@ lib.my.makeHomeProgramConfig {
"neovim" "neovim"
]; ];
extraConfig = { extraConfig = {
my.home = { my.hm = {
xdg.configFile."nvim/init.lua".source = ./nvim/init.lua; xdg.configFile."nvim/init.lua".source = ./nvim/init.lua;
xdg.configFile."nvim/lua" = { xdg.configFile."nvim/lua" = {
source = ./nvim/lua; source = ./nvim/lua;

View File

@@ -13,7 +13,7 @@ lib.my.makeHomeProgramConfig {
"vscode" "vscode"
]; ];
extraConfig = { extraConfig = {
my.home = { my.hm = {
programs.vscode = { programs.vscode = {
package = pkgs.vscodium; package = pkgs.vscodium;
}; };

View File

@@ -13,7 +13,7 @@ lib.my.makeSwitch {
"c" "c"
]; ];
config' = { config' = {
my.home.home.packages = with pkgs; [ my.hm.home.packages = with pkgs; [
gcc gcc
clang-tools clang-tools
cmake cmake

View File

@@ -14,7 +14,7 @@ lib.my.makeHomePackageConfig {
"go" "go"
]; ];
extraConfig = { extraConfig = {
my.home.home.packages = with pkgs; [ my.hm.home.packages = with pkgs; [
gotools gotools
gopls gopls
]; ];

View File

@@ -13,7 +13,7 @@ lib.my.makeSwitch {
"java" "java"
]; ];
config' = { config' = {
my.home.home.packages = with pkgs; [ my.hm.home.packages = with pkgs; [
openjdk24 openjdk24
java-language-server java-language-server
]; ];

View File

@@ -13,7 +13,7 @@ lib.my.makeSwitch {
"js" "js"
]; ];
config' = { config' = {
my.home = { my.hm = {
home.packages = with pkgs; [ home.packages = with pkgs; [
nodejs nodejs
typescript typescript

View File

@@ -13,7 +13,7 @@ lib.my.makeSwitch {
"lua" "lua"
]; ];
config' = { config' = {
my.home.home.packages = with pkgs; [ my.hm.home.packages = with pkgs; [
luajit luajit
stylua stylua
lua-language-server lua-language-server

View File

@@ -14,7 +14,7 @@ lib.my.makeHomePackageConfig {
"python" "python"
]; ];
extraConfig = { extraConfig = {
my.home.home.packages = with pkgs; [ my.hm.home.packages = with pkgs; [
uv uv
pyright pyright
]; ];

View File

@@ -13,7 +13,7 @@ lib.my.makeSwitch {
"qml" "qml"
]; ];
config' = { config' = {
my.home.home.packages = with pkgs; [ my.hm.home.packages = with pkgs; [
kdePackages.qtdeclarative kdePackages.qtdeclarative
]; ];
}; };

View File

@@ -13,7 +13,7 @@ lib.my.makeSwitch {
"rust" "rust"
]; ];
config' = { config' = {
my.home = { my.hm = {
home.packages = with pkgs; [ home.packages = with pkgs; [
(fenix.stable.withComponents [ (fenix.stable.withComponents [
"cargo" "cargo"

View File

@@ -12,7 +12,7 @@ lib.my.makeSwitch {
"misc" "misc"
]; ];
config' = { config' = {
my.home = { my.hm = {
home.packages = with pkgs; [ home.packages = with pkgs; [
gnumake gnumake
github-cli # gh github-cli # gh

View File

@@ -13,7 +13,7 @@ lib.my.makeHomeProgramConfig {
"chromium" "chromium"
]; ];
extraConfig = { extraConfig = {
my.home.programs.chromium = { my.hm.programs.chromium = {
package = pkgs.ungoogled-chromium; package = pkgs.ungoogled-chromium;
extensions = [ extensions = [
{ {

View File

@@ -13,7 +13,7 @@ lib.my.makeHomeProgramConfig {
"zen" "zen"
]; ];
extraConfig = { extraConfig = {
my.home.programs.zen-browser = { my.hm.programs.zen-browser = {
enable = true; enable = true;
nativeMessagingHosts = [ pkgs.firefoxpwa ]; nativeMessagingHosts = [ pkgs.firefoxpwa ];
policies = { policies = {

View File

@@ -13,7 +13,7 @@ lib.my.makeSwitch {
"minecraft" "minecraft"
]; ];
config' = { config' = {
my.home.home.packages = [ my.hm.home.packages = [
(pkgs.hmcl.overrideAttrs { (pkgs.hmcl.overrideAttrs {
postFixup = '' postFixup = ''
substituteInPlace $out/share/applications/HMCL.desktop --replace-fail 'Exec=hmcl' 'Exec=sh -c "cd ~/.local/share/hmcl; hmcl"' substituteInPlace $out/share/applications/HMCL.desktop --replace-fail 'Exec=hmcl' 'Exec=sh -c "cd ~/.local/share/hmcl; hmcl"'

View File

@@ -14,6 +14,6 @@ lib.my.makeHomePackageConfig {
"dunst" "dunst"
]; ];
extraConfig = { extraConfig = {
my.home.xdg.configFile."dunst/dunstrc".source = ./dunstrc; my.hm.xdg.configFile."dunst/dunstrc".source = ./dunstrc;
}; };
} }

View File

@@ -14,7 +14,7 @@ lib.my.makeHomePackageConfig {
"swaync" "swaync"
]; ];
extraConfig = { extraConfig = {
my.home = { my.hm = {
programs.niri.settings.binds."Mod+End".action.spawn = [ programs.niri.settings.binds."Mod+End".action.spawn = [
"swaync-client" "swaync-client"
"-t" "-t"

View File

@@ -13,7 +13,7 @@ lib.my.makeSwitch {
"obs-studio" "obs-studio"
]; ];
config' = { config' = {
my.home.home.packages = with pkgs; [ my.hm.home.packages = with pkgs; [
(pkgs.wrapOBS { (pkgs.wrapOBS {
plugins = with pkgs.obs-studio-plugins; [ plugins = with pkgs.obs-studio-plugins; [
wlrobs wlrobs

View File

@@ -25,7 +25,7 @@ lib.my.makeSwitch {
}; };
}; };
my.home = { my.hm = {
stylix = { stylix = {
enable = true; enable = true;
autoEnable = false; autoEnable = false;
@@ -52,7 +52,7 @@ lib.my.makeSwitch {
name = "Adwaita"; name = "Adwaita";
}; };
gtk2 = { gtk2 = {
configLocation = "${config.my.home.xdg.configHome}/gtk-2.0/gtkrc"; configLocation = "${config.my.hm.xdg.configHome}/gtk-2.0/gtkrc";
}; };
gtk3 = { gtk3 = {
theme = { theme = {

View File

@@ -8,7 +8,7 @@ lib.my.makeHomeProgramConfig {
"alacritty" "alacritty"
]; ];
extraConfig = { extraConfig = {
my.home.programs.alacritty.settings = { my.hm.programs.alacritty.settings = {
general.import = [ ./tokyonight-storm.toml ]; general.import = [ ./tokyonight-storm.toml ];
cursor.style = { cursor.style = {
shape = "Block"; shape = "Block";

View File

@@ -8,7 +8,7 @@ lib.my.makeHomeProgramConfig {
"foot" "foot"
]; ];
extraConfig = { extraConfig = {
my.home.programs.foot = { my.hm.programs.foot = {
server.enable = true; server.enable = true;
settings = { settings = {
main = { main = {

View File

@@ -8,7 +8,7 @@ lib.my.makeHomeProgramConfig {
"ghostty" "ghostty"
]; ];
extraConfig = { extraConfig = {
my.home.programs.ghostty = { my.hm.programs.ghostty = {
enableBashIntegration = true; enableBashIntegration = true;
enableZshIntegration = true; enableZshIntegration = true;
installBatSyntax = true; installBatSyntax = true;

View File

@@ -8,7 +8,7 @@ lib.my.makeHomeProgramConfig {
"kitty" "kitty"
]; ];
extraConfig = { extraConfig = {
my.home.programs.kitty = { my.hm.programs.kitty = {
settings = { settings = {
cursor_blink_interval = 0; cursor_blink_interval = 0;
remember_window_size = "no"; remember_window_size = "no";

View File

@@ -12,7 +12,7 @@ lib.my.makeSwitch {
"wine" "wine"
]; ];
config' = { config' = {
my.home.home.packages = with pkgs; [ my.hm.home.packages = with pkgs; [
wineWayland wineWayland
proton-ge-custom proton-ge-custom
bottles bottles

View File

@@ -6,7 +6,7 @@
}: }:
{ {
config = lib.mkIf config.my.desktop.wm.niri.enable { config = lib.mkIf config.my.desktop.wm.niri.enable {
my.home.programs.niri.settings = { my.hm.programs.niri.settings = {
input = { input = {
focus-follows-mouse = { focus-follows-mouse = {
enable = true; enable = true;
@@ -132,7 +132,7 @@
]; ];
binds = binds =
with config.my.home.lib.niri.actions; with config.my.hm.lib.niri.actions;
{ {
"Ctrl+Alt+T".action.spawn = [ "Ctrl+Alt+T".action.spawn = [
"kitty" "kitty"

View File

@@ -51,7 +51,7 @@ in
wayland.enable = true; wayland.enable = true;
}; };
}; };
my.home = { my.hm = {
home.packages = with pkgs; [ home.packages = with pkgs; [
xwayland-satellite-unstable xwayland-satellite-unstable

View File

@@ -194,7 +194,7 @@ lib.my.makeSwitch {
) )
) )
]; ];
my.home.programs.niri.settings = { my.hm.programs.niri.settings = {
binds."Mod+Space".action.spawn = [ binds."Mod+Space".action.spawn = [
"fcitx5-remote" "fcitx5-remote"
"-t" "-t"

View File

@@ -55,11 +55,11 @@ lib.my.makeSwitch {
group = "users"; group = "users";
mode = "0400"; mode = "0400";
}; };
my.home.nix.extraOptions = '' my.hm.nix.extraOptions = ''
!include ${config.sops.secrets.nix-github-token.path} !include ${config.sops.secrets.nix-github-token.path}
''; '';
my.home.home.packages = [ pkgs.nixd ]; my.hm.home.packages = [ pkgs.nixd ];
# uncomment to enable auto gc # uncomment to enable auto gc
/* /*

View File

@@ -23,7 +23,7 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
sops.age.sshKeyFile = cfg.sshKeyFile; sops.age.sshKeyFile = cfg.sshKeyFile;
users.users.${username}.extraGroups = [ "keys" ]; users.users.${username}.extraGroups = [ "keys" ];
my.home = { my.hm = {
sops.age.sshKeyFile = cfg.sshKeyFile; sops.age.sshKeyFile = cfg.sshKeyFile;
home.packages = [ home.packages = [
pkgs.sops pkgs.sops

View File

@@ -103,11 +103,9 @@ lib.my.makeSwitch {
username username
]; ];
my.home = { my.hm.home = {
home = { inherit username;
inherit username; homeDirectory = "/home/${username}";
homeDirectory = "/home/${username}";
};
}; };
}; };
} }

View File

@@ -21,9 +21,9 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
my.home = my.hm =
let let
homedir = config.my.home.home.homeDirectory; homedir = config.my.hm.home.homeDirectory;
in in
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [