From e7059d86b6d07479864b1d4cf06b52185c690110 Mon Sep 17 00:00:00 2001 From: Tao Tien <29749622+taotien@users.noreply.github.com> Date: Mon, 17 Jul 2023 16:41:11 -0700 Subject: [PATCH] laptop --- flake.nix | 1 + systems/NOcomputer.nix | 25 +++++++++++++------------ systems/NOlaptop.nix | 40 +++++++++++++++++++++++++++++++++++++++- users/tao.nix | 9 +++++++-- 4 files changed, 60 insertions(+), 15 deletions(-) diff --git a/flake.nix b/flake.nix index 7415f09..a1e08b6 100644 --- a/flake.nix +++ b/flake.nix @@ -26,6 +26,7 @@ ./users/tao.nix ]; NOlaptop = nixosSystem [ + nixos-hw.common-cpu-intel # inputs.nixos-hardware.nixosModules.framework ./systems/BASED.nix ./systems/NOlaptop.nix diff --git a/systems/NOcomputer.nix b/systems/NOcomputer.nix index 3fc68ab..bfe38b7 100644 --- a/systems/NOcomputer.nix +++ b/systems/NOcomputer.nix @@ -36,30 +36,31 @@ options = [ "subvol=nixos/tmp" ]; }; - swapDevices = - [{ device = "/dev/disk/by-uuid/ca0ed3d7-8758-4ac7-b016-8b4cd9608ded"; }]; + swapDevices = [{ device = "/dev/disk/by-uuid/ca0ed3d7-8758-4ac7-b016-8b4cd9608ded"; }]; + systemd.user.services.fans = { + script = '' + liquidctl -m nzxt set sync speed 100 + ''; + wantedBy = [ "graphical-session.target" ]; + partOf = [ "graphical-session.target" ]; + }; services.udev.packages = [ pkgs.openrgb ]; services.udev.extraRules = '' - SUBSYSTEM=="tty", GROUP="dialout", ATTRS{interface}=="Black Magic GDB Server", SYMLINK+="ttyBmpGdb" - SUBSYSTEM=="tty", GROUP="dialout", ATTRS{interface}=="Black Magic UART Port", SYMLINK+="ttyBmpTarg" + SUBSYSTEM == "tty", GROUP="dialout", ATTRS{interface}=="Black Magic GDB Server", SYMLINK+="ttyBmpGdb" + SUBSYSTEM == "tty", GROUP="dialout", ATTRS{interface}=="Black Magic UART Port", SYMLINK+="ttyBmpTarg" ''; - - fonts.fonts = with pkgs; [ - (nerdfonts.override { fonts = [ "FiraCode" ]; }) - noto-fonts-cjk - noto-fonts-emoji - ]; - imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - networking.useDHCP = lib.mkDefault true; boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; boot.kernelModules = [ "i2c-dev" "kvm-amd" ]; + networking.useDHCP = lib.mkDefault true; networking.hostName = "NOcomputer"; } + + diff --git a/systems/NOlaptop.nix b/systems/NOlaptop.nix index e8ed9c2..413c587 100644 --- a/systems/NOlaptop.nix +++ b/systems/NOlaptop.nix @@ -1,6 +1,44 @@ -{ ... }: { +{ lib, modulesPath, pkgs, ... }: { + environment.systemPackages = with pkgs; [ + + ]; + + fileSystems."/home" = { + device = "/dev/disk/by-uuid/e4244a97-9b48-49f0-8093-782163045020"; + fsType = "btrfs"; + options = [ "subvol=home-snaps/0/snapshot" "noatime" "compress-force=zstd:3" ]; + }; + fileSystems."/home/tao/Games" = { + device = "/dev/disk/by-uuid/e4244a97-9b48-49f0-8093-782163045020"; + fsType = "btrfs"; + options = [ "subvol=games" "nosuid" "nodev" "noatime" "compress-force=zstd:3" "users" "rw" "exec" ]; + }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/e4244a97-9b48-49f0-8093-782163045020"; + fsType = "btrfs"; + options = [ "subvol=nixos" "noatime" "compress-force=zstd:3" ]; + }; + + swapDevices = [{ device = "/dev/disk/by-uuid/ca55d0ea-c0db-44c5-af3a-e38eec803929"; }]; + + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + + boot.initrd.availableKernelModules = [ + "nvme" + "sd_mod" + "thunderbolt" + "usb_storage" + "xhci_pci" + ]; boot.kernelParams = [ "mem_sleep_default=deep" "nvme.noacpi=1" ]; + boot.kernelModules = [ "kvm-intel" ]; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + + networking.useDHCP = lib.mkDefault true; + networking.hostName = "NOlaptop"; } diff --git a/users/tao.nix b/users/tao.nix index 3044706..e66054f 100644 --- a/users/tao.nix +++ b/users/tao.nix @@ -13,8 +13,7 @@ in keepassxc libsForQt5.kdeconnect-kde lldb - nix-prefetch-scripts - openrgb + # nix-prefetch-scripts starship tio unstable.nushell @@ -38,6 +37,12 @@ in }; }; + fonts.fonts = with pkgs; [ + (nerdfonts.override { fonts = [ "FiraCode" ]; }) + noto-fonts-cjk + noto-fonts-emoji + ]; + users.users.tao = { isNormalUser = true; extraGroups = [ "wheel" "libvirtd" "dialout" ];