#!/usr/bin/make -f

PKG := debian/omarchy-nvim
CONFIG := $(PKG)/usr/share/omarchy-nvim/config
SKEL := $(PKG)/etc/skel/.config/nvim

%:
	dh $@

# The config upstream's PKGBUILD assembles: the LazyVim starter with Omarchy's lua/,
# plugin/ and lazyvim.json on top, under /usr/share for omarchy-nvim-refresh and in
# /etc/skel for new accounts. Upstream also bundles a lazy.nvim plugin cache it fills
# over the network at build time; OBS builds offline, so plugins download on first launch.
override_dh_auto_install:
	install -d $(CONFIG) $(dir $(SKEL))
	cp -a starter/.neoconf.json starter/init.lua starter/lua starter/stylua.toml $(CONFIG)/
	cp -a omarchy/lua omarchy/plugin omarchy/lazyvim.json $(CONFIG)/
	cp -a $(CONFIG) $(SKEL)
	install -m 0644 debian/theme.lua $(SKEL)/lua/plugins/theme.lua
	install -D -m 0755 omarchy/omarchy-nvim-setup $(PKG)/usr/bin/omarchy-nvim-setup
	ln -s omarchy-nvim-setup $(PKG)/usr/bin/omarchy-nvim-refresh
