diff options
author | Ryan Schanzenbacher <ryan@rschanz.org> | 2023-09-15 20:57:54 -0400 |
---|---|---|
committer | Ryan Schanzenbacher <ryan@rschanz.org> | 2023-09-15 20:57:54 -0400 |
commit | e2cc3f5f342c9ca80d83e35ce8aa6dc2ff9e468a (patch) | |
tree | f4a20b35cf67c8692a37a5e2b7ae4632b61dd328 /deploy.sh | |
parent | a3a44f9054c186ed519bd01bcf184094fa6aa139 (diff) |
test 1 for auto deploy
Diffstat (limited to 'deploy.sh')
-rwxr-xr-x | deploy.sh | 32 |
1 files changed, 11 insertions, 21 deletions
@@ -39,10 +39,10 @@ copy_and_prepare() { | |||
39 | # Copy template to root of repo | 39 | # Copy template to root of repo |
40 | if [ "$install_type" == "e" ] | 40 | if [ "$install_type" == "e" ] |
41 | then | 41 | then |
42 | cp ./modules/ryan-config/deploy-templates/HostTemplateEncrypted.scm ./$install_hostname.scm | 42 | cp ./modules/ryan-config/deploy-templates/HostTemplateEncrypted ./$install_hostname.scm |
43 | elif [ "$install_type" == "d" ] | 43 | elif [ "$install_type" == "d" ] |
44 | then | 44 | then |
45 | cp ./modules/ryan-config/deploy-templates/HostTemplate.scm ./$install_hostname.scm | 45 | cp ./modules/ryan-config/deploy-templates/HostTemplate ./$install_hostname.scm |
46 | else | 46 | else |
47 | echo "Invalid install type (not d or e), bailing!" | 47 | echo "Invalid install type (not d or e), bailing!" |
48 | exit 1 | 48 | exit 1 |
@@ -72,28 +72,15 @@ install_system() { | |||
72 | install_user_env() { | 72 | install_user_env() { |
73 | # System should be installed now, we can chroot in and configure the user profile now | 73 | # System should be installed now, we can chroot in and configure the user profile now |
74 | # NOTE: This assumes the user "ryan" for things, so change the USER var if you change your username | 74 | # NOTE: This assumes the user "ryan" for things, so change the USER var if you change your username |
75 | |||
76 | # Mount the special block devices to prepare for chroot | ||
77 | mount --rbind /proc /mnt/proc | ||
78 | mount --rbind /sys /mnt/sys | ||
79 | mount --rbind /dev /mnt/dev | ||
80 | |||
81 | # chroot into system and run commands | ||
82 | # First copy the file | ||
83 | cp ~/guix-dotfiles/$install_hostname /mnt/$install_hostname.scm | ||
84 | USER=ryan | ||
85 | chroot /mnt <<EOT | ||
86 | |||
87 | # Activate commands | ||
88 | source /var/guix/profiles/system/profile/etc/profile | ||
89 | /var/guix/profiles/system/activate | ||
90 | guix-daemon --build-users-group=guixbuild --disable-chroot & | ||
91 | 75 | ||
92 | guix shell git -- git clone https://git.stationery.faith/ryan77627/guix-dotfiles /home/$USER/.config/guix | 76 | # Copy some files over to prepare for reboot |
77 | USER=ryan | ||
78 | guix shell git -- git clone https://git.stationery.faith/ryan77627/guix-dotfiles /mnt/home/$USER/.config/guix | ||
93 | 79 | ||
94 | mv /$install_hostname.scm /home/$USER/.config/guix/$install_hostname.scm | 80 | cp ~/guix-dotfiles/$install_hostname.scm /mnt/home/$USER/.config/guix/$install_hostname.scm |
81 | cp ~/guix-dotfiles/modules/ryan-config/user_first_run.sh /mnt/home/$USER/.bashrc | ||
95 | 82 | ||
96 | EOT | 83 | chown 1000:1000 -R /mnt/home/ryan |
97 | 84 | ||
98 | } | 85 | } |
99 | 86 | ||
@@ -101,3 +88,6 @@ gather_env | |||
101 | copy_and_prepare | 88 | copy_and_prepare |
102 | install_system | 89 | install_system |
103 | install_user_env | 90 | install_user_env |
91 | |||
92 | # Reboot the machine at this point! | ||
93 | reboot | ||