Compare commits
6 Commits
7f6bfafbcf
...
204303beee
Author | SHA1 | Date | |
---|---|---|---|
204303beee | |||
bfdfc7ee68 | |||
fe7ccf245b | |||
e0049c72ea | |||
bdb78d60c1 | |||
022fabb0f7 |
@ -72,7 +72,12 @@
|
|||||||
porter = { name = "porter"; };
|
porter = { name = "porter"; };
|
||||||
storage-2 = { name = "storage-2"; };
|
storage-2 = { name = "storage-2"; };
|
||||||
web-2 = { name = "web-2"; };
|
web-2 = { name = "web-2"; };
|
||||||
zinc = { name = "zinc"; };
|
zinc = {
|
||||||
|
name = "zinc";
|
||||||
|
modules = [
|
||||||
|
nixos-hardware.nixosModules.common-cpu-intel
|
||||||
|
];
|
||||||
|
};
|
||||||
# nixfiles-auto-install: add new host above
|
# nixfiles-auto-install: add new host above
|
||||||
_iso = { name = "_iso"; };
|
_iso = { name = "_iso"; };
|
||||||
};
|
};
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
../../configuration/desktop
|
../../configuration/desktop
|
||||||
|
|
||||||
./initrd.nix
|
./initrd.nix
|
||||||
|
./programs.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Use the systemd-boot EFI boot loader.
|
# Use the systemd-boot EFI boot loader.
|
||||||
|
@ -1,6 +1,31 @@
|
|||||||
{ config, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
{
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
configure_network = pkgs.writeScriptBin "configure-network" ''
|
||||||
|
ifdisplay=""
|
||||||
|
while true; do
|
||||||
|
ifdisplay_new=$(ipconfig -t 10 all)
|
||||||
|
ipconfig_status=$?
|
||||||
|
|
||||||
|
# Only show network config if something changes
|
||||||
|
if [[ "$ifdisplay" != "$ifdisplay_new" ]]; then
|
||||||
|
ifdisplay=$ifdisplay_new
|
||||||
|
echo
|
||||||
|
echo "$ifdisplay"
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Wait a little before checking again
|
||||||
|
if [[ $ipconfig_status == 0 ]]; then
|
||||||
|
sleep 5
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
|
||||||
|
in {
|
||||||
|
|
||||||
boot.initrd.network.enable = true;
|
boot.initrd.network.enable = true;
|
||||||
boot.initrd.network.ssh = {
|
boot.initrd.network.ssh = {
|
||||||
@ -12,11 +37,30 @@
|
|||||||
"/var/src/secrets/initrd/ssh_host_ed25519_key"
|
"/var/src/secrets/initrd/ssh_host_ed25519_key"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
boot.initrd.extraFiles."/root/.ash_history".source = pkgs.writeText ".ash_history" ''
|
||||||
|
cryptsetup-askpass
|
||||||
|
'';
|
||||||
|
|
||||||
boot.initrd.kernelModules = [
|
boot.initrd.kernelModules = [
|
||||||
"igc" # integrated rj45 network interface
|
"igc" # integrated rj45 network interface
|
||||||
"cdc_ether" # external 5G modem via usb
|
"cdc_ether" # external 5G modem via usb
|
||||||
];
|
];
|
||||||
boot.kernelParams = [ "ip=dhcp" ];
|
|
||||||
|
boot.initrd.extraUtilsCommands = ''
|
||||||
|
copy_bin_and_libs ${configure_network}/bin/configure-network
|
||||||
|
'';
|
||||||
|
|
||||||
|
boot.initrd.network.postCommands = mkBefore ''
|
||||||
|
configure-network &
|
||||||
|
'';
|
||||||
|
|
||||||
|
boot.initrd.postMountCommands = mkBefore ''
|
||||||
|
pkill -x configure-network
|
||||||
|
|
||||||
|
# Override the previously set interfaces with the ones that really exist
|
||||||
|
ifaces=$(ip -o link show | grep "link/ether" | cut -d: -f2 | xargs -n 1)
|
||||||
|
'';
|
||||||
|
|
||||||
boot.initrd.network.wireguard = {
|
boot.initrd.network.wireguard = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
12
hosts/zinc/programs.nix
Normal file
12
hosts/zinc/programs.nix
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
users.users.clerie.packages = with pkgs; [
|
||||||
|
firefox
|
||||||
|
|
||||||
|
blender
|
||||||
|
cura
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
@ -41,6 +41,7 @@ in
|
|||||||
|
|
||||||
boot.initrd.network.postCommands = ''
|
boot.initrd.network.postCommands = ''
|
||||||
ip link add dev "wg-initrd" type wireguard
|
ip link add dev "wg-initrd" type wireguard
|
||||||
|
ip link set "wg-initrd" mtu 1280
|
||||||
|
|
||||||
${concatMapStringsSep "\n" (ip: ''
|
${concatMapStringsSep "\n" (ip: ''
|
||||||
ip address add "${ip}" dev "wg-initrd"
|
ip address add "${ip}" dev "wg-initrd"
|
||||||
|
Loading…
Reference in New Issue
Block a user