NixOS + home-manager configs, mirrored from GitLab SaaS.
gitlab.com/andreijiroh-dev/nixops-config
nix-flake
nixos
home-manager
nixpkgs
nix-flakes
1#!/usr/bin/env bash
2# This is a utility wrapper script around nixos-rebuild, intended for use within the root directory of the repository
3# as a local copy/clone. Might implement remote setups soon
4# SPDX-License-Identifier: MPL-2.0
5
6set -xe
7HOSTNAME=$(hostname)
8NIXOS_HOSTNAME=${2:-"$HOSTNAME"}
9SUDO=${SUDO:"sudo"}
10
11if [[ $EUID != "0" ]]; then
12 echo "Run me as root user again in order to deploy config changes."
13 exit 1
14fi
15
16if [[ $1 == "switch" ]]; then
17 nixos-rebuild --verbose --show-trace --flake ".#${NIXOS_HOSTNAME}" switch
18elif [[ $1 == "boot" ]]; then
19 nixos-rebuild --verbose --show-trace --flake ".#${NIXOS_HOSTNAME}" boot
20else
21 echo "Unsupport command for this deployment wrapper"
22 echo "Usage: $0 <switch|boot> [hostname]"
23 exit 1
24fi