Use rsync to move nixos config to /etc/nixos/config rather than cloning
Add rsync command to nixos and update sections of Makefile
This commit is contained in:
parent
1db5364696
commit
0699e44b60
4
.rsyncignore
Normal file
4
.rsyncignore
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
.git*
|
||||||
|
.pre-commit-config.yaml
|
||||||
|
.stylua.toml
|
||||||
|
Makefile
|
6
Makefile
6
Makefile
|
@ -1,5 +1,4 @@
|
||||||
$(eval HOSTNAME=$(shell hostname))
|
$(eval HOSTNAME=$(shell hostname))
|
||||||
NIXOS_REPO := https://git.xenia.me.uk/xenia/nixos.git
|
|
||||||
NVIM_REPO := https://git.xenia.me.uk/xenia/nvim.git
|
NVIM_REPO := https://git.xenia.me.uk/xenia/nvim.git
|
||||||
HYPR_REPO := https://git.xenia.me.uk/xenia/hyprland.git
|
HYPR_REPO := https://git.xenia.me.uk/xenia/hyprland.git
|
||||||
WAYBAR_REPO := https://git.xenia.me.uk/xenia/waybar.git
|
WAYBAR_REPO := https://git.xenia.me.uk/xenia/waybar.git
|
||||||
|
@ -8,7 +7,7 @@ CONFIG_DIR := $(if $(XDG_CONFIG_HOME), $(XDG_CONFIG_HOME), $(HOME)/.config)
|
||||||
BIN_DIR := $(HOME)/.local/bin
|
BIN_DIR := $(HOME)/.local/bin
|
||||||
HOMEMANAGER_CONFIG_DIR := $(CONFIG_DIR)/home-manager
|
HOMEMANAGER_CONFIG_DIR := $(CONFIG_DIR)/home-manager
|
||||||
|
|
||||||
.PHONY: default update clean nixos home nvim hypr waybar
|
.PHONY: default update clean nixos home nvim hypr waybar /etc/nixos/config
|
||||||
|
|
||||||
default: nvim hypr waybar
|
default: nvim hypr waybar
|
||||||
[ -e /etc/nixos/ ] && make nixos || make home
|
[ -e /etc/nixos/ ] && make nixos || make home
|
||||||
|
@ -18,6 +17,7 @@ update: $(CONFIG_DIR)/nvim $(CONFIG_DIR)/hypr $(CONFIG_DIR)/waybar
|
||||||
git -C $(CONFIG_DIR)/hypr remote set-url origin $(HYPR_REPO)
|
git -C $(CONFIG_DIR)/hypr remote set-url origin $(HYPR_REPO)
|
||||||
git -C $(CONFIG_DIR)/waybar remote set-url origin $(WAYBAR_REPO)
|
git -C $(CONFIG_DIR)/waybar remote set-url origin $(WAYBAR_REPO)
|
||||||
for repo in $?; do git -C $$repo pull --ff-only; done
|
for repo in $?; do git -C $$repo pull --ff-only; done
|
||||||
|
[ -e /etc/nixos/ ] && make /etc/nixos/config
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
[ -e $(HOMEMANAGER_CONFIG_DIR) ] && rm -rf $(HOMEMANAGER_CONFIG_DIR)
|
[ -e $(HOMEMANAGER_CONFIG_DIR) ] && rm -rf $(HOMEMANAGER_CONFIG_DIR)
|
||||||
|
@ -36,7 +36,7 @@ waybar: $(CONFIG_DIR)/waybar
|
||||||
command -v nix > /dev/null || echo "Install nix package manager before continuing"; exit 1
|
command -v nix > /dev/null || echo "Install nix package manager before continuing"; exit 1
|
||||||
|
|
||||||
/etc/nixos/config:
|
/etc/nixos/config:
|
||||||
sudo git clone $(NIXOS_REPO) $@
|
sudo rsync -avz --exclude-from=.rsyncignore --delete-during --delete-excluded ./ $@
|
||||||
|
|
||||||
$(HOMEMANAGER_CONFIG_DIR)/home.nix: $(HOMEMANAGER_CONFIG_DIR) /nix
|
$(HOMEMANAGER_CONFIG_DIR)/home.nix: $(HOMEMANAGER_CONFIG_DIR) /nix
|
||||||
[ -f $(HOMEMANAGER_CONFIG) ] || touch $(HOMEMANAGER_CONFIG)
|
[ -f $(HOMEMANAGER_CONFIG) ] || touch $(HOMEMANAGER_CONFIG)
|
||||||
|
|
Loading…
Reference in a new issue