Configure elnudrop
This commit is contained in:
parent
5b8dbadbb1
commit
efa926d33f
11 changed files with 281 additions and 166 deletions
16
hosts/elnudrop/default.nix
Normal file
16
hosts/elnudrop/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ lib, user, ... }:
|
||||
|
||||
let keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEQNlGt62dBMojVCX7EUIia+wfSDfLzV4YCPi8SZ2xrp elnu@elnu.com"
|
||||
]; in
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
# Remember to update for new instances
|
||||
./networking.nix # generated at runtime by nixos-infect
|
||||
];
|
||||
services.do-agent.enable = true;
|
||||
services.openssh.enable = true;
|
||||
users.users.root.openssh.authorizedKeys.keys = keys;
|
||||
users.users.${user}.openssh.authorizedKeys.keys = keys;
|
||||
}
|
9
hosts/elnudrop/hardware-configuration.nix
Normal file
9
hosts/elnudrop/hardware-configuration.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{ modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
|
||||
boot.loader.grub.device = "/dev/vda";
|
||||
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ];
|
||||
boot.initrd.kernelModules = [ "nvme" ];
|
||||
fileSystems."/" = { device = "/dev/vda1"; fsType = "ext4"; };
|
||||
}
|
13
hosts/elnudrop/home.nix
Normal file
13
hosts/elnudrop/home.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{ lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../../modules/bash
|
||||
../../modules/neovim
|
||||
];
|
||||
# Disable greeter, which is getting run twice somehow
|
||||
programs.bash = with import ../../modules/bash/bashrc.nix; {
|
||||
bashrcExtra = lib.mkForce bashrcExtra;
|
||||
profileExtra = greeter;
|
||||
};
|
||||
}
|
34
hosts/elnudrop/networking.nix
Normal file
34
hosts/elnudrop/networking.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{ lib, ... }: {
|
||||
# This file was populated at runtime with the networking
|
||||
# details gathered from the active system.
|
||||
networking = {
|
||||
nameservers = [ "8.8.8.8"
|
||||
];
|
||||
defaultGateway = "146.190.144.1";
|
||||
defaultGateway6 = {
|
||||
address = "";
|
||||
interface = "eth0";
|
||||
};
|
||||
dhcpcd.enable = false;
|
||||
usePredictableInterfaceNames = lib.mkForce false;
|
||||
interfaces = {
|
||||
eth0 = {
|
||||
ipv4.addresses = [
|
||||
{ address="146.190.153.94"; prefixLength=20; }
|
||||
{ address="10.48.0.5"; prefixLength=16; }
|
||||
];
|
||||
ipv6.addresses = [
|
||||
{ address="fe80::20db:d1ff:fe51:4175"; prefixLength=64; }
|
||||
];
|
||||
ipv4.routes = [ { address = "146.190.144.1"; prefixLength = 32; } ];
|
||||
# adding route /128... 'ip route add /128 dev eth0' failed: Error: any valid prefix is expected rather than "/128".
|
||||
#ipv6.routes = [ { address = ""; prefixLength = 128; } ];
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
services.udev.extraRules = ''
|
||||
ATTR{address}=="22:db:d1:51:41:75", NAME="eth0"
|
||||
ATTR{address}=="82:4e:3d:d2:3a:9a", NAME="eth1"
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue