finish smithers setup
parent
7746d1c00d
commit
559ea03060
17
nixos/conf
17
nixos/conf
|
@ -6,13 +6,12 @@ then
|
|||
fi
|
||||
export NIX_PATH=yori-nix=$PWD
|
||||
host=$1
|
||||
TARGET_HOST=192.168.178.83
|
||||
#TARGET_HOST=$(nix eval --raw -f vpn.nix ips.$host)
|
||||
#TARGET_HOST=$(ssh $TARGET_HOST ip --json r get 1.1.1.1 | jq -r '.[0].prefsrc')
|
||||
#TARGET_HOST=192.168.178.1
|
||||
TARGET_HOST=$(nix eval --raw -f vpn.nix ips.$host)
|
||||
TARGET_HOST=$(ssh $TARGET_HOST ip --json r get 1.1.1.1 | jq -r '.[0].prefsrc')
|
||||
COPY_USER=yorick
|
||||
case $2 in
|
||||
copy-keys)
|
||||
nix build -f servers.nix "$host".config.deployment.keys-copy --out-link copy-keys
|
||||
nix build -f ../. yorick.machine."$host".config.deployment.keys-copy --out-link copy-keys
|
||||
./copy-keys/bin/copy-keys "$TARGET_HOST"
|
||||
# rm ./copy-keys
|
||||
;;
|
||||
|
@ -32,22 +31,22 @@ case $2 in
|
|||
nix build -f servers.nix "$host" --show-trace
|
||||
;;
|
||||
copy)
|
||||
nix copy -f servers.nix "$host" --show-trace --to "ssh://$TARGET_HOST"
|
||||
nix copy -f servers.nix "$host" --show-trace --to "ssh://$COPY_USER@$TARGET_HOST"
|
||||
;;
|
||||
test)
|
||||
outPath=$(nix-build servers.nix -A "$host")
|
||||
nix copy -f servers.nix "$host" --show-trace --to "ssh://$TARGET_HOST"
|
||||
nix copy -f servers.nix "$host" --show-trace --to "ssh://$COPY_USER@$TARGET_HOST"
|
||||
ssh root@"$TARGET_HOST" $outPath/bin/switch-to-configuration test
|
||||
;;
|
||||
boot)
|
||||
outPath=$(nix-build servers.nix -A "$host")
|
||||
nix copy "$outPath" --show-trace --to "ssh://$TARGET_HOST"
|
||||
nix copy "$outPath" --show-trace --to "ssh://$COPY_USER@$TARGET_HOST"
|
||||
ssh root@"$TARGET_HOST" nix-env -p "/nix/var/nix/profiles/system" --set "$outPath"
|
||||
ssh root@"$TARGET_HOST" $outPath/bin/switch-to-configuration boot
|
||||
;;
|
||||
switch)
|
||||
outPath=$(nix-build servers.nix -A "$host")
|
||||
nix copy "$outPath" --show-trace --to "ssh://$TARGET_HOST"
|
||||
nix copy "$outPath" --show-trace --to "ssh://$COPY_USER@$TARGET_HOST"
|
||||
ssh root@"$TARGET_HOST" nix-env -p "/nix/var/nix/profiles/system" --set "$outPath"
|
||||
ssh root@"$TARGET_HOST" $outPath/bin/switch-to-configuration switch
|
||||
;;
|
||||
|
|
|
@ -4,9 +4,11 @@
|
|||
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
let sources = import ../../nix/sources.nix;
|
||||
in {
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
"${sources.nixos-hardware}/lenovo/thinkpad/x1"
|
||||
../physical/x11-hardware-config.nix
|
||||
../roles/workstation.nix
|
||||
|
||||
|
@ -17,11 +19,11 @@
|
|||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
boot.zfs.requestEncryptionCredentials = true;
|
||||
|
||||
networking.hostName = "smithers"; # Define your hostname.
|
||||
networking.hostName = "smithers";
|
||||
networking.wireless.iwd.enable = true;
|
||||
networking.hostId = "54a8968e";
|
||||
|
||||
system.stateVersion = "21.05"; # Did you read the comment?
|
||||
system.stateVersion = "21.05";
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest; # new hardware
|
||||
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ in {
|
|||
group = "users";
|
||||
openssh.authorizedKeys.keys = with (import ../sshkeys.nix); yorick;
|
||||
hashedPassword = secrets.yorick_hashedPassword;
|
||||
createHome = true;
|
||||
};
|
||||
|
||||
# Nix
|
||||
|
|
Loading…
Reference in New Issue