Updated networking for sampledb and media
This commit is contained in:
parent
0b5337ec0f
commit
1ce83d0f37
@ -3,22 +3,13 @@
|
|||||||
imports = [
|
imports = [
|
||||||
../hardware/media.nix
|
../hardware/media.nix
|
||||||
./headless.nix
|
./headless.nix
|
||||||
|
(import ./networking.nix {
|
||||||
|
hostname = "sampledb-dev";
|
||||||
|
ip_address = "192.168.100.40";
|
||||||
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
users.users.media = import ./user.nix;
|
users.users.media = import ./user.nix;
|
||||||
networking.hostName = "r330-media";
|
|
||||||
|
|
||||||
# Conigure a static IP address.
|
|
||||||
networking.defaultGateway = "192.168.100.1";
|
|
||||||
networking.nameservers = [ "192.168.100.1" ];
|
|
||||||
networking.firewall.allowedTCPPorts = [ 80 443 32400 ];
|
|
||||||
networking.interfaces.enp6s18.ipv4.addresses = [
|
|
||||||
{
|
|
||||||
address = "192.168.100.40";
|
|
||||||
prefixLength = 24;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
# Setup drivers for NVIDIA GPU
|
# Setup drivers for NVIDIA GPU
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
|
23
config/networking.nix
Normal file
23
config/networking.nix
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{ ip_address, hostname }:
|
||||||
|
{
|
||||||
|
# Configure hostname.
|
||||||
|
networking.hostName = hostname;
|
||||||
|
|
||||||
|
# Conigure a static IP address.
|
||||||
|
networking.useDHCP = false;
|
||||||
|
networking.useNetworkd= true;
|
||||||
|
|
||||||
|
networking.defaultGateway = {
|
||||||
|
address = ip_address;
|
||||||
|
interface = "enp6s18";
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.nameservers = [ "192.168.100.1" ];
|
||||||
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||||
|
networking.interfaces.enp6s18.ipv4.addresses = [
|
||||||
|
{
|
||||||
|
address = ip_address;
|
||||||
|
prefixLength = 24;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
@ -3,19 +3,11 @@
|
|||||||
imports = [
|
imports = [
|
||||||
../hardware/sampledb.nix
|
../hardware/sampledb.nix
|
||||||
./headless.nix
|
./headless.nix
|
||||||
|
(import ./networking.nix {
|
||||||
|
hostname = "sampledb-dev";
|
||||||
|
ip_address = "192.168.100.42";
|
||||||
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
users.users.sampledb = import ./user.nix;
|
users.users.sampledb = import ./user.nix;
|
||||||
networking.hostName = "sampledb-dev";
|
|
||||||
|
|
||||||
# Conigure a static IP address.
|
|
||||||
networking.defaultGateway = "192.168.100.1";
|
|
||||||
networking.nameservers = [ "192.168.100.1" ];
|
|
||||||
networking.firewall.allowedTCPPorts = [ 80 443 32400 ];
|
|
||||||
networking.interfaces.ens18.ipv4.addresses = [
|
|
||||||
{
|
|
||||||
address = "192.168.100.42";
|
|
||||||
prefixLength = 24;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
@ -8,19 +8,20 @@
|
|||||||
[ (modulesPath + "/profiles/qemu-guest.nix")
|
[ (modulesPath + "/profiles/qemu-guest.nix")
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
|
boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ ];
|
||||||
boot.kernelModules = [ ];
|
boot.kernelModules = [ ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
fileSystems."/" = {
|
fileSystems."/" =
|
||||||
device = "/dev/disk/by-uuid/bc530c66-1e41-4c32-9ea0-e9e644677300";
|
{ device = "/dev/disk/by-uuid/8d1d0298-307f-4d9a-84f8-0434fafa0c55";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/mnt/sampledb" = {
|
fileSystems."/boot" =
|
||||||
device = "/dev/disk/by-uuid/9d0bc50c-7382-4085-a3ea-5bc0fb52c1f8";
|
{ device = "/dev/disk/by-uuid/4821-12F7";
|
||||||
fsType = "ext4";
|
fsType = "vfat";
|
||||||
|
options = [ "fmask=0022" "dmask=0022" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
swapDevices = [ ];
|
swapDevices = [ ];
|
||||||
@ -30,7 +31,7 @@
|
|||||||
# still possible to use this option, but it's recommended to use it in conjunction
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
networking.useDHCP = lib.mkDefault true;
|
networking.useDHCP = lib.mkDefault true;
|
||||||
# networking.interfaces.ens18.useDHCP = lib.mkDefault true;
|
# networking.interfaces.enp6s18.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,23 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
STATE_VERSION="24.05"
|
STATE_VERSION="$1"
|
||||||
|
|
||||||
if [ $(id -u) != 0 ]; then
|
if [ $(id -u) != 0 ]; then
|
||||||
echo "This script must be run as root."
|
echo "This script must be run as root."
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ $1 == "" ]]; then
|
||||||
|
echo "Usage: $0 <STATE_VERSION|unstable>"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Adding home-manager:${STATE_VERSION} to nix channels..."
|
echo "Adding home-manager:${STATE_VERSION} to nix channels..."
|
||||||
nix-channel --add "https://github.com/nix-community/home-manager/archive/release-${STATE_VERSION}.tar.gz" home-manager
|
if [[ $STATE_VERSION == "unstable" ]]; then
|
||||||
|
nix-channel --add "https://github.com/nix-community/home-manager/archive/master.tar.gz" home-manager
|
||||||
|
else
|
||||||
|
nix-channel --add "https://github.com/nix-community/home-manager/archive/release-${STATE_VERSION}.tar.gz" home-manager
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Updating nix channels..."
|
echo "Updating nix channels..."
|
||||||
nix-channel --update
|
nix-channel --update
|
||||||
|
Loading…
x
Reference in New Issue
Block a user