update nvidia driver, install ghostty and other things

This commit is contained in:
Ulic-youthlic 2024-12-28 18:56:04 +08:00
parent 9a525dadfc
commit 19ef41633b
11 changed files with 319 additions and 166 deletions

View file

@ -4,66 +4,53 @@
{
pkgs,
lib,
config,
inputs,
...
}:
{
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
hardware.graphics = {
enable = true;
};
services.xserver.videoDrivers = [
"nvidia"
];
services.asusd = {
enable = true;
};
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
open = false;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.beta;
prime = {
sync.enable = true;
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
};
networking.hostName = "Tytonidae"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# services.asusd = {
# enable = true;
# };
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
programs.virt-manager.enable = true;
virtualisation = {
libvirtd.enable = true;
spiceUSBRedirection.enable = true;
};
# Enable networking
networking.networkmanager.enable = true;
networking = {
hostName = "Tytonidae";
networkmanager.enable = false;
useNetworkd = true;
useDHCP = false;
};
systemd.network = {
enable = true;
wait-online.enable = false;
networks = {
"eno2" = {
matchConfig.Name = "eno2";
networkConfig = {
DHCP = "yes";
IPv6AcceptRA = true;
};
};
};
};
# Set your time zone.
time.timeZone = "Asia/Shanghai";
# Select internationalisation properties.
i18n.defaultLocale = "zh_CN.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "zh_CN.UTF-8";
LC_IDENTIFICATION = "zh_CN.UTF-8";
@ -179,12 +166,9 @@
description = "david";
extraGroups = [
"networkmanager"
"libvirtd"
"wheel"
];
# packages = with pkgs; [
# kdePackages.kate
# # thunderbird
# ];
};
# Install firefox.
@ -194,12 +178,11 @@
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
wget
git
vim
inputs.helix.packages."${pkgs.system}".default
helix
nixd
nixfmt-rfc-style
noto-fonts-cjk-sans
@ -217,14 +200,11 @@
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions

258
flake.lock generated
View file

@ -16,6 +16,22 @@
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1717312683,
@ -31,7 +47,7 @@
"type": "github"
}
},
"flake-compat_2": {
"flake-compat_3": {
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
@ -88,6 +104,24 @@
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1705309234,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
@ -102,9 +136,9 @@
"type": "github"
}
},
"flake-utils_2": {
"flake-utils_3": {
"inputs": {
"systems": "systems_3"
"systems": "systems_4"
},
"locked": {
"lastModified": 1710146030,
@ -120,9 +154,9 @@
"type": "github"
}
},
"flake-utils_3": {
"flake-utils_4": {
"inputs": {
"systems": "systems_4"
"systems": "systems_5"
},
"locked": {
"lastModified": 1726560853,
@ -155,6 +189,27 @@
"type": "github"
}
},
"ghostty": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs-stable": "nixpkgs-stable",
"nixpkgs-unstable": "nixpkgs-unstable",
"zig": "zig"
},
"locked": {
"lastModified": 1735362327,
"narHash": "sha256-kD49xAUMCWU60IRKoJiyJTaEUum7rk45OYjZfwWr3Ck=",
"owner": "ghostty-org",
"repo": "ghostty",
"rev": "6cbd69da7839260508466f9dfb2bc0c0fbb43991",
"type": "github"
},
"original": {
"owner": "ghostty-org",
"repo": "ghostty",
"type": "github"
}
},
"harfbuzz": {
"flake": false,
"locked": {
@ -175,18 +230,18 @@
"helix": {
"inputs": {
"crane": "crane",
"flake-utils": "flake-utils",
"flake-utils": "flake-utils_2",
"nixpkgs": [
"nixpkgs"
],
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1735007176,
"narHash": "sha256-mSOyNzD0ie1q6KdktAwXD0mBGmcb41BEF0UqLmuvFEE=",
"lastModified": 1735311473,
"narHash": "sha256-PIAQe6E07XFYYwv0ARV9oqgV/d30etcMKEEBzyyI1NU=",
"owner": "helix-editor",
"repo": "helix",
"rev": "9e77c44b38e6e30431fc80e2b011f45f288f2be5",
"rev": "a5a7cff311e909ecab41f840742a5309634aeec3",
"type": "github"
},
"original": {
@ -203,11 +258,11 @@
]
},
"locked": {
"lastModified": 1734992499,
"narHash": "sha256-f9UyHMTb+BwF6RDZ8eO9HOkSlKeeSPBlcYhMmV1UNIk=",
"lastModified": 1735343815,
"narHash": "sha256-p7IJP/97zJda/wwCn1T2LJBz4olF5LjNf4uwhuyvARo=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "f1b1786ea77739dcd181b920d430e30fb1608b8a",
"rev": "b7a7cd5dd1a74a9fe86ed4e016f91c78483b527a",
"type": "github"
},
"original": {
@ -255,24 +310,6 @@
"type": "github"
}
},
"musnix": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1734848678,
"narHash": "sha256-HtGPXGyzOsHJLq6nwvBV763y6l7fC9FuWIM0hNh1Y6E=",
"owner": "musnix",
"repo": "musnix",
"rev": "e76b3cdd23d49a11210a551f8ea4d49d7022e639",
"type": "github"
},
"original": {
"owner": "musnix",
"repo": "musnix",
"type": "github"
}
},
"nix-citizen": {
"inputs": {
"nix-gaming": [
@ -285,7 +322,7 @@
"nixpkgs-unstable"
],
"nixpkgs-wine": "nixpkgs-wine",
"systems": "systems_2",
"systems": "systems_3",
"treefmt-nix": "treefmt-nix_2"
},
"locked": {
@ -350,17 +387,17 @@
},
"nixos-cosmic": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs": "nixpkgs_2",
"nixpkgs-stable": "nixpkgs-stable",
"flake-compat": "flake-compat_2",
"nixpkgs": "nixpkgs",
"nixpkgs-stable": "nixpkgs-stable_2",
"rust-overlay": "rust-overlay_2"
},
"locked": {
"lastModified": 1735004289,
"narHash": "sha256-cJmBhr59xQXwkvF+EZPhKTebgHyqXoei8u2Qq2QJYzE=",
"lastModified": 1735362320,
"narHash": "sha256-nNPTwaTLwMFX4Y0ugxwubIw2LJ+qt2g2FrwBVjRr1zI=",
"owner": "lilyinstarlight",
"repo": "nixos-cosmic",
"rev": "b9bfb93c7632a0e007a3a05fe77c0475d05e045a",
"rev": "7da43ac24467b538ae5f07117709665b189887fd",
"type": "github"
},
"original": {
@ -369,13 +406,29 @@
"type": "github"
}
},
"nixos-hardware": {
"locked": {
"lastModified": 1734954597,
"narHash": "sha256-QIhd8/0x30gEv8XEE1iAnrdMlKuQ0EzthfDR7Hwl+fk=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "def1d472c832d77885f174089b0d34854b007198",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "master",
"repo": "nixos-hardware",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1734424634,
"narHash": "sha256-cHar1vqHOOyC7f1+tVycPoWTfKIaqkoe1Q6TnKzuti4=",
"lastModified": 1735291276,
"narHash": "sha256-NYVcA06+blsLG6wpAbSPTCyLvxD/92Hy4vlY9WxFI1M=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d3c42f187194c26d9f0309a8ecc469d6c878ce33",
"rev": "634fd46801442d760e09493a794c4f15db2d0cbb",
"type": "github"
},
"original": {
@ -399,11 +452,27 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1734875076,
"narHash": "sha256-Pzyb+YNG5u3zP79zoi8HXYMs15Q5dfjDgwCdUI5B0nY=",
"lastModified": 1733423277,
"narHash": "sha256-TxabjxEgkNbCGFRHgM/b9yZWlBj60gUOUnRT/wbVQR8=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "e36963a147267afc055f7cf65225958633e536bf",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "release-24.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1735141468,
"narHash": "sha256-VIAjBr1qGcEbmhLwQJD6TABppPMggzOvqFsqkDoMsAY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1807c2b91223227ad5599d7067a61665c52d1295",
"rev": "4005c3ff7505313cbc21081776ad0ce5dfd7a3ce",
"type": "github"
},
"original": {
@ -414,6 +483,22 @@
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1733229606,
"narHash": "sha256-FLYY5M0rpa5C2QAE3CKLYAM6TwbKicdRK6qNrSHlNrE=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "566e53c2ad750c84f6d31f9ccb9d00f823165550",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable_2": {
"locked": {
"lastModified": 1731676054,
"narHash": "sha256-OZiZ3m8SCMfh3B6bfGC/Bm4x3qc1m2SVEAlkV6iY7Yg=",
@ -447,27 +532,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1734649271,
"narHash": "sha256-4EVBRhOjMDuGtMaofAIqzJbg4Ql7Ai0PSeuVZTHjyKQ=",
"lastModified": 1735291276,
"narHash": "sha256-NYVcA06+blsLG6wpAbSPTCyLvxD/92Hy4vlY9WxFI1M=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d70bd19e0a38ad4790d3913bf08fcbfc9eeca507",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1734649271,
"narHash": "sha256-4EVBRhOjMDuGtMaofAIqzJbg4Ql7Ai0PSeuVZTHjyKQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d70bd19e0a38ad4790d3913bf08fcbfc9eeca507",
"rev": "634fd46801442d760e09493a794c4f15db2d0cbb",
"type": "github"
},
"original": {
@ -486,11 +555,11 @@
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1735016833,
"narHash": "sha256-TCRPRQwSOH6MpzT5ammZ6WPlTZI7X/utb4zbfpKRmZc=",
"lastModified": 1735367808,
"narHash": "sha256-OdwpdXcrLpZfxQVECzzDzYDnxWl8M0iyryX2Hyg0J7A=",
"owner": "nix-community",
"repo": "NUR",
"rev": "de911159a966fefa1ae88a9ab6da365e134103c8",
"rev": "db1a42be19ec69ba2e7f92f62dfc102ef1d2a91c",
"type": "github"
},
"original": {
@ -522,7 +591,7 @@
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-unstable": "nixpkgs-unstable",
"nixpkgs-unstable": "nixpkgs-unstable_2",
"nur": "nur_2",
"rust-overlay": "rust-overlay_3",
"winapps": "winapps",
@ -545,11 +614,12 @@
},
"root": {
"inputs": {
"ghostty": "ghostty",
"helix": "helix",
"home-manager": "home-manager",
"musnix": "musnix",
"nixos-cosmic": "nixos-cosmic",
"nixpkgs": "nixpkgs_3",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_2",
"nur": "nur",
"oskars-dotfiles": "oskars-dotfiles",
"wezterm": "wezterm"
@ -584,11 +654,11 @@
]
},
"locked": {
"lastModified": 1734834660,
"narHash": "sha256-bm8V+Cu8rWJA+vKQnc94mXTpSDgvedyoDKxTVi/uJfw=",
"lastModified": 1735266518,
"narHash": "sha256-2XkWYGgT+911gOLjgBj+8W8ZJk6P0qHJNz8RfKgT/5o=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "b070e6030118680977bc2388868c4b3963872134",
"rev": "e0b3654b716098b47f3643c65fbb75ef49c033e1",
"type": "github"
},
"original": {
@ -699,6 +769,21 @@
"type": "github"
}
},
"systems_5": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
@ -770,7 +855,7 @@
},
"wezterm": {
"inputs": {
"flake-utils": "flake-utils_3",
"flake-utils": "flake-utils_4",
"freetype2": "freetype2",
"harfbuzz": "harfbuzz",
"libpng": "libpng",
@ -799,8 +884,8 @@
},
"winapps": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_2",
"flake-compat": "flake-compat_3",
"flake-utils": "flake-utils_3",
"nixpkgs": [
"oskars-dotfiles",
"nixpkgs"
@ -841,6 +926,31 @@
"type": "github"
}
},
"zig": {
"inputs": {
"flake-compat": [
"ghostty"
],
"flake-utils": "flake-utils",
"nixpkgs": [
"ghostty",
"nixpkgs-stable"
]
},
"locked": {
"lastModified": 1717848532,
"narHash": "sha256-d+xIUvSTreHl8pAmU1fnmkfDTGQYCn2Rb/zOwByxS2M=",
"owner": "mitchellh",
"repo": "zig-overlay",
"rev": "02fc5cc555fc14fda40c42d7c3250efa43812b43",
"type": "github"
},
"original": {
"owner": "mitchellh",
"repo": "zig-overlay",
"type": "github"
}
},
"zlib": {
"flake": false,
"locked": {

View file

@ -24,7 +24,8 @@
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-cosmic.url = "github:lilyinstarlight/nixos-cosmic";
musnix.url = "github:musnix/musnix";
ghostty.url = "github:ghostty-org/ghostty";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
};
outputs =
{
@ -45,18 +46,18 @@
substituters = [ "https://cosmic.cachix.org/" ];
trusted-public-keys = [ "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" ];
};
nixpkgs.overlays = [
(final: prev: {
helix = inputs.helix.packages."${system}".default;
})
];
}
inputs.musnix.nixosModules.musnix
(
{ ... }:
{
musnix.enable = true;
}
)
inputs.nixos-hardware.nixosModules.asus-fx506hm
inputs.nixos-cosmic.nixosModules.default
nur.modules.nixos.default
nur.legacyPackages."${system}".repos.iopq.modules.xraya
./configuration.nix
./hardware-configuration.nix
home-manager.nixosModules.home-manager
./users
];

View file

@ -1,32 +1,48 @@
# 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, ... }:
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usbhid" "usb_storage" "uas" "sd_mod" ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"thunderbolt"
"nvme"
"usbhid"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/a9270d79-f6f2-49fb-a238-703c7d024189";
fsType = "ext4";
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/b638dbc9-8945-482d-9d10-193271d3df98";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/74CC-54B3";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/1d8a740c-787e-450b-a934-243b93865d91"; }
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/A779-6930";
fsType = "vfat";
options = [
"fmask=0077"
"dmask=0077"
];
};
swapDevices = [
{ device = "/dev/disk/by-uuid/7f7e95f2-8f2a-4998-bd71-01466e8ecc98"; }
];
# 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

View file

@ -16,10 +16,6 @@
./spotify.nix
];
programs.fish.enable = true;
# programs.coolercontrol = {
# enable = true;
# nvidiaSupport = true;
# };
users.users.david.shell = pkgs.fish;
users.users.david.openssh.authorizedKeys.keyFiles = [
./tytonidae.pub
@ -31,5 +27,7 @@
vlc
btop
handbrake
wechat-uos
nvtopPackages.full
];
}

View file

@ -1,6 +1,7 @@
{
pkgs,
config,
ghostty,
...
}:
{
@ -12,6 +13,7 @@
./rime-ice.nix
./firefox.nix
./foot
./ghostty
];
xdg.userDirs = {
enable = true;
@ -38,6 +40,7 @@
enable = true;
plugins = with pkgs.obs-studio-plugins; [
obs-source-record
input-overlay
];
};
home.packages = with pkgs; [
@ -47,9 +50,9 @@
which
gnused
gnutar
bat
gawk
zstd
gnupg
tree
nerd-fonts.victor-mono
ouch
@ -57,6 +60,7 @@
qq
telegram-desktop
taplo
ghostty.packages."${pkgs.system}".default
];
programs.ssh = {
enable = true;
@ -78,4 +82,18 @@
};
};
};
programs.chromium = {
enable = true;
commandLineArgs = [
"--ozone-platform=wayland"
"--enable-wayland-ime=true"
"--enable-features=UseOzonePlatform"
];
};
dconf.settings = {
"org/virt-manager/virt-manager/connections" = {
autoconnect = [ "qemu:///system" ];
uris = [ "qemu:///system" ];
};
};
}

View file

@ -39,10 +39,10 @@
enableFishIntegration = true;
enable = true;
};
zellij = {
enable = true;
enableFishIntegration = true;
};
# zellij = {
# enable = true;
# enableFishIntegration = true;
# };
direnv = {
enable = true;
nix-direnv.enable = true;

View file

@ -0,0 +1,19 @@
font-family = FiraCode Nerd Font
font-feature = "calt=1"
font-feature = "clig=1"
font-feature = "liga=1"
font-feature = "cv01"
font-feature = "cv02"
font-feature = "cv06"
font-feature = "zero"
font-feature = "onum"
font-feature = "cv17"
font-feature = "ss05"
font-feature = "ss03"
font-feature = "cv16"
font-feature = "cv31"
font-feature = "cv29"
font-feature = "cv30"
font-size = 17
theme = ayu
background-opacity = 0.8

View file

@ -0,0 +1,9 @@
{
config,
...
}:
{
xdg.configFile."ghostty/config" = {
source = config.lib.file.mkOutOfStoreSymlink ./config/config;
};
}

View file

@ -1,8 +1,7 @@
{ pkgs, helix, ... }:
{ ... }:
{
programs.helix = {
enable = true;
package = helix.packages."${pkgs.system}".default;
defaultEditor = true;
settings =
let

View file

@ -1,9 +1,12 @@
{ ... }:
{
programs.steam = {
enable = true;
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
config = {
hardware.graphics.enable32Bit = true;
programs.steam = {
enable = true;
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
};
};
}