framework 16 day!

This commit is contained in:
Tao Tien 2024-03-18 22:45:19 -07:00
parent c9804239d3
commit 0f8a1aa7e1
7 changed files with 154 additions and 54 deletions

View file

@ -52,6 +52,7 @@
specialArgs = {inherit inputs;}; specialArgs = {inherit inputs;};
modules = [ modules = [
nixos-hardware.nixosModules.common-cpu-amd nixos-hardware.nixosModules.common-cpu-amd
nixos-hardware.nixosModules.common-cpu-amd-pstate
nixos-hardware.nixosModules.common-gpu-nvidia-nonprime nixos-hardware.nixosModules.common-gpu-nvidia-nonprime
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
# stylix.nixosModules.stylix # stylix.nixosModules.stylix
@ -69,10 +70,10 @@
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = {inherit inputs;}; specialArgs = {inherit inputs;};
modules = [ modules = [
nixos-hardware.nixosModules.common-cpu-intel nixos-hardware.nixosModules.common-cpu-amd
# inputs.nixos-hardware.nixosModules.framework-12th-gen-intel nixos-hardware.nixosModules.common-cpu-amd-pstate
nixos-hardware.nixosModules.common-gpu-amd
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
# stylix.nixosModules.stylix
./systems/BASED.nix ./systems/BASED.nix
./systems/NOlaptop.nix ./systems/NOlaptop.nix
./users/tao.nix ./users/tao.nix
@ -81,6 +82,39 @@
./extras/gaming.nix ./extras/gaming.nix
]; ];
}; };
NOmom = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {inherit inputs;};
modules = [
nixos-hardware.nixosModules.common-cpu-intel
# inputs.nixos-hardware.nixosModules.framework-12th-gen-intel
home-manager.nixosModules.home-manager
# stylix.nixosModules.stylix
./systems/BASED.nix
./systems/NOmom.nix
./users/tao.nix
./extras/uwuraid.nix
./extras/dev.nix
./extras/gaming.nix
];
};
NOiso = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {inherit inputs;};
modules = [
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
home-manager.nixosModules.home-manager
./systems/BASED.nix
./users/tao.nix
({lib, ...}: {
isoImage.squashfsCompression = "zstd";
networking.wireless.enable = false;
security.sudo-rs.enable = lib.mkForce false;
services.btrfs.autoScrub.enable = false;
system.stateVersion = lib.mkForce "24.05";
})
];
};
}; };
}; };
} }

1
result Symbolic link
View file

@ -0,0 +1 @@
/nix/store/0s7qbfkwgrvg31j2bq0659h04q1aj78z-nixos-24.05.20240316.c75037b-x86_64-linux.iso

View file

@ -106,8 +106,8 @@
boot.loader.systemd-boot.enable = lib.mkDefault true; boot.loader.systemd-boot.enable = lib.mkDefault true;
boot.loader.efi.canTouchEfiVariables = lib.mkDefault true; boot.loader.efi.canTouchEfiVariables = lib.mkDefault true;
boot.loader.timeout = 1; boot.loader.timeout = lib.mkForce 1;
boot.supportedFilesystems = ["ntfs"]; boot.supportedFilesystems = ["ntfs" "btrfs"];
systemd.extraConfig = '' systemd.extraConfig = ''
DefaultTimeoutStopSec=15s DefaultTimeoutStopSec=15s
''; '';

View file

@ -1,8 +1,6 @@
{pkgs, ...}: { {pkgs, ...}: {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
# prescurve # prescurve
# libsForQt5.skanpage
intel-gpu-tools
powertop powertop
fw-ectool fw-ectool
]; ];
@ -10,46 +8,26 @@
powerManagement.powertop.enable = true; powerManagement.powertop.enable = true;
services.fwupd.enable = true; services.fwupd.enable = true;
services.fprintd.enable = true; services.fprintd.enable = true;
hardware.sensor.iio.enable = true;
services.xserver.displayManager.defaultSession = "plasma"; services.xserver.displayManager.defaultSession = "plasma";
services.xserver.displayManager.sddm.wayland.enable = true; services.xserver.displayManager.sddm.wayland.enable = true;
# systemd.user.services.backlight = {
# # description = "";
# ExecStart = "${pkgs.prescurve}/bin/prescurve_backlight";
# Restart = "on-failure";
# wantedBy = [ "default.target" ];
# };
# hardware.sane = {
# enable = true;
# extraBackends = [ pkgs.epkowa ];
# };
services.udev.extraRules = ''
# Ethernet expansion card
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0bda", ATTR{idProduct}=="8156", ATTR{power/autosuspend}="20"
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chmod g+w /sys/class/backlight/%k/brightness"
'';
fileSystems."/home" = { fileSystems."/home" = {
device = "/dev/disk/by-uuid/e4244a97-9b48-49f0-8093-782163045020"; device = "/dev/disk/by-uuid/2e1ba9af-4224-48a3-b935-519947da97db";
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=home-snaps/0/snapshot" "noatime" "compress-force=zstd:3" "discard=async"]; options = ["subvol=home" "noatime" "compress-force=zstd:3" "discard=async"];
};
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" "discard=async"];
}; };
# 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" "discard=async"];
# };
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/e4244a97-9b48-49f0-8093-782163045020"; device = "/dev/disk/by-uuid/2e1ba0af-4224-48a3-b935-519947da97db";
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=nixos" "noatime" "compress-force=zstd:3" "discard=async"]; options = ["subvol=nixos" "noatime" "compress-force=zstd:3" "discard=async"];
}; };
swapDevices = [{device = "/dev/disk/by-uuid/ca55d0ea-c0db-44c5-af3a-e38eec803929";}]; swapDevices = [{device = "/dev/disk/by-uuid/36216521-db46-4bb0-8994-38a36d5c4528";}];
boot.kernelPackages = pkgs.linuxPackages_latest; boot.kernelPackages = pkgs.linuxPackages_latest;
boot.initrd.availableKernelModules = [ boot.initrd.availableKernelModules = [
@ -58,20 +36,12 @@
"thunderbolt" "thunderbolt"
"usb_storage" "usb_storage"
"xhci_pci" "xhci_pci"
"usbhid"
"uas"
]; ];
boot.kernelParams = [ boot.kernelModules = ["kvm-amd"];
"acpi_osi=\"!Windows 2020\""
"mem_sleep_default=s2idle"
"nvme.noacpi=1"
"i915.enable_psr=1"
];
boot.blacklistedKernelModules = ["cros-usbpd-charger"];
boot.extraModprobeConfig = ''options snd-hda-intel model=dell-headset-multi'';
boot.kernelModules = ["kvm-intel"];
powerManagement.cpuFreqGovernor = "powersave"; powerManagement.cpuFreqGovernor = "powersave";
systemd.sleep.extraConfig = "HibernateDelaySec=180m"; systemd.sleep.extraConfig = "HibernateDelaySec=180m";
# boot.kernel.sysctl."net.ipv4.ip_forward" = "1";
# boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = "1";
networking.hostName = "NOlaptop"; networking.hostName = "NOlaptop";
} }

77
systems/NOmom.nix Normal file
View file

@ -0,0 +1,77 @@
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
# prescurve
# libsForQt5.skanpage
intel-gpu-tools
powertop
fw-ectool
];
powerManagement.powertop.enable = true;
services.fwupd.enable = true;
services.fprintd.enable = true;
hardware.sensor.iio.enable = true;
services.xserver.displayManager.defaultSession = "plasma";
services.xserver.displayManager.sddm.wayland.enable = true;
# systemd.user.services.backlight = {
# # description = "";
# ExecStart = "${pkgs.prescurve}/bin/prescurve_backlight";
# Restart = "on-failure";
# wantedBy = [ "default.target" ];
# };
# hardware.sane = {
# enable = true;
# extraBackends = [ pkgs.epkowa ];
# };
services.udev.extraRules = ''
# Ethernet expansion card
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0bda", ATTR{idProduct}=="8156", ATTR{power/autosuspend}="20"
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chmod g+w /sys/class/backlight/%k/brightness"
'';
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" "discard=async"];
};
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" "discard=async"];
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/e4244a97-9b48-49f0-8093-782163045020";
fsType = "btrfs";
options = ["subvol=nixos" "noatime" "compress-force=zstd:3" "discard=async"];
};
swapDevices = [{device = "/dev/disk/by-uuid/ca55d0ea-c0db-44c5-af3a-e38eec803929";}];
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.initrd.availableKernelModules = [
"nvme"
"sd_mod"
"thunderbolt"
"usb_storage"
"xhci_pci"
];
boot.kernelParams = [
"acpi_osi=\"!Windows 2020\""
"mem_sleep_default=s2idle"
"nvme.noacpi=1"
"i915.enable_psr=1"
];
boot.blacklistedKernelModules = ["cros-usbpd-charger"];
boot.extraModprobeConfig = ''options snd-hda-intel model=dell-headset-multi'';
boot.kernelModules = ["kvm-intel"];
powerManagement.cpuFreqGovernor = "powersave";
systemd.sleep.extraConfig = "HibernateDelaySec=180m";
# boot.kernel.sysctl."net.ipv4.ip_forward" = "1";
# boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = "1";
networking.hostName = "NOlaptop";
}

View file

@ -50,6 +50,7 @@
prusa-slicer prusa-slicer
qmk qmk
qmk-udev-rules qmk-udev-rules
qmk_hid
ripgrep-all ripgrep-all
snapper snapper
starship starship
@ -88,12 +89,12 @@
# ''; # '';
# obs virtual camera # obs virtual camera
# boot.extraModulePackages = with config.boot.kernelPackages; [ boot.extraModulePackages = with config.boot.kernelPackages; [
# v4l2loopback v4l2loopback
# ]; ];
# boot.extraModprobeConfig = '' boot.extraModprobeConfig = ''
# options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1 options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1
# ''; '';
# stylix.autoEnable = false; # stylix.autoEnable = false;
# stylix.image = /home/tao/Pictures/Wallpapers/DJI_0121.JPG; # stylix.image = /home/tao/Pictures/Wallpapers/DJI_0121.JPG;

View file

@ -1,9 +1,26 @@
{pkgs, ...}: { {pkgs, ...}: {
users.users.vy.packages = with pkgs; [ users.users.vy.packages = with pkgs; [
audacity
firefox
jellyfin-media-player
keepassxc
libsForQt5.kdeconnect-kde
mpv
onlyoffice-bin
snapper
syncthingtray
wezterm
yt-dlp
zoom-us
];
fonts.packages = with pkgs; [
noto-fonts-cjk
noto-fonts-color-emoji
]; ];
users.users.vy = { users.users.vy = {
isNormalUser = true; isNormalUser = true;
extraGroups = ["scanner" "lp"]; extraGroups = ["audio" "video"];
}; };
} }