Johan Rong 1 month ago
parent
commit
6240b0718f
5 changed files with 83 additions and 0 deletions
  1. 6 0
      config/hosts.nix
  2. 9 0
      flake.nix
  3. 45 0
      hosts/ideapad/hardware.nix
  4. 17 0
      hosts/ideapad/home.nix
  5. 6 0
      hosts/ideapad/iso.nix

+ 6 - 0
config/hosts.nix

@@ -14,4 +14,10 @@ in
     arch = "x86_64-linux";
     user = users.default;  
   };
+  ideapad = {
+    hostname = "ideapad";
+    dir = "ideapad";
+    arch = "x86_64-linux";
+    user = users.default;  
+  };
 }

+ 9 - 0
flake.nix

@@ -96,6 +96,11 @@
         nixpkgs = inputs.nixpkgs;
         home-manager = inputs.home-manager;
       };
+      nixosConfigurations."${hosts.ideapad.hostname}" = mkNixOSConfigurations {
+        host = hosts.ideapad;
+        nixpkgs = inputs.nixpkgs;
+        home-manager = inputs.home-manager;
+      };
 
       nixosConfigurations."${hosts.nixstation.hostname}-iso" = mkISOConfiguration {
         host = hosts.nixstation;
@@ -105,6 +110,10 @@
         host = hosts.dellaptop;
         nixpkgs = inputs.nixpkgs;
       };
+      nixosConfigurations."${hosts.ideapad.hostname}-iso" = mkISOConfiguration {
+        host = hosts.ideapad;
+        nixpkgs = inputs.nixpkgs;
+      };
 
       homeConfigurations."${hosts.nixstation.user}@${hosts.nixstation.hostname}" = mkHomeConfigurations {
         host = hosts.nixstation;

+ 45 - 0
hosts/ideapad/hardware.nix

@@ -0,0 +1,45 @@
+# 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" "usb_storage" "sd_mod" ];
+  boot.initrd.kernelModules = [ ];
+  boot.kernelModules = [ "kvm-intel" ];
+  boot.extraModulePackages = [ ];
+
+  fileSystems."/" =
+    { device = "/dev/disk/by-uuid/91e157c0-f607-491d-93ad-4a00f08ae338";
+      fsType = "btrfs";
+    };
+
+  fileSystems."/home" =
+    { device = "/dev/disk/by-uuid/91e157c0-f607-491d-93ad-4a00f08ae338";
+      fsType = "btrfs";
+      options = [ "subvol=home" ];
+    };
+
+  fileSystems."/nix" =
+    { device = "/dev/disk/by-uuid/91e157c0-f607-491d-93ad-4a00f08ae338";
+      fsType = "btrfs";
+      options = [ "subvol=nix" ];
+    };
+
+  fileSystems."/boot" =
+    { device = "/dev/disk/by-uuid/0996-8DC7";
+      fsType = "vfat";
+      options = [ "fmask=0077" "dmask=0077" ];
+    };
+
+  swapDevices =
+    [ { device = "/dev/disk/by-uuid/b0e53493-71b7-4adc-bc9a-37c16ed9672b"; }
+    ];
+
+  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+  hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+}

+ 17 - 0
hosts/ideapad/home.nix

@@ -0,0 +1,17 @@
+{ config, pkgs, lib, ... }:
+let
+  users = import ../../config/users.nix;
+in
+{
+  imports = [
+    ../../home/flavors/desktop/hyprland
+  ];
+
+  news.display = "silent";
+
+  home = {
+    username = users.default;
+    homeDirectory = "/home/${users.default}";
+    stateVersion = "26.05";
+  };
+}

+ 6 - 0
hosts/ideapad/iso.nix

@@ -0,0 +1,6 @@
+{ ... }:
+{
+  imports = [
+    ../../nixos/features/system/iso-base.nix
+  ];
+}