nixos/home/scripts/lua/sync-all.lua
Evie Litherland-Smith 763a1d2a05 Merge home-manager config back in to nixos config
Place home-manager config under home directory, move system config
under system directory.

Add hostname-specific entries under home directory to be consistent
with how system is configured, update flake accordingly
2024-07-03 07:15:39 +01:00

39 lines
1.1 KiB
Lua
Executable file

#!/usr/bin/env nix-shell
--[[
#!nix-shell -i lua -p git git-sync
]]
local config_home
if os.getenv("XDG_CONFIG_HOME") then
config_home = os.getenv("XDG_CONFIG_HOME")
else
config_home = "~/.config/"
end
local sync_mapping = {
["~/.password-store"] = "https://git.xenia.me.uk/pixelifytica/pass.git",
["~/.elfeed"] = "https://git.xenia.me.uk/pixelifytica/elfeed.git",
["~/Documents/Org"] = "https://git.xenia.me.uk/pixelifytica/org.git",
["~/Documents/References"] = "https://git.xenia.me.uk/pixelifytica/references.git",
}
local pull_mapping = {
["/etc/nixos"] = "https://git.xenia.me.uk/pixelifytica/nixos.git",
[config_home .. "/emacs"] = "https://git.xenia.me.uk/pixelifytica/emacs.git",
}
local function git_sync(directory, url)
print("--- sync: " .. directory .. " ---")
end
local function git_pull(directory, url, ff_only)
print("--- pull: " .. directory .. " ---")
end
for directory, url in pairs(sync_mapping) do
git_sync(directory, url)
end
for directory, url in pairs(pull_mapping) do
git_pull(directory, url, true)
end