aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-11-02 10:15:37 +0100
committerAlex Auvolat <alex@adnab.me>2021-11-02 10:15:37 +0100
commita02f90422e1e9594f47dd4a694b1cbb55bd70e54 (patch)
tree6bd94dd4889bd66a2f2baf0d78e574263762094e
parentdac37b918bbf427a8f499c82ebb464c57ead6478 (diff)
downloadnixcfg-a02f90422e1e9594f47dd4a694b1cbb55bd70e54.tar.gz
nixcfg-a02f90422e1e9594f47dd4a694b1cbb55bd70e54.zip
Add deploy script
-rw-r--r--configuration.nix10
-rwxr-xr-xdeploy.sh8
-rw-r--r--inventory3
-rw-r--r--node/carcajou.nix11
-rw-r--r--node/cariacou.nix11
-rw-r--r--node/caribou.nix1
6 files changed, 23 insertions, 21 deletions
diff --git a/configuration.nix b/configuration.nix
index d500108..e47cdbf 100644
--- a/configuration.nix
+++ b/configuration.nix
@@ -17,10 +17,20 @@
boot.loader.timeout = 20;
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.
# Per-interface useDHCP will be mandatory in the future, so this generated config
# replicates the default behaviour.
networking.useDHCP = false;
+ # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Set your time zone.
time.timeZone = "Europe/Paris";
diff --git a/deploy.sh b/deploy.sh
new file mode 100755
index 0000000..a9a9261
--- /dev/null
+++ b/deploy.sh
@@ -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
diff --git a/inventory b/inventory
new file mode 100644
index 0000000..2a207b8
--- /dev/null
+++ b/inventory
@@ -0,0 +1,3 @@
+caribou
+carcajou
+cariacou
diff --git a/node/carcajou.nix b/node/carcajou.nix
index ae6b488..a9f64c2 100644
--- a/node/carcajou.nix
+++ b/node/carcajou.nix
@@ -3,7 +3,7 @@
{ config, pkgs, ... }:
{
- networking.hostName = "carcajou"; # Define your hostname.
+ networking.hostName = "carcajou";
networking.interfaces.eno1.useDHCP = false;
networking.interfaces.eno1.ipv4.addresses = [
@@ -12,13 +12,4 @@
prefixLength = 24;
}
];
-
- nix = {
- binaryCaches = [
- "http://binarycache.home.adnab.me"
- ];
- binaryCachePublicKeys = [
- "binarycache.home.adnab.me:ErR6pMnewf9oVyZJd5uC2nI4EZF49c7Mh86eDZWYZaw="
- ];
- };
}
diff --git a/node/cariacou.nix b/node/cariacou.nix
index 5ed6154..c94d2b8 100644
--- a/node/cariacou.nix
+++ b/node/cariacou.nix
@@ -3,7 +3,7 @@
{ config, pkgs, ... }:
{
- networking.hostName = "cariacou"; # Define your hostname.
+ networking.hostName = "cariacou";
networking.interfaces.eno1.useDHCP = false;
networking.interfaces.eno1.ipv4.addresses = [
@@ -12,13 +12,4 @@
prefixLength = 24;
}
];
-
- nix = {
- binaryCaches = [
- "http://binarycache.home.adnab.me"
- ];
- binaryCachePublicKeys = [
- "binarycache.home.adnab.me:ErR6pMnewf9oVyZJd5uC2nI4EZF49c7Mh86eDZWYZaw="
- ];
- };
}
diff --git a/node/caribou.nix b/node/caribou.nix
index 95b0d52..1ffdaf1 100644
--- a/node/caribou.nix
+++ b/node/caribou.nix
@@ -4,7 +4,6 @@
{
networking.hostName = "caribou"; # Define your hostname.
- # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
networking.interfaces.eno1.useDHCP = false;
networking.interfaces.eno1.ipv4.addresses = [