Add deploy script

This commit is contained in:
Alex 2021-11-02 10:15:37 +01:00
parent dac37b918b
commit a02f90422e
6 changed files with 23 additions and 21 deletions

View file

@ -17,10 +17,20 @@
boot.loader.timeout = 20; boot.loader.timeout = 20;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
nix = {
binaryCaches = [
"http://binarycache.home.adnab.me"
];
binaryCachePublicKeys = [
"binarycache.home.adnab.me:ErR6pMnewf9oVyZJd5uC2nI4EZF49c7Mh86eDZWYZaw="
];
};
# The global useDHCP flag is deprecated, therefore explicitly set to false here. # The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config # Per-interface useDHCP will be mandatory in the future, so this generated config
# replicates the default behaviour. # replicates the default behaviour.
networking.useDHCP = false; networking.useDHCP = false;
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Set your time zone. # Set your time zone.
time.timeZone = "Europe/Paris"; time.timeZone = "Europe/Paris";

8
deploy.sh Executable file
View file

@ -0,0 +1,8 @@
#!/usr/bin/env bash
for NIXHOST in $(cat inventory); do
echo "==== DOING $NIXHOST ===="
cat configuration.nix | ssh root@$NIXHOST tee /etc/nixos/configuration.nix > /dev/null
cat node/$NIXHOST.nix | ssh root@$NIXHOST tee /etc/nixos/node.nix > /dev/null
ssh root@$NIXHOST nixos-rebuild switch
done

3
inventory Normal file
View file

@ -0,0 +1,3 @@
caribou
carcajou
cariacou

View file

@ -3,7 +3,7 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
networking.hostName = "carcajou"; # Define your hostname. networking.hostName = "carcajou";
networking.interfaces.eno1.useDHCP = false; networking.interfaces.eno1.useDHCP = false;
networking.interfaces.eno1.ipv4.addresses = [ networking.interfaces.eno1.ipv4.addresses = [
@ -12,13 +12,4 @@
prefixLength = 24; prefixLength = 24;
} }
]; ];
nix = {
binaryCaches = [
"http://binarycache.home.adnab.me"
];
binaryCachePublicKeys = [
"binarycache.home.adnab.me:ErR6pMnewf9oVyZJd5uC2nI4EZF49c7Mh86eDZWYZaw="
];
};
} }

View file

@ -3,7 +3,7 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
networking.hostName = "cariacou"; # Define your hostname. networking.hostName = "cariacou";
networking.interfaces.eno1.useDHCP = false; networking.interfaces.eno1.useDHCP = false;
networking.interfaces.eno1.ipv4.addresses = [ networking.interfaces.eno1.ipv4.addresses = [
@ -12,13 +12,4 @@
prefixLength = 24; prefixLength = 24;
} }
]; ];
nix = {
binaryCaches = [
"http://binarycache.home.adnab.me"
];
binaryCachePublicKeys = [
"binarycache.home.adnab.me:ErR6pMnewf9oVyZJd5uC2nI4EZF49c7Mh86eDZWYZaw="
];
};
} }

View file

@ -4,7 +4,6 @@
{ {
networking.hostName = "caribou"; # Define your hostname. networking.hostName = "caribou"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
networking.interfaces.eno1.useDHCP = false; networking.interfaces.eno1.useDHCP = false;
networking.interfaces.eno1.ipv4.addresses = [ networking.interfaces.eno1.ipv4.addresses = [