container
This commit is contained in:
parent
aedaaa3a05
commit
3d5b5ede46
@ -16,8 +16,7 @@ with lib;
|
||||
# busybox
|
||||
|
||||
# Other
|
||||
vim
|
||||
|
||||
vim git rsync
|
||||
];
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
|
36
packages/nixos-container.sh
Executable file
36
packages/nixos-container.sh
Executable file
@ -0,0 +1,36 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# Create the container.
|
||||
if ! nixos-container list | grep ^urchin$ > /dev/null; then
|
||||
sudo nixos-container create urchin
|
||||
fi
|
||||
|
||||
# Configure the container.
|
||||
sudo cp configuration.nix \
|
||||
/var/lib/containers/urchin/etc/nixos/configuration.nix
|
||||
nixos-container update urchin
|
||||
|
||||
# Create the git repository.
|
||||
host="tlevine@$(nixos-container show-ip urchin)"
|
||||
ssh "${host}" '
|
||||
if mkdir urchin 2> /dev/null; then
|
||||
cd urchin
|
||||
git init
|
||||
git config --add receive.denyCurrentBranch ignore
|
||||
fi
|
||||
'
|
||||
|
||||
# Push to the git repository
|
||||
git push "${host}":urchin
|
||||
|
||||
# Print information
|
||||
echo "Log in:
|
||||
|
||||
ssh ${host}
|
||||
|
||||
Add git remote
|
||||
|
||||
git remote add ${host} container
|
||||
|
||||
"
|
Loading…
Reference in New Issue
Block a user