diff options
author | sinanmohd <sinan@sinanmohd.com> | 2023-11-13 17:31:53 +0530 |
---|---|---|
committer | sinanmohd <sinan@sinanmohd.com> | 2023-11-13 18:08:54 +0530 |
commit | 8eb0bd9d2c2e39e5f07226d1a8e226514acd9c78 (patch) | |
tree | bb8f650236f457ec25c19d83fed8c7e24a57e248 | |
parent | bc838a0c45ed6f6984c87eb6de9c075ad520f7d1 (diff) |
hosts/mox: init
-rw-r--r-- | flake.nix | 7 | ||||
-rw-r--r-- | hosts/mox/configuration.nix | 18 | ||||
-rw-r--r-- | hosts/mox/hardware-configuration.nix | 25 | ||||
-rw-r--r-- | hosts/mox/modules/network.nix | 26 | ||||
-rw-r--r-- | modules/userdata.nix | 1 |
5 files changed, 77 insertions, 0 deletions
@@ -25,6 +25,13 @@ sops-nix.nixosModules.sops ]; }; + mox = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./hosts/mox/configuration.nix + sops-nix.nixosModules.sops + ]; + }; }; }; } diff --git a/hosts/mox/configuration.nix b/hosts/mox/configuration.nix new file mode 100644 index 0000000..6742cc3 --- /dev/null +++ b/hosts/mox/configuration.nix @@ -0,0 +1,18 @@ +{ pkgs, ... }: + +{ + imports = [ + ./hardware-configuration.nix + ./modules/network.nix + ../../common.nix + ]; + + services.openssh = { + enable = true; + settings.PasswordAuthentication = false; + }; + + boot.consoleLogLevel = 3; + networking.hostName = "mox"; + environment.systemPackages = with pkgs; [ tmux ]; +} diff --git a/hosts/mox/hardware-configuration.nix b/hosts/mox/hardware-configuration.nix new file mode 100644 index 0000000..3913e1e --- /dev/null +++ b/hosts/mox/hardware-configuration.nix @@ -0,0 +1,25 @@ +{ 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/547074b4-4d61-4968-a94f-4f97e1fa2c3c"; + fsType = "ext4"; + }; + "/boot" = { + device = "/dev/disk/by-uuid/C634-FE6A"; + fsType = "vfat"; + }; + }; +} diff --git a/hosts/mox/modules/network.nix b/hosts/mox/modules/network.nix new file mode 100644 index 0000000..bf7c690 --- /dev/null +++ b/hosts/mox/modules/network.nix @@ -0,0 +1,26 @@ +{ ... }: + +let + wan = "ens18"; + dns = "10.0.0.2"; +in +{ + networking = { + useDHCP = false; + interfaces.${wan}.ipv4.addresses = [{ + address = "10.0.8.101"; + prefixLength = 16; + }]; + defaultGateway = { + address = "10.0.0.1"; + interface = wan; + }; + }; + + services = { + dnsmasq = { + enable = true; + settings.server = [ dns ]; + }; + }; +} diff --git a/modules/userdata.nix b/modules/userdata.nix index ab14a01..d9b9bf2 100644 --- a/modules/userdata.nix +++ b/modules/userdata.nix @@ -31,6 +31,7 @@ in default = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDCeMXhkjm9CabbA/1xdtP9bvFEm8pVXPk66NmI9/VvQ sinan@vex" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL8LnyOuPmtKRqAZeHueNN4kfYvpRQVwCivSTq+SZvDU sinan@cez" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILvR5FliFLq1FJWotnBk9deWmbeGi2uq2XVmx0uAr1Lw sinan@mox" ]; }; }; |