1
1
Fork 0

nix: use xdg.configFile instead of home.file where possible

Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
Myned 2024-11-17 17:27:14 -06:00
parent 7f34e497a2
commit dd791f454e
Signed by: myned
GPG key ID: C7224454F7881A34
21 changed files with 98 additions and 69 deletions

View file

@ -14,7 +14,7 @@ in {
# https://github.com/firecat53/bitwarden-menu # https://github.com/firecat53/bitwarden-menu
#!! Options not available, files written directly #!! Options not available, files written directly
# https://github.com/firecat53/bitwarden-menu/blob/main/docs/configure.md # https://github.com/firecat53/bitwarden-menu/blob/main/docs/configure.md
home.file.".config/bwm/config.ini".text = '' xdg.configFile."bwm/config.ini".text = ''
[dmenu] [dmenu]
dmenu_command = ${wofi} --dmenu dmenu_command = ${wofi} --dmenu

View file

@ -19,7 +19,7 @@ in {
home-manager.users.${config.custom.username} = mkIf cfg.enable { home-manager.users.${config.custom.username} = mkIf cfg.enable {
# https://github.com/savedra1/clipse?tab=readme-ov-file#configuration # https://github.com/savedra1/clipse?tab=readme-ov-file#configuration
home.file.".config/clipse/config.json".text = '' xdg.configFile."clipse/config.json".text = ''
{ {
"historyFile": "clipboard_history.json", "historyFile": "clipboard_history.json",
"maxHistory": 50, "maxHistory": 50,

View file

@ -9,8 +9,9 @@ in {
options.custom.programs.discord.enable = mkOption {default = false;}; options.custom.programs.discord.enable = mkOption {default = false;};
config.home-manager.users.myned = mkIf cfg.enable { config.home-manager.users.myned = mkIf cfg.enable {
home.file.".config/BetterDiscord".source = xdg.configFile."BetterDiscord" = {
config.home-manager.users.${config.custom.username}.lib.file.mkOutOfStoreSymlink force = true;
"/home/${config.custom.username}/SYNC/common/config/discord/BetterDiscord"; source = config.home-manager.users.${config.custom.username}.lib.file.mkOutOfStoreSymlink "${config.custom.sync}/common/config/discord/BetterDiscord";
};
}; };
} }

View file

@ -11,7 +11,7 @@ in {
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# Element Desktop custom themes # Element Desktop custom themes
# https://github.com/aaronraimist/element-themes # https://github.com/aaronraimist/element-themes
home.file.".config/Element/config.json".text = '' xdg.configFile."Element/config.json".text = ''
{ {
"show_labs_settings": true, "show_labs_settings": true,
"setting_defaults": { "setting_defaults": {

View file

@ -30,7 +30,7 @@ in {
# https://github.com/fastfetch-cli/fastfetch # https://github.com/fastfetch-cli/fastfetch
#!! Option not available, files written directly #!! Option not available, files written directly
home-manager.users.${config.custom.username}.home.file.".config/fastfetch/config.jsonc".text = '' home-manager.users.${config.custom.username}.xdg.configFile."fastfetch/config.jsonc".text = ''
{ {
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": { "logo": {

View file

@ -17,8 +17,11 @@ in {
environment.systemPackages = [cfg.package]; environment.systemPackages = [cfg.package];
#!! Options not available, files synced #!! Options not available, files synced
home-manager.users.${config.custom.username}.home.file.".config/libreoffice/4/user".source = home-manager.users.${config.custom.username} = {
config.home-manager.users.${config.custom.username}.lib.file.mkOutOfStoreSymlink xdg.configFile.".config/libreoffice/4/user" = {
"/home/${config.custom.username}/SYNC/linux/config/libreoffice/user"; force = true;
source = config.home-manager.users.${config.custom.username}.lib.file.mkOutOfStoreSymlink "${config.custom.sync}/linux/config/libreoffice/user";
};
};
}; };
} }

View file

@ -10,8 +10,9 @@ in {
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
#!! Synced imperative configuration #!! Synced imperative configuration
home.file.".logseq/".source = home.file.".logseq/" = {
config.home-manager.users.${config.custom.username}.lib.file.mkOutOfStoreSymlink force = true;
"/home/${config.custom.username}/SYNC/common/config/logseq/"; source = config.home-manager.users.${config.custom.username}.lib.file.mkOutOfStoreSymlink "${config.custom.sync}/common/config/logseq/";
};
}; };
} }

View file

@ -15,7 +15,7 @@ in {
# https://github.com/firecat53/networkmanager-dmenu/blob/main/config.ini.example # https://github.com/firecat53/networkmanager-dmenu/blob/main/config.ini.example
#!! Option not available, files written directly #!! Option not available, files written directly
# FIXME: active_chars does not take effect # FIXME: active_chars does not take effect
home.file.".config/networkmanager-dmenu/config.ini".text = '' xdg.configFile."networkmanager-dmenu/config.ini".text = ''
[dmenu] [dmenu]
dmenu_command = ${menu} --input dmenu_command = ${menu} --input
active_chars = > active_chars = >

View file

@ -12,7 +12,7 @@ in {
# https://github.com/Syllo/nvtop # https://github.com/Syllo/nvtop
#!! Options not available, config written directly #!! Options not available, config written directly
#?? Imperative config generated by F12 #?? Imperative config generated by F12
home.file.".config/nvtop/interface.ini".text = '' xdg.configFile."nvtop/interface.ini".text = ''
[GeneralOption] [GeneralOption]
UseColor = true UseColor = true
UpdateInterval = 3000 UpdateInterval = 3000

View file

@ -15,14 +15,14 @@ in {
#?? systemctl --user enable --now onedrive@onedrive.service #?? systemctl --user enable --now onedrive@onedrive.service
#!! Option not available, files written directly #!! Option not available, files written directly
home.file = { xdg.configFile = {
# https://github.com/abraunegg/onedrive/blob/master/docs/USAGE.md#configuration # https://github.com/abraunegg/onedrive/blob/master/docs/USAGE.md#configuration
".config/onedrive/config".text = '' "onedrive/config".text = ''
sync_dir = "~/SYNC/edu/hawkeye" sync_dir = "~/SYNC/edu/hawkeye"
''; '';
# https://github.com/abraunegg/onedrive/blob/master/docs/USAGE.md#performing-a-selective-sync-via-sync_list-file # https://github.com/abraunegg/onedrive/blob/master/docs/USAGE.md#performing-a-selective-sync-via-sync_list-file
".config/onedrive/sync_list".text = '' "onedrive/sync_list".text = ''
!/Apps/ !/Apps/
!/Attachments/ !/Attachments/
/* /*

View file

@ -11,7 +11,10 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
home-manager.users.${config.custom.username} = { home-manager.users.${config.custom.username} = {
#!! Imperative configuration #!! Imperative configuration
home.file.".config/remmina/remmina.pref".source = config.home-manager.users.${config.custom.username}.lib.file.mkOutOfStoreSymlink "${config.custom.sync}/linux/config/remmina/remmina.pref"; xdg.configFile."remmina/remmina.pref" = {
force = true;
source = config.home-manager.users.${config.custom.username}.lib.file.mkOutOfStoreSymlink "${config.custom.sync}/linux/config/remmina/remmina.pref";
};
}; };
}; };
} }

View file

@ -14,7 +14,7 @@ in {
# https://github.com/fdw/rofi-rbw?tab=readme-ov-file#configuration # https://github.com/fdw/rofi-rbw?tab=readme-ov-file#configuration
# TODO: Enable input emulation when merged (uinput.enable?) # TODO: Enable input emulation when merged (uinput.enable?)
# https://github.com/NixOS/nixpkgs/pull/303745 # https://github.com/NixOS/nixpkgs/pull/303745
home.file.".config/rofi-rbw.rc".text = '' xdg.configFile."rofi-rbw.rc".text = ''
action=copy action=copy
''; '';
}; };

View file

@ -77,7 +77,6 @@ in {
accounts.email.accounts.${config.custom.username}.thunderbird.enable = true; accounts.email.accounts.${config.custom.username}.thunderbird.enable = true;
# https://github.com/rafaelmardojai/thunderbird-gnome-theme # https://github.com/rafaelmardojai/thunderbird-gnome-theme
home.file.".thunderbird/default/chrome/thunderbird-gnome-theme".source = home.file.".thunderbird/default/chrome/thunderbird-gnome-theme".source = inputs.thunderbird-gnome-theme;
inputs.thunderbird-gnome-theme;
}; };
} }

View file

@ -15,7 +15,7 @@ in {
# https://github.com/tio/tio # https://github.com/tio/tio
#!! Options not available, files written directly #!! Options not available, files written directly
home-manager.users.${config.custom.username}.home.file.".config/tio/config".text = '' home-manager.users.${config.custom.username}.xdg.configFile."tio/config".text = ''
baudrate = 9600 baudrate = 9600
''; '';
}; };

View file

@ -81,23 +81,39 @@ in {
]); ]);
}; };
xdg.configFile = with config.home-manager.users.${config.custom.username}.lib.file; {
# Imperative symlinks intended to be synced
"VSCodium/User/settings.json" = {
force = true;
source = mkOutOfStoreSymlink "${config.custom.sync}/dev/config/vscode/settings.json";
};
"VSCodium/User/keybindings.json" = {
force = true;
source = mkOutOfStoreSymlink "${config.custom.sync}/dev/config/vscode/keybindings.json";
};
"VSCodium/User/snippets/" = {
force = true;
source = mkOutOfStoreSymlink "${config.custom.sync}/dev/config/vscode/snippets/";
};
"VSCodium/User/profiles/" = {
force = true;
source = mkOutOfStoreSymlink "${config.custom.sync}/dev/config/vscode/profiles/";
};
};
home = { home = {
# https://github.com/nix-community/nixd/blob/main/nixd/docs/features.md # https://github.com/nix-community/nixd/blob/main/nixd/docs/features.md
sessionVariables.NIXD_FLAGS = "--inlay-hints=false"; # Disable package versions in the editor sessionVariables.NIXD_FLAGS = "--inlay-hints=false"; # Disable package versions in the editor
file = with config.home-manager.users.${config.custom.username}.lib.file; {
# Imperative symlinks intended to be synced
".config/VSCodium/User/settings.json".source = mkOutOfStoreSymlink "/home/${config.custom.username}/SYNC/dev/config/vscode/settings.json";
".config/VSCodium/User/keybindings.json".source = mkOutOfStoreSymlink "/home/${config.custom.username}/SYNC/dev/config/vscode/keybindings.json";
".config/VSCodium/User/snippets/".source = mkOutOfStoreSymlink "/home/${config.custom.username}/SYNC/dev/config/vscode/snippets/";
".config/VSCodium/User/profiles/".source = mkOutOfStoreSymlink "/home/${config.custom.username}/SYNC/dev/config/vscode/profiles/";
# Work around wrong wmclass # Work around wrong wmclass
# https://github.com/microsoft/vscode/issues/129953 # https://github.com/microsoft/vscode/issues/129953
# https://github.com/VSCodium/vscodium/issues/1414 # https://github.com/VSCodium/vscodium/issues/1414
#!! Keep updated with upstream desktop file #!! Keep updated with upstream desktop file
#?? cat /etc/profiles/per-user/USER/share/applications/codium.desktop #?? cat /etc/profiles/per-user/USER/share/applications/codium.desktop
# ".local/share/applications/codium.desktop".text = '' # file.".local/share/applications/codium.desktop".text = ''
# [Desktop Entry] # [Desktop Entry]
# Actions=new-empty-window # Actions=new-empty-window
# Categories=Utility;TextEditor;Development;IDE # Categories=Utility;TextEditor;Development;IDE
@ -120,5 +136,4 @@ in {
# ''; # '';
}; };
}; };
};
} }

View file

@ -357,9 +357,9 @@ in {
#?? text #?? text
#?? tooltip #?? tooltip
#?? class #?? class
home.file = { xdg.configFile = {
# Return inhibit idle status # Return inhibit idle status
".config/waybar/scripts/inhibitor.sh" = { "waybar/scripts/inhibitor.sh" = {
executable = true; executable = true;
text = '' text = ''
#! /usr/bin/env ${bash} #! /usr/bin/env ${bash}
@ -377,7 +377,7 @@ in {
}; };
# Return tailscale status # Return tailscale status
".config/waybar/scripts/vm.sh" = { "waybar/scripts/vm.sh" = {
executable = true; executable = true;
text = '' text = ''
#! /usr/bin/env ${bash} #! /usr/bin/env ${bash}
@ -404,7 +404,7 @@ in {
}; };
# Return tailscale status # Return tailscale status
".config/waybar/scripts/vpn.sh" = { "waybar/scripts/vpn.sh" = {
executable = true; executable = true;
text = '' text = ''
#! /usr/bin/env ${bash} #! /usr/bin/env ${bash}

View file

@ -17,8 +17,8 @@ in {
services.clipcat.enable = true; services.clipcat.enable = true;
# https://github.com/xrelkd/clipcat?tab=readme-ov-file#configuration # https://github.com/xrelkd/clipcat?tab=readme-ov-file#configuration
home-manager.users.${config.custom.username}.home.file = { home-manager.users.${config.custom.username}.xdg.configFile = {
".config/clipcat/clipcatd.toml".text = '' "clipcat/clipcatd.toml".text = ''
daemonize = false daemonize = false
max_history = 100 max_history = 100
@ -30,7 +30,7 @@ in {
enable_http = false enable_http = false
''; '';
".config/clipcat/clipcat-menu.toml".text = '' "clipcat/clipcat-menu.toml".text = ''
finder = "custom_finder" finder = "custom_finder"
[custom_finder] [custom_finder]

View file

@ -15,9 +15,16 @@ in {
### PRESETS ### ### PRESETS ###
# https://github.com/Digitalone1/EasyEffects-Presets # https://github.com/Digitalone1/EasyEffects-Presets
home.file = with config.home-manager.users.${config.custom.username}.lib.file; { xdg.configFile = with config.home-manager.users.${config.custom.username}.lib.file; {
".config/easyeffects/input".source = mkOutOfStoreSymlink "/home/${config.custom.username}/SYNC/linux/config/easyeffects/input"; "easyeffects/input" = {
".config/easyeffects/output".source = mkOutOfStoreSymlink "/home/${config.custom.username}/SYNC/linux/config/easyeffects/output"; force = true;
source = mkOutOfStoreSymlink "${config.custom.sync}/linux/config/easyeffects/input";
};
"easyeffects/output" = {
force = true;
source = mkOutOfStoreSymlink "${config.custom.sync}/linux/config/easyeffects/output";
};
}; };
}; };
} }

View file

@ -24,7 +24,7 @@ in {
# https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html # https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html
settings = { settings = {
Public.path = "/home/${config.custom.username}/Public"; Public.path = "/home/${config.custom.username}/Public";
SYNC.path = "/home/${config.custom.username}/SYNC"; SYNC.path = config.custom.sync;
global = { global = {
"allow insecure wide links" = "yes"; "allow insecure wide links" = "yes";

View file

@ -15,6 +15,6 @@ in {
### THEME ### ### THEME ###
# https://github.com/ErikReider/SwayOSD/blob/main/data/style/style.scss # https://github.com/ErikReider/SwayOSD/blob/main/data/style/style.scss
#!! Options not yet available, files written directly #!! Options not yet available, files written directly
home.file.".config/swayosd/style.css".text = ''''; xdg.configFile."swayosd/style.css".text = '''';
}; };
} }

View file

@ -137,7 +137,7 @@ in {
userDirs = { userDirs = {
enable = true; enable = true;
createDirectories = true; createDirectories = true;
templates = "/home/${config.custom.username}/SYNC/linux/config/templates"; templates = "${config.custom.sync}/linux/config/templates";
extraConfig = { extraConfig = {
XDG_SCREENSHOTS_DIR = "${config.home-manager.users.${config.custom.username}.xdg.userDirs.pictures}/Screenshots"; XDG_SCREENSHOTS_DIR = "${config.home-manager.users.${config.custom.username}.xdg.userDirs.pictures}/Screenshots";