From 4f5f2a780af9f62e742b7014d782d593f1a6f044 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Fri, 19 Mar 2021 20:28:24 +0000 Subject: [PATCH] nixos-mgmt: init --- ops/nixos/default.nix | 1 + ops/nixos/nixos-mgmt/default.nix | 63 ++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 ops/nixos/nixos-mgmt/default.nix diff --git a/ops/nixos/default.nix b/ops/nixos/default.nix index 82cc0af402..a867b644d5 100644 --- a/ops/nixos/default.nix +++ b/ops/nixos/default.nix @@ -33,6 +33,7 @@ let "lux01-frantech" "nyc01-frantech" "las01-frantech" + "nixos-mgmt" ]; rebuilder = system: (import ./lib/rebuilder.nix (args // { system = system; })); systemCfgs = lib.genAttrs systems diff --git a/ops/nixos/nixos-mgmt/default.nix b/ops/nixos/nixos-mgmt/default.nix new file mode 100644 index 0000000000..7234c0c47e --- /dev/null +++ b/ops/nixos/nixos-mgmt/default.nix @@ -0,0 +1,63 @@ +# SPDX-FileCopyrightText: 2020 Luke Granger-Brown +# +# SPDX-License-Identifier: Apache-2.0 + +{ depot, lib, pkgs, rebuilder, config, ... }: +let + inherit (depot.ops) secrets; +in { + imports = [ + ../../../third_party/nixpkgs/nixos/modules/profiles/qemu-guest.nix + ../lib/low-space.nix + ]; + + boot.initrd.availableKernelModules = [ + "uhci_hcd" + "ehci_pci" + "ahci" + "virtio_pci" + "sr_mod" + "virtio_blk" + ]; + + powerManagement.cpuFreqGovernor = lib.mkDefault "performance"; + + fileSystems = { + "/" = { + device = "/dev/vda1"; + fsType = "ext4"; + }; + "/boot" = { + device = "/dev/vda2"; + fsType = "vfat"; + }; + }; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + nix.maxJobs = lib.mkDefault 1; + + # Networking! + networking = { + hostName = "nixos-mgmt"; + domain = "as205479.net"; + hostId = "49b0fbc7"; + + nameservers = [ + "8.8.8.8" + "8.8.4.4" + ]; + useDHCP = false; + defaultGateway = { + address = "10.100.0.1"; + interface = "enp1s0"; + }; + interfaces.enp1s0 = { + ipv4.addresses = [{ address = "10.100.0.200"; prefixLength = 23; }]; + }; + }; + + system.stateVersion = "21.05"; +}