Add system state version
This commit is contained in:
parent
e9ccff4b52
commit
30549b5e4e
5 changed files with 19 additions and 6 deletions
17
deploy
17
deploy
|
@ -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
|
||||||
|
|
|
@ -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";
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,4 +166,6 @@ in
|
||||||
workstation = false;
|
workstation = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
system.stateVersion = "20.03";
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,4 +121,6 @@ in
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
system.stateVersion = "20.09";
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,4 +118,6 @@ in
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
system.stateVersion = "20.09";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue