From 97e4a774f8470642b732074e82dd28421cab4b30 Mon Sep 17 00:00:00 2001 From: moons-14 Date: Tue, 26 May 2026 02:39:47 +0900 Subject: [PATCH] add ops --- flake.nix | 6 ++++ hosts/ops/default.nix | 45 ++++++++++++++++++++++++++++ hosts/ops/hardware-configuration.nix | 30 +++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 hosts/ops/default.nix create mode 100644 hosts/ops/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index 93f778b..104dbc7 100644 --- a/flake.nix +++ b/flake.nix @@ -112,6 +112,12 @@ profile = "cli-server"; extraModules = []; }; + ops = mkSystem { + host = "ops"; + system = "x86_64-linux"; + profile = "cli-server"; + extraModules = []; + }; }; devShells = { diff --git a/hosts/ops/default.nix b/hosts/ops/default.nix new file mode 100644 index 0000000..16e1728 --- /dev/null +++ b/hosts/ops/default.nix @@ -0,0 +1,45 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). +{...}: { + imports = [ + ./hardware-configuration.nix + ]; + + services.qemuGuest.enable = true; + + networking = { + useDHCP = false; + + interfaces = { + ens18 = { + useDHCP = false; + ipv4.addresses = [ + { + address = "10.50.128.20"; + prefixLength = 24; + } + ]; + }; + + ens19 = { + useDHCP = false; + ipv4.addresses = [ + { + address = "10.50.7.101"; + prefixLength = 24; + } + ]; + }; + }; + + defaultGateway = { + address = "10.50.128.1"; + interface = "ens18"; + }; + + nameservers = [ + "1.1.1.1" + ]; + }; +} diff --git a/hosts/ops/hardware-configuration.nix b/hosts/ops/hardware-configuration.nix new file mode 100644 index 0000000..d8c4f55 --- /dev/null +++ b/hosts/ops/hardware-configuration.nix @@ -0,0 +1,30 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/69fa2193-1e4f-438a-8898-5de8a3f36e5b"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/D09B-4277"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +}