Added environment variables in nodes to make deploy_nix.sh target the correct node file, changed deploy_nix.sh accordingly
This commit is contained in:
parent
59a46d1968
commit
8799736e7f
4 changed files with 30 additions and 5 deletions
|
|
@ -1,10 +1,19 @@
|
|||
{ config, lib, pkgs, ...}:
|
||||
|
||||
{
|
||||
# Defining hostname
|
||||
|
||||
networking.hostName = "fifi";
|
||||
|
||||
|
||||
# Configuration du Wifi et configuration IP fixe (hors du range DHCP: 50-200)
|
||||
# Setting up environment variables
|
||||
|
||||
environment.sessionVariables = rec {
|
||||
NODE = "fifi";
|
||||
};
|
||||
|
||||
|
||||
# Setting up wifi networking and static ip (out of DHCP range 50-200)
|
||||
|
||||
networking.wireless.enable = true;
|
||||
networking.wireless.networks = {
|
||||
|
|
@ -23,8 +32,9 @@
|
|||
networking.defaultGateway = "192.168.1.1";
|
||||
|
||||
|
||||
# Configuration du bootloader en mode EFI
|
||||
# Setting up bootloader in UEFI mode
|
||||
|
||||
boot.loader.grub.devices = [ "nodev"];
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,4 +2,12 @@
|
|||
|
||||
{
|
||||
networking.hostName = "loulou";
|
||||
|
||||
|
||||
# Setting up environment variables
|
||||
|
||||
environment.sessionVariables = rec {
|
||||
NODE = "loulou";
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,4 +6,11 @@
|
|||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
networking.hostName = "riri";
|
||||
|
||||
# Setting up environment variables
|
||||
|
||||
environment.sessionVariables = rec {
|
||||
NODE = "riri";
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
#! /usr/bin/env bash
|
||||
|
||||
if [ -z "$1" ]
|
||||
if [ -z "${NODE:-}" ]
|
||||
then
|
||||
echo "Erreur : Précisez le noeud à installer"
|
||||
echo "Erreur : Si c'est la première fois que vous déployez le serveur, merci de faire: export NODE='riri', 'fifi' ou 'loulou' en fonction de votre serveur"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cp ./configuration.nix /etc/nixos/configuration.nix
|
||||
cp ./cluster/nodes/$1.nix /etc/nixos/node.nix
|
||||
cp ./cluster/nodes/$NODE.nix /etc/nixos/node.nix
|
||||
nixos-rebuild switch
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue