Skip to content

Commit

Permalink
Extract linux only home-manager config from shared files
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Oct 11, 2024
1 parent 47aaefe commit 555136f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 26 deletions.
21 changes: 0 additions & 21 deletions home-manager/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@
};
};

# This also changes xdg? Official manual sed this config is better for non NixOS Linux
# https://github.com/nix-community/home-manager/blob/559856748982588a9eda6bfb668450ebcf006ccd/modules/targets/generic-linux.nix#L16
targets.genericLinux.enable = pkgs.stdenv.isLinux;

# Let Home Manager install and manage itself.
programs.home-manager.enable = true;

Expand Down Expand Up @@ -124,27 +120,10 @@
# TODO: Automate that needs to call `Install-Module -Name PSFzfHistory` first
xdg.configFile."powershell/Microsoft.PowerShell_profile.ps1".source = ../config/powershell/Profile.ps1;

# https://github.com/NixOS/nixpkgs/issues/222925#issuecomment-1514112861
xdg.configFile."autostart/userdirs.desktop".text = ''
[Desktop Entry]
Exec=xdg-user-dirs-update
TryExec=xdg-user-dirs-update
NoDisplay=true
StartupNotify=false
Type=Application
X-KDE-AutostartScript=true
X-KDE-autostart-phase=1
'';

xdg.dataFile."tmpbin/.keep".text = "";

home.file.".hushlogin".text = "This file disables daily login message. Not depend on this text.";

# Should sync with the directory instead of each file. See https://github.com/nix-community/home-manager/issues/3090#issuecomment-1799268943
xdg.configFile.fcitx5 = {
source = ../config/fcitx5;
};

# https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/starship.nix
programs.starship = {
enable = true;
Expand Down
35 changes: 30 additions & 5 deletions home-manager/linux.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,39 @@
# https://github.com/nix-community/home-manager/issues/414#issuecomment-427163925
lib.mkMerge [
(lib.mkIf pkgs.stdenv.isLinux {
# This also changes xdg? Official manual sed this config is better for non NixOS Linux
# https://github.com/nix-community/home-manager/blob/559856748982588a9eda6bfb668450ebcf006ccd/modules/targets/generic-linux.nix#L16
targets.genericLinux.enable = true;

# xdg-user-dirs NixOS module does not work or is not enough for me to keep English dirs even in Japanese locale.
# Check your `~/.config/user-dirs.dirs` if you faced any trouble
# https://github.com/nix-community/home-manager/blob/release-24.05/modules/misc/xdg-user-dirs.nix
xdg.userDirs = {
enable = true;
createDirectories = true;
};
xdg = {
userDirs = {
enable = true;
createDirectories = true;
};

configFile = {
"hypr/hyprland.conf".source = ../config/hyprland/hyprland.conf;

xdg.configFile."hypr/hyprland.conf".source = ../config/hyprland/hyprland.conf;
# https://github.com/NixOS/nixpkgs/issues/222925#issuecomment-1514112861
"autostart/userdirs.desktop".text = ''
[Desktop Entry]
Exec=xdg-user-dirs-update
TryExec=xdg-user-dirs-update
NoDisplay=true
StartupNotify=false
Type=Application
X-KDE-AutostartScript=true
X-KDE-autostart-phase=1
'';

# Should sync with the directory instead of each file. See https://github.com/nix-community/home-manager/issues/3090#issuecomment-1799268943
fcitx5 = {
source = ../config/fcitx5;
};
};
};
})
]

0 comments on commit 555136f

Please sign in to comment.