Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dotfiles
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jens Nolte
dotfiles
Commits
195bc0e4
Commit
195bc0e4
authored
5 years ago
by
Jens Nolte
Browse files
Options
Downloads
Patches
Plain Diff
Fix install-mounted
parent
41c3a425
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/install-mounted
+17
-8
17 additions, 8 deletions
bin/install-mounted
with
17 additions
and
8 deletions
bin/install-mounted
+
17
−
8
View file @
195bc0e4
#!/usr/bin/env nix-shell
#!nix-shell
--pure
-i zsh -p zsh -p nix
#!nix-shell -i zsh -p zsh -p nix
set -e
set -u
set -o pipefail
source util.zsh
source
$DOTFILES_PATH/bin/lib/
util.zsh
cmdname=$(basename $0)
usage() {
print "Usage: $cmdname <via_host> <hostname>" >&2
}
if [
"$1" = "--help" -o "$1" = "-h"
]
if [
[ $# -ge 1 ]
]
then
usage
exit 0
if [ "$1" = "--help" -o "$1" = "-h" ]
then
usage
exit 0
fi
fi
if [ $# -ne 2 ]
...
...
@@ -26,17 +31,19 @@ fi
via_host="$1"
hostname="$2"
nixos_system_file=$MACHINES_PATH/nixos.nix
local_temp_dir=$(mktemp --tmpdir --directory install-via.XXXXXXXXXX)
trap "rm -rf $local_temp_dir" EXIT INT HUP TERM
print_info "Building target system configuration..."
nix build --file
../
nixos
.nix
--argstr hostname "$hostname" --out-link "$local_temp_dir/nixos-config-$hostname"
nix build --file
"$
nixos
_system_file"
--argstr hostname "$hostname" --out-link "$local_temp_dir/nixos-config-$hostname"
print_info "Deploying target system configuration..."
nix copy --file
../
nixos
.nix
--argstr hostname "$hostname" --to ssh://root@$via_host
nix copy --file
"$
nixos
_system_file"
--argstr hostname "$hostname" --to ssh://root@$via_host
nixos_config_path=$(realpath "$local_temp_dir/nixos-config-$hostname")
# TODO: merge commands
ssh root@$via_host "nixos-install --system $nixos_config_path && sync"
ssh root@$via_host mkdir --mode u=rwx,g=,o= --parents /mnt/secrets/passwords
...
...
@@ -44,4 +51,6 @@ ssh root@$via_host mkdir --mode u=rwx,g=,o= --parents /mnt/secrets/passwords
#scp -r notThePassword root@$via_host:/mnt/secrets/passwords/root
#scp -r notThePassword root@$via_host:/mnt/secrets/passwords/jens
ssh root@$via_host sync
print_info "Installation completed"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment