From f522b607de34208121b27f073bb89bf51cea110f Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Thu, 11 Apr 2024 18:04:54 -0600 Subject: [PATCH] automattic: init machine Signed-off-by: Sumner Evans --- flake.nix | 6 ++++ host-configurations/automattic.nix | 55 ++++++++++++++++++++++++++++++ host-configurations/scarif.nix | 1 - 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 host-configurations/automattic.nix diff --git a/flake.nix b/flake.nix index 0711b0d..796a986 100644 --- a/flake.nix +++ b/flake.nix @@ -38,6 +38,12 @@ specialArgs = { inherit inputs; }; modules = [ ./configuration.nix ./host-configurations/mustafar.nix ]; }; + automattic = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = + [ ./configuration.nix ./host-configurations/automattic.nix ]; + }; }; } // (flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { system = system; }; diff --git a/host-configurations/automattic.nix b/host-configurations/automattic.nix new file mode 100644 index 0000000..985fe6a --- /dev/null +++ b/host-configurations/automattic.nix @@ -0,0 +1,55 @@ +{ config, lib, pkgs, modulesPath, ... }: { + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + # Set the hostname + networking.hostName = "automattic"; + hardware.isPC = true; + hardware.ramSize = 32; + hardware.isLaptop = true; + hardware.cpu.amd.updateMicrocode = + lib.mkDefault config.hardware.enableRedistributableFirmware; + + services.thinkfan.enable = true; + + # Use systemd-boot + boot = { + loader.systemd-boot.enable = true; + initrd = { + availableKernelModules = + [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod" ]; + kernelModules = [ ]; + }; + kernelModules = [ "kvm-amd" ]; + extraModulePackages = [ ]; + kernelPackages = pkgs.linuxPackages_latest; + }; + + # Set up networking. + networking.useDHCP = lib.mkDefault true; + + # Enable the OpenSSH daemon. + services.openssh.enable = true; + + programs.sway.enable = true; + programs.steam.enable = true; + + # Enable Docker. + virtualisation.docker.enable = true; + + # Extra options for btrfs + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/e5c1f6c9-4417-4da6-9df9-ebc014050fed"; + fsType = "ext4"; + }; + "/boot" = { + device = "/dev/disk/by-uuid/3A7A-964C"; + fsType = "vfat"; + }; + }; + + swapDevices = [{ + device = "/var/lib/swapfile"; + size = 32 * 1024; + }]; +} diff --git a/host-configurations/scarif.nix b/host-configurations/scarif.nix index af2de09..13256c3 100644 --- a/host-configurations/scarif.nix +++ b/host-configurations/scarif.nix @@ -25,7 +25,6 @@ }; # Set up networking. - networking.interfaces.wlp1s0.useDHCP = true; networking.useDHCP = lib.mkDefault true; # Enable the OpenSSH daemon.