From b0f78102c69b380c23f0fe54ac2b6710b8b0ffe6 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Tue, 9 May 2023 17:29:04 +0100 Subject: [PATCH] Makefile can clone repository to root user in NixOS --- Makefile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index e2e85885..b069f825 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ $(eval HOSTNAME=$(shell hostname)) -NIXOS_CONFIG := $(PWD)/$(HOSTNAME).nix +CONFIG_REPO := git@gitlab.com:elitherl/nixos.git HOMEMANAGER_CONFIG := $(PWD)/home/$(HOSTNAME)-$(USER).nix CONFIG_DIR := $(if $(XDG_CONFIG_HOME), $(XDG_CONFIG_HOME), $(HOME)/.config) BIN_DIR := $(HOME)/.local/bin @@ -20,11 +20,10 @@ clean: /nix: command -v nix > /dev/null && echo "Nix already installed" || ./scripts/installers/nix.sh --daemon -nixos: /etc/nixos/$(HOSTNAME).nix +/etc/nixos/config: + sudo git clone $(CONFIG_REPO) /etc/nixos/config -/etc/nixos/$(HOSTNAME).nix: /nix - [ -f $(NIXOS_CONFIG) ] || touch $(NIXOS_CONFIG) - sudo ln -s $(NIXOS_CONFIG) $@ +nixos: /etc/nixos/config home: $(HOMEMANAGER_CONFIG_DIR)/home.nix