1
0
Fork 0

Compare commits

...

2 Commits

2 changed files with 2 additions and 28 deletions

28
iso.nix
View File

@ -53,33 +53,7 @@
TERM = "xterm-256color";
};
# all this just because I don't want to clone my NixOS config repo
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 checkout -f
${pkgs.coreutils}/bin/rm -rf $HOME/.config/nvim
${pkgs.git}/bin/git clone https://gitlab.com/thefossguy/prathams-nixos.git $HOME/prathams-nixos
'';
mode = "0777";
};
systemd.services = {
"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/setup-on-boot.sh";
# ^^^^^ is the user in the ISO
};
requiredBy = [ "getty-pre.target" "multi-user.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" ];
};
};
isoImage.squashfsCompression = "zstd -Xcompression-level 22";
# yes, I want docs
documentation = {

View File

@ -8,7 +8,7 @@ if [ "$(uname -s)" != 'Linux' ]; then
exit 1
fi
nom build .
time nom build .
for resultISO in $(basename result/iso/nixos-*-"$(uname -m)"-linux.iso); do
cp result/iso/"${resultISO}" .