From ca76ec99a638fb7ef8f54644695a47b627d64257 Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Tue, 9 Jan 2024 11:51:51 +0530 Subject: hosts/dspace: init --- flake.nix | 2 +- hosts/dspace/configuration.nix | 17 +++++++++++++++++ hosts/dspace/hardware-configuration.nix | 27 +++++++++++++++++++++++++++ hosts/dspace/modules/network.nix | 18 ++++++++++++++++++ 4 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 hosts/dspace/configuration.nix create mode 100644 hosts/dspace/hardware-configuration.nix create mode 100644 hosts/dspace/modules/network.nix diff --git a/flake.nix b/flake.nix index 555c318..7b865fb 100644 --- a/flake.nix +++ b/flake.nix @@ -26,6 +26,6 @@ ); in { - nixosConfigurations = makeX86 [ "cez" "kay" "fscusat" ]; + nixosConfigurations = makeX86 [ "cez" "kay" "fscusat" "dspace" ]; }; } diff --git a/hosts/dspace/configuration.nix b/hosts/dspace/configuration.nix new file mode 100644 index 0000000..c7dc52b --- /dev/null +++ b/hosts/dspace/configuration.nix @@ -0,0 +1,17 @@ +{ config, ... }: + +let + user = config.userdata.user; +in +{ + imports = [ + ./hardware-configuration.nix + ./modules/network.nix + ../../common.nix + ]; + + + users.users.${user}.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILvR5FliFLq1FJWotnBk9deWmbeGi2uq2XVmx0uAr1Lw sinan@fscusat" + ]; +} diff --git a/hosts/dspace/hardware-configuration.nix b/hosts/dspace/hardware-configuration.nix new file mode 100644 index 0000000..c355e8b --- /dev/null +++ b/hosts/dspace/hardware-configuration.nix @@ -0,0 +1,27 @@ +{ lib, modulesPath, ... }: + +{ + imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; + + boot.initrd.availableKernelModules = [ + "ata_piix" + "uhci_hcd" + "virtio_pci" + "virtio_scsi" + "sd_mod" + "sr_mod" + ]; + + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/c5b1077e-52e8-4249-8bd7-d53eafa41f5a"; + fsType = "ext4"; + }; + "/boot" = { + device = "/dev/disk/by-uuid/9787-FFFE"; + fsType = "vfat"; + }; + }; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/hosts/dspace/modules/network.nix b/hosts/dspace/modules/network.nix new file mode 100644 index 0000000..007cfba --- /dev/null +++ b/hosts/dspace/modules/network.nix @@ -0,0 +1,18 @@ +{ ... }: + +let + wan = "ens18"; +in +{ + networking = { + interfaces.${wan}.ipv4.addresses = [{ + address = "10.0.8.107"; + prefixLength = 16; + }]; + defaultGateway = { + address = "10.0.0.1"; + interface = wan; + }; + nameservers = [ "10.0.0.2" "10.0.0.3" ]; + }; +} -- cgit v1.2.3