1
0
Fork 0

clone and checkout dotfiles too

This commit is contained in:
Pratham Patel 2024-01-22 08:14:46 +05:30
parent a5bb104a91
commit b39931ce5f
Signed by: thefossguy
SSH Key Fingerprint: SHA256:/B3wAg7jnMEBQ2JwkebbS/eXVZANDmqRfnd9QkIhxMI
1 changed files with 7 additions and 4 deletions

11
iso.nix
View File

@ -58,24 +58,27 @@
};
# all this just because I don't want to clone my NixOS config repo
environment.etc."custom-scripts/nixos-config-clone.sh" = {
environment.etc."custom-scripts/setup-on-boot.sh" = {
text = ''
#!${pkgs.bash}/bin/bash
set -xeuf -o pipefail
${pkgs.git}/bin/git clone --bare https://gitlab.com/thefossguy/dotfiles.git $HOME/.dotfiles
${pkgs.git}/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME
${pkgs.git}/bin/git clone https://gitlab.com/thefossguy/prathams-nixos.git $HOME/prathams-nixos
'';
mode = "0777";
};
systemd.services = {
"nixos-config-clone" = {
"setup-on-boot" = {
serviceConfig = {
Type = "oneshot";
Environment = [ "PATH=\"${pkgs.openssl}/bin\"" ]; # just in case
ExecStart = "${pkgs.sudo}/bin/sudo -i -u nixos ${pkgs.bash}/bin/bash /etc/custom-scripts/nixos-config-clone.sh";
ExecStart = "${pkgs.sudo}/bin/sudo -i -u nixos ${pkgs.bash}/bin/bash /etc/custom-scripts/setup-on-boot.sh";
# ^^^^^ is the user in the ISO
};
requiredBy = [ "multi-user.target" ];
requiredBy = [ "multi-user.target" "getty.target" ];
wants = [ "network-online.target" "network.target" "nss-lookup.target" "nss-user-lookup.target" ];
after = [ "network-online.target" "network.target" "nss-lookup.target" "nss-user-lookup.target" ];
};