From cccad986fe04085c9884de17147a723e3eb636fc Mon Sep 17 00:00:00 2001 From: Jay Looney Date: Thu, 10 Jul 2025 08:53:27 -0500 Subject: [PATCH] feat: add a new laptop host (Asus Zenbook 3) --- flake.nix | 4 +++ hosts/cobalt/configuration.nix | 29 +++++++++++++++++ hosts/cobalt/default.nix | 11 +++++++ hosts/cobalt/hardware-configuration.nix | 41 +++++++++++++++++++++++++ 4 files changed, 85 insertions(+) create mode 100644 hosts/cobalt/configuration.nix create mode 100644 hosts/cobalt/default.nix create mode 100644 hosts/cobalt/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index c0586ac..1c2fa13 100644 --- a/flake.nix +++ b/flake.nix @@ -48,6 +48,10 @@ #extraModules = [ (import ./overlays) ]; extraModules = [ stylix.nixosModules.stylix ]; }; + cobalt = mkSystem { + hostname = "cobalt"; + users = [ "jml" ]; + }; # `nix build .#nixosConfigurations.installIso.config.system.build.isoImage` # https://github.com/nix-community/nixos-generators installIso = nixpkgs.lib.nixosSystem { diff --git a/hosts/cobalt/configuration.nix b/hosts/cobalt/configuration.nix new file mode 100644 index 0000000..bea1e3c --- /dev/null +++ b/hosts/cobalt/configuration.nix @@ -0,0 +1,29 @@ +# 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’). + +{ config, pkgs, ... }: + +{ + networking.hostName = "cobalt"; # Define your hostname. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + networking.networkmanager.enable = true; + + # Desktop stuff specific to this device + services.xserver.enable = true; + services.xserver.displayManager.lightdm.enable = true; + services.xserver.desktopManager.pantheon.enable = true; + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + + fonts.packages = with pkgs; [ + nerd-fonts.fira-code + nerd-fonts.iosevka + atkinson-hyperlegible + ]; + + + system.stateVersion = "25.05"; +} diff --git a/hosts/cobalt/default.nix b/hosts/cobalt/default.nix new file mode 100644 index 0000000..bffc73e --- /dev/null +++ b/hosts/cobalt/default.nix @@ -0,0 +1,11 @@ +{ inputs, ... }: +{ + imports = [ + ../../modules/nixos/base.nix + ../../modules/nixos/audio.nix + #../../modules/nixos/desktop.nix + # https://github.com/NixOS/nixos-hardware/blob/master/README.md#using-nix-flakes-support + ./hardware-configuration.nix + ./configuration.nix + ]; +} diff --git a/hosts/cobalt/hardware-configuration.nix b/hosts/cobalt/hardware-configuration.nix new file mode 100644 index 0000000..da7f0e2 --- /dev/null +++ b/hosts/cobalt/hardware-configuration.nix @@ -0,0 +1,41 @@ +# 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 + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/959b3c06-58a2-45be-b2d6-275c489c31f8"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/2EC2-D03D"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/0239ee2a-484b-4a17-b1e9-02fd35df851f"; } + ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp0s20f0u1u3.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}