From 8be2f7c698fc17a1e371ca4688381073bd17a06b Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Wed, 28 Jun 2023 23:53:07 -0500 Subject: [PATCH] Move to git --- overlays/inject.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/overlays/inject.nix b/overlays/inject.nix index ef5f358..6837e6f 100644 --- a/overlays/inject.nix +++ b/overlays/inject.nix @@ -1,4 +1,8 @@ -{ pkgs, ... }: +{ + pkgs, + git, + ... +}: pkgs.writeShellScriptBin "inject-nixos-config" '' hostname="''${1}" @@ -7,10 +11,9 @@ if [ -n "''${hostname}"]; then exit 1; fi -${pkgs.curl}/bin/curl -L -o "''${HOME}/nixos-config.tar.gz" https://github.com/greg-hellings/nixos-config/archive/refs/heads/main.tar.gz -${pkgs.gnutar}/bin/tar xaf "''${HOME}/nixos-config.tar.gz" -C "''${HOME}" mv /etc/nixos /etc/nixos.bk -mv "''${HOME}/nixos-config-main/" /etc/nixos +cd /etc +${git}/bin/git clone http://github.com/greg-hellings/nixos-config nixos mkdir -p "/etc/nixos/hosts/''${hostname}" # Prepares everything for the flake usage @@ -19,6 +22,7 @@ cp /etc/nixos.bk/hardware-configuration.nix "/etc/nixos/hosts/''${hostname}/hard # Prepares it for injecting the use case into the flake usage cp /etc/nixos.bk/hardware-configuration.nix /etc/nixos +chown -R greg nixos echo "Now you should be able to just run 'nixos-rebuild switch' to enable the flake functionality" echo "After that and adding the entry to the flake, run 'nixos-rebuild boot --flake '.#''${hostname}' and reboot"