nixos/system/home/scripts/lua/sync-all.lua
Evie Litherland-Smith 5ff572a9b7 Major rewrite/refactor to simplify things
Move home/ directory under system/ directory. Remove duplicated
machine-specific config files, now handled as one per host (excluding
hardware-configuration directory)

Move as much configuration as possible out of flake.nix and into more
appropriate files (e.g. system/default.nix)

Add a desktop.nix and laptop.nix for system, both will import
home/desktop.nix and home/laptop.nix respectively to reduce
duplication in machine-specific config files

Remove games and streaming directories, moved directly into Vanguard
config file

Remove home/personal.nix since it ended up being empty after changes

Remove old sway config since I haven't been maintaining it and this
refactor will definitely break it
2024-08-30 12:57:02 +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