Add system state version

This commit is contained in:
Tim Schubert 2021-01-07 22:01:32 +01:00
parent e9ccff4b52
commit 30549b5e4e
Signed by: dadada
GPG key ID: EEB8D1CE62C4DFEA
5 changed files with 19 additions and 6 deletions

17
deploy
View file

@ -20,20 +20,25 @@ function hash {
host="${1}" host="${1}"
rev="$(git rev-parse HEAD)" rev="$(git rev-parse HEAD)"
url="https://github.com/dadada/nix-config/archive/${rev}.tar.gz"
sha256=$(hash "$rev") sha256=$(hash "$rev")
cat <<EOF | ssh "${host}".dadada.li 'sudo nix-shell -p tmux --run "cat - > /etc/nixos/deploy.nix && tmux new -d \"nixos-rebuild switch |& tee /var/log/dadada-deploy.log\""' cat <<EOF | ssh "${host}".dadada.li 'sudo nix-shell -p tmux --run "cat - > /etc/nixos/configuration.nix && tmux new -d \"nixos-rebuild switch |& tee /var/log/dadada-deploy.log\""'
let
host = "$host";
rev = "$rev";
sha256 = "$sha256";
in
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
let let
dadada = import (builtins.fetchTarball { dadada = import (builtins.fetchTarball {
url = ${url}; url = "https://github.com/dadada/nix-config/archive/\${rev}.tar.gz";
sha256 = "${sha256}"; sha256 = sha256;
}) { inherit pkgs; }; }) { inherit pkgs; };
in { in
{
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
dadada.hosts."${host}" dadada.hosts."\${host}"
]; ];
} }
EOF EOF

View file

@ -121,4 +121,6 @@ in
"192.168.42.11" = [ "wohnzimmerpi.dadada.li" "wohnzimmerpi" ]; "192.168.42.11" = [ "wohnzimmerpi.dadada.li" "wohnzimmerpi" ];
"10.1.2.9" = [ "fgprinter.fginfo.tu-bs.de" ]; "10.1.2.9" = [ "fgprinter.fginfo.tu-bs.de" ];
}; };
system.stateVersion = "20.03";
} }

View file

@ -166,4 +166,6 @@ in
workstation = false; workstation = false;
}; };
}; };
system.stateVersion = "20.03";
} }

View file

@ -121,4 +121,6 @@ in
} }
]; ];
}; };
system.stateVersion = "20.09";
} }

View file

@ -118,4 +118,6 @@ in
} }
]; ];
}; };
system.stateVersion = "20.09";
} }