1
0
Fork 0

clone my NixOS config repo on boot

This commit is contained in:
Pratham Patel 2024-01-21 12:38:29 +05:30
parent 0a5f9f4b61
commit 8109790c7e
Signed by: thefossguy
SSH Key Fingerprint: SHA256:/B3wAg7jnMEBQ2JwkebbS/eXVZANDmqRfnd9QkIhxMI
1 changed files with 21 additions and 0 deletions

21
iso.nix
View File

@ -40,4 +40,25 @@
tree
vim
];
# all this just because I don't want to clone my NixOS config repo
environment.etc."custom-scripts/clone-nixos-config.sh" = {
text = ''
#!${pkgs.bash}/bin/bash
set -xeuf -o pipefail
${pkgs.git}/bin/git clone https://gitlab.com/thefossguy/prathams-nixos.git $HOME/prathams-nixos
'';
mode = "0777";
};
systemd.services = {
"clone-nixos-config" = {
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/clone-nixos-config.sh";
# ^^^^^ is the user in the ISO
};
};
};
}