From 20a01c781aa70865a644a643409d0e2640004708 Mon Sep 17 00:00:00 2001 From: alydev Date: Tue, 23 Sep 2025 18:47:53 +1000 Subject: [PATCH] add hw --- .gitignore | 1 - flake.nix | 11 ++++++----- hw-aly-laptop.nix | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 6 deletions(-) delete mode 100644 .gitignore create mode 100644 hw-aly-laptop.nix diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 577b0a0..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -hardware-configuration.nix diff --git a/flake.nix b/flake.nix index 095ee62..24970ad 100644 --- a/flake.nix +++ b/flake.nix @@ -7,14 +7,17 @@ url = "github:nix-community/home-manager/release-25.05"; inputs.nixpkgs.follows = "nixpkgs"; }; + authorizedKeys = builtins.fetchurl { + url = "https://aly.pet/authorized_keys.nix"; + }; }; - outputs = inputs@{ nixpkgs, home-manager, ... }: { + outputs = inputs@{ nixpkgs, home-manager, authorizedKeys, ... }: { nixosConfigurations = { aly-laptop = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ - ./hardware-configuration.nix + ./hw-aly-laptop.nix ({ config, pkgs, ... }: { networking.hostName = "aly-laptop"; services.logind = { @@ -51,9 +54,7 @@ isNormalUser = true; description = "aly"; hashedPassword = "$y$j9T$Q.yFJjo9LMA8o.7Ac5uSr/$Y8pYIPSzCXHSd4nAlUohaaohwpquK6XEIjxFKq3J4s/"; - openssh.authorizedKeys.keys = import builtins.fetchurl { - url = "https://aly.pet/authorized_keys.nix"; - }; + openssh.authorizedKeys.keys = import authorizedKeys; extraGroups = [ "networkmanager" "wheel" ]; }; diff --git a/hw-aly-laptop.nix b/hw-aly-laptop.nix new file mode 100644 index 0000000..8401719 --- /dev/null +++ b/hw-aly-laptop.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" "nvme" "uas" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/ef82934f-dab4-42bb-9b9a-2b8d74c4e4e4"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/35CB-B28A"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/9a5ddb1d-cc66-4861-ba04-f4a3e4363500"; } + ]; + + # 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.enp0s31f6.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; +}