diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2020-12-26 17:06:41 +0100 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2020-12-26 17:06:41 +0100 |
commit | 223186ddd425927b5af99306b40be6ef582047ae (patch) | |
tree | 4476fe08bdda239ef38d23962a906909e719e075 /install | |
download | recover-223186ddd425927b5af99306b40be6ef582047ae.tar.gz recover-223186ddd425927b5af99306b40be6ef582047ae.zip |
Init
Diffstat (limited to 'install')
-rwxr-xr-x | install | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/install b/install new file mode 100755 index 0000000..c2ec485 --- /dev/null +++ b/install @@ -0,0 +1,28 @@ +#!/bin/sh +## Script for installing my nixos config. NixOS pretty much automates all the +## process, but still you need to pass config url and rest of the commands, and +## if it's tideous work after setting up all the disk partitions. So I made +## this script to make less typing +## +## Usage: ./install {$machine} +## this will install config from dots/machines/$machine + +set -eou pipefail + +[ "$UID" != "0" ] && echo "Run this as root!" && exit 1 + +mkdir -p /etc/nixos/dots + +which nix && nix run nixos.git -c git clone https://github.com/pniedzwiedzinski/dots /etc/nixos/dots + +[ -z "$1" ] || cat << EOF > /etc/nixos/configuration.nix +{ + imports = [ + ./dots/machines/$1 + ]; + + system.stateVersion = "20.09"; +} +EOF + +nixos-rebuild switch |