update configs for valere & kanbaru

This commit is contained in:
Kate 2024-11-08 19:57:54 -07:00
parent a236fcb45e
commit 592d2f3b31
8 changed files with 406 additions and 129 deletions

248
flake.lock generated
View file

@ -33,11 +33,11 @@
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1730257295,
"narHash": "sha256-OQl+aAsKiyygvpzck1u0sZf/R4T9zM903CgNDFmmzA8=",
"lastModified": 1730906442,
"narHash": "sha256-tBuyb8jWBSHHgcIrOfiyQJZGY1IviMzH2V74t7gWfgI=",
"owner": "zhaofengli",
"repo": "attic",
"rev": "48c8b395bfbc6b76c7eae74df6c74351255a095c",
"rev": "d0b66cf897e4d55f03d341562c9821dc4e566e54",
"type": "github"
},
"original": {
@ -162,11 +162,11 @@
]
},
"locked": {
"lastModified": 1730600078,
"narHash": "sha256-BoyFmE59HDF3uybBySsWVoyjNuHvz3Wv8row/mSb958=",
"lastModified": 1731032247,
"narHash": "sha256-OjLft7fwkmiRLXQsGAudGFZxEYXOT0nHwrQ9GbsBqJ4=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "4652874d014b82cb746173ffc64f6a70044daa7e",
"rev": "2fbf4a8417c28cf45bae6e6e97248cbbd9b78632",
"type": "github"
},
"original": {
@ -212,6 +212,22 @@
}
},
"flake-compat_2": {
"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_3": {
"flake": false,
"locked": {
"lastModified": 1673956053,
@ -359,21 +375,6 @@
"type": "github"
}
},
"flakey-profile": {
"locked": {
"lastModified": 1712898590,
"narHash": "sha256-FhGIEU93VHAChKEXx905TSiPZKga69bWl1VB37FK//I=",
"owner": "lf-",
"repo": "flakey-profile",
"rev": "243c903fd8eadc0f63d205665a92d4df91d42d9d",
"type": "github"
},
"original": {
"owner": "lf-",
"repo": "flakey-profile",
"type": "github"
}
},
"fromYaml": {
"flake": false,
"locked": {
@ -435,11 +436,11 @@
]
},
"locked": {
"lastModified": 1730633670,
"narHash": "sha256-ZFJqIXpvVKvzOVFKWNRDyIyAo+GYdmEPaYi1bZB6uf0=",
"lastModified": 1730837930,
"narHash": "sha256-0kZL4m+bKBJUBQse0HanewWO0g8hDdCvBhudzxgehqc=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "8f6ca7855d409aeebe2a582c6fd6b6a8d0bf5661",
"rev": "2f607e07f3ac7e53541120536708e824acccfaa8",
"type": "github"
},
"original": {
@ -471,52 +472,31 @@
}
},
"lix": {
"flake": false,
"locked": {
"lastModified": 1730610940,
"narHash": "sha256-ZsTpii4kZcioRF3bu3/pS374R9GYQVyrMpBNr2ZUnVg=",
"ref": "refs/heads/main",
"rev": "b1a0e3c0029c2dd5fb7c8dd2db4f9e0b309c9f54",
"revCount": 16445,
"type": "git",
"url": "https://git@git.lix.systems/lix-project/lix"
},
"original": {
"type": "git",
"url": "https://git@git.lix.systems/lix-project/lix"
}
},
"lix-module": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"flakey-profile": "flakey-profile",
"lix": [
"lix"
],
"nixpkgs": [
"nixpkgs"
]
"flake-compat": "flake-compat_2",
"nix2container": "nix2container",
"nixpkgs": "nixpkgs_3",
"nixpkgs-regression": "nixpkgs-regression",
"pre-commit-hooks": "pre-commit-hooks"
},
"locked": {
"lastModified": 1727752861,
"narHash": "sha256-jowmo2aEzrEpPSM96IWtajuogdJm7DjAWxFTEb7Ct0s=",
"lastModified": 1731087338,
"narHash": "sha256-9J8+Pyb/WtzZ+AU5XJLvpVSILN742z37C4CrbnYXkuo=",
"ref": "refs/heads/main",
"rev": "fd186f535a4ac7ae35d98c1dd5d79f0a81b7976d",
"revCount": 116,
"rev": "116895acb1fb5b09e8c1b867f345f6c8ca09647a",
"revCount": 16456,
"type": "git",
"url": "https://git@git.lix.systems/lix-project/nixos-module"
"url": "https://git@git.lix.systems/lix-project/lix"
},
"original": {
"type": "git",
"url": "https://git@git.lix.systems/lix-project/nixos-module"
"url": "https://git@git.lix.systems/lix-project/lix"
}
},
"nil": {
"inputs": {
"flake-utils": "flake-utils_3",
"nixpkgs": "nixpkgs_3",
"nixpkgs": "nixpkgs_4",
"rust-overlay": "rust-overlay"
},
"locked": {
@ -538,17 +518,17 @@
"flake-parts": "flake-parts_2",
"niri-stable": "niri-stable",
"niri-unstable": "niri-unstable",
"nixpkgs": "nixpkgs_4",
"nixpkgs": "nixpkgs_5",
"nixpkgs-stable": "nixpkgs-stable_2",
"xwayland-satellite-stable": "xwayland-satellite-stable",
"xwayland-satellite-unstable": "xwayland-satellite-unstable"
},
"locked": {
"lastModified": 1730666848,
"narHash": "sha256-2KV8r72ieAmsFeU6wzJhV7q24WIIO70u5LdRBgJGYgE=",
"lastModified": 1731077178,
"narHash": "sha256-ayB01Zz1qkV4IBqB597TIeYYsU2MBIzLDO13UmHdGWo=",
"owner": "sodiboo",
"repo": "niri-flake",
"rev": "22dfd130c044944b83017e646cca82d9ab2ad2a1",
"rev": "57d86eb5cc2c22dba5d97e3622ada05488c7d0a0",
"type": "github"
},
"original": {
@ -577,11 +557,11 @@
"niri-unstable": {
"flake": false,
"locked": {
"lastModified": 1730664018,
"narHash": "sha256-FBKtV07NQzb1l0UuxmKtW9wYTFWV9txjhrPMrZByTZ4=",
"lastModified": 1731072306,
"narHash": "sha256-jBbeNVgirzpj7lD5bYQSGJJMirU4Uw0lRPaPCHSst7Y=",
"owner": "YaLTeR",
"repo": "niri",
"rev": "4c2f49d566579ee9a7f7528bde03c24ebaefd6fe",
"rev": "c0829087da6c38e693e47a8b961f7d4aaa15a91e",
"type": "github"
},
"original": {
@ -678,6 +658,22 @@
"type": "github"
}
},
"nix2container": {
"flake": false,
"locked": {
"lastModified": 1724996935,
"narHash": "sha256-njRK9vvZ1JJsP8oV2OgkBrpJhgQezI03S7gzskCcHos=",
"owner": "nlewo",
"repo": "nix2container",
"rev": "fa6bb0a1159f55d071ba99331355955ae30b3401",
"type": "github"
},
"original": {
"owner": "nlewo",
"repo": "nix2container",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1703013332,
@ -738,6 +734,22 @@
"url": "https://github.com/NixOS/nixpkgs/archive/cc2f28000298e1269cea6612cd06ec9979dd5d7f.tar.gz"
}
},
"nixpkgs-regression": {
"locked": {
"lastModified": 1643052045,
"narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1724316499,
@ -756,11 +768,11 @@
},
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1730327045,
"narHash": "sha256-xKel5kd1AbExymxoIfQ7pgcX6hjw9jCgbiBjiUfSVJ8=",
"lastModified": 1730883749,
"narHash": "sha256-mwrFF0vElHJP8X3pFCByJR365Q2463ATp2qGIrDUdlE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "080166c15633801df010977d9d7474b4a6c549d7",
"rev": "dba414932936fde69f0606b4f1d87c5bc0003ede",
"type": "github"
},
"original": {
@ -786,6 +798,22 @@
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1727184566,
"narHash": "sha256-mgdK8BcFsLSNhe780+cHbEUbZ3OruLa1T/xgQlL4Aj4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "48c3030083c46042584531bc9d931020f1975677",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05-small",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1726481836,
"narHash": "sha256-MWTBH4dd5zIz2iatDb8IkqSjIeFum9jAqkFxgHLdzO4=",
@ -801,29 +829,13 @@
"type": "github"
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1730531603,
"narHash": "sha256-Dqg6si5CqIzm87sp57j5nTaeBbWhHFaVyG7V6L8k3lY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7ffd9ae656aec493492b44d0ddfb28e79a1ea25d",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_5": {
"locked": {
"lastModified": 1730531603,
"narHash": "sha256-Dqg6si5CqIzm87sp57j5nTaeBbWhHFaVyG7V6L8k3lY=",
"lastModified": 1730785428,
"narHash": "sha256-Zwl8YgTVJTEum+L+0zVAWvXAGbWAuXHax3KzuejaDyo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7ffd9ae656aec493492b44d0ddfb28e79a1ea25d",
"rev": "4aa36568d413aca0ea84a1684d2d46f55dbabad7",
"type": "github"
},
"original": {
@ -834,6 +846,22 @@
}
},
"nixpkgs_6": {
"locked": {
"lastModified": 1730785428,
"narHash": "sha256-Zwl8YgTVJTEum+L+0zVAWvXAGbWAuXHax3KzuejaDyo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4aa36568d413aca0ea84a1684d2d46f55dbabad7",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_7": {
"locked": {
"lastModified": 1725634671,
"narHash": "sha256-v3rIhsJBOMLR8e/RNWxr828tB+WywYIoajrZKFM+0Gg=",
@ -848,12 +876,12 @@
"type": "indirect"
}
},
"nixpkgs_7": {
"nixpkgs_8": {
"locked": {
"lastModified": 1729256560,
"narHash": "sha256-/uilDXvCIEs3C9l73JTACm4quuHUsIHcns1c+cHUJwA=",
"path": "/nix/store/riqkpszjqk02bi1wppfg8ip5xvh102qd-source",
"rev": "4c2fcb090b1f3e5b47eaa7bd33913b574a11e0a0",
"lastModified": 1730531603,
"narHash": "sha256-Dqg6si5CqIzm87sp57j5nTaeBbWhHFaVyG7V6L8k3lY=",
"path": "/nix/store/zq2axpgzd5kykk1v446rkffj3bxa2m2h-source",
"rev": "7ffd9ae656aec493492b44d0ddfb28e79a1ea25d",
"type": "path"
},
"original": {
@ -918,7 +946,7 @@
"openxc7": {
"inputs": {
"flake-utils": "flake-utils_4",
"nixpkgs": "nixpkgs_6"
"nixpkgs": "nixpkgs_7"
},
"locked": {
"lastModified": 1725961608,
@ -934,6 +962,22 @@
"type": "github"
}
},
"pre-commit-hooks": {
"flake": false,
"locked": {
"lastModified": 1726745158,
"narHash": "sha256-D5AegvGoEjt4rkKedmxlSEmC+nNLMBPWFxvmYnVLhjk=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "4e743a6920eab45e8ba0fbe49dc459f1423a4b74",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"agenix": "agenix",
@ -943,12 +987,11 @@
"flake-utils": "flake-utils_2",
"home-manager": "home-manager_2",
"lix": "lix",
"lix-module": "lix-module",
"nil": "nil",
"niri": "niri",
"nix-flatpak": "nix-flatpak",
"nix-on-droid": "nix-on-droid",
"nixpkgs": "nixpkgs_5",
"nixpkgs": "nixpkgs_6",
"openxc7": "openxc7",
"stylix": "stylix",
"waveforms": "waveforms"
@ -997,7 +1040,7 @@
"base16-fish": "base16-fish",
"base16-helix": "base16-helix",
"base16-vim": "base16-vim",
"flake-compat": "flake-compat_2",
"flake-compat": "flake-compat_3",
"flake-utils": "flake-utils_5",
"gnome-shell": "gnome-shell",
"home-manager": "home-manager_3",
@ -1010,11 +1053,11 @@
"tinted-tmux": "tinted-tmux"
},
"locked": {
"lastModified": 1729963473,
"narHash": "sha256-uGjTjvvlGQfQ0yypVP+at0NizI2nrb6kz4wGAqzRGbY=",
"lastModified": 1731090365,
"narHash": "sha256-ti3gXhgVpIUL/7w6zDJuH+hOnyTZqxrIX/yYqALmiEI=",
"owner": "danth",
"repo": "stylix",
"rev": "04afcfc0684d9bbb24bb1dc77afda7c1843ec93b",
"rev": "6863412636c8f2cb3b7360f747fbd020fbfddf68",
"type": "github"
},
"original": {
@ -1116,16 +1159,17 @@
"tinted-foot": {
"flake": false,
"locked": {
"lastModified": 1696725948,
"narHash": "sha256-65bz2bUL/yzZ1c8/GQASnoiGwaF8DczlxJtzik1c0AU=",
"lastModified": 1726913040,
"narHash": "sha256-+eDZPkw7efMNUf3/Pv0EmsidqdwNJ1TaOum6k7lngDQ=",
"owner": "tinted-theming",
"repo": "tinted-foot",
"rev": "eedbcfa30de0a4baa03e99f5e3ceb5535c2755ce",
"rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "tinted-foot",
"rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4",
"type": "github"
}
},
@ -1164,7 +1208,7 @@
},
"waveforms": {
"inputs": {
"nixpkgs": "nixpkgs_7"
"nixpkgs": "nixpkgs_8"
},
"locked": {
"lastModified": 1728376004,

View file

@ -14,16 +14,7 @@
flake-utils.url = "github:numtide/flake-utils";
# Not nix -- lix!
lix = {
url = "git+https://git@git.lix.systems/lix-project/lix";
flake = false;
};
lix-module = {
url = "git+https://git@git.lix.systems/lix-project/nixos-module";
inputs.lix.follows = "lix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
lix.url = "git+https://git@git.lix.systems/lix-project/lix";
# Home-manager.
home-manager = {
@ -84,7 +75,7 @@
darwin,
agenix,
nil,
lix-module,
lix,
niri,
stylix,
waveforms,
@ -133,6 +124,7 @@
glowing-bear-desktop = callPackage ./packages/glowing-bear-desktop.nix { };
hrvst-cli = callPackage ./packages/hrvst-cli { };
notion-app = callPackage ./packages/notion-app { inherit _7zz; };
gfn-electron = callPackage ./packages/geforce-now { };
# utilities
ykush = callPackage ./packages/ykush.nix { };
@ -213,6 +205,7 @@
./nixos/packages
./nixos/configs/stylix
./nixos/configs/lix.nix
./nixos/configs/nix.nix
./nixos/configs/dotfiles
./nixos/configs/calendar.nix
@ -222,7 +215,6 @@
./nixos/services/tailscale.nix
lix-module.nixosModules.default
home-manager.nixosModules.home-manager
];
@ -312,6 +304,7 @@
openxc7 = openxc7.outputs.packages.${system};
attic = attic.outputs.packages.${system};
esp-dev = esp-dev.outputs.packages.${system};
lix = lix.outputs.packages.${system};
# Helper to convert hm modules into NixOS or nix-on-droid modules.
callHm = module: (specialArgs: (import module) specialArgs);
@ -375,6 +368,20 @@
modules = linuxOfflineGuiModules [
./nixos/hosts/valere.nix
./nixos/configs/steam.nix
./nixos/configs/vmware.nix
./nixos/configs/power-saving.nix
];
};
# Kanbaru (not-quite-as-powerful-as-Valere laptop).
nixosConfigurations.kanbaru = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = mkSpecialArgs system;
modules = linuxOfflineGuiModules [
./nixos/hosts/kanbaru.nix
./nixos/configs/steam.nix
./nixos/configs/vmware.nix
./nixos/configs/power-saving.nix
];

5
nixos/configs/lix.nix Normal file
View file

@ -0,0 +1,5 @@
{ lix, ... }:
{
# Use lix, and not nix.
nix.package = lix.nix;
}

32
nixos/configs/steam.nix Normal file
View file

@ -0,0 +1,32 @@
#
# Provide steam; for gameyputers.
#
{ pkgs, ... }:
{
programs.steam = {
enable = true;
# Start our steam with appropriate environment vars set.
package = pkgs.steam.override {
extraEnv = {
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
};
};
# Allow Steam to provide services for other LAN units.
localNetworkGameTransfers.openFirewall = true;
remotePlay.openFirewall = true;
# Use extest to better support input on wayland.
extest.enable = true;
# Also allow running steam not-from-niri.
gamescopeSession.enable = true;
# Make more features available to steam.
extraPackages = with pkgs; [
gamescope
];
};
}

View file

@ -4,7 +4,7 @@
#
# vim: et:ts=2:sw=2:
#
{ pkgs, deprekages, ... }:
{ pkgs, deprekages, lib, ... }:
{
# Ensures the system state isn't changed breakingly (e.g. by updating

133
nixos/hosts/kanbaru.nix Normal file
View file

@ -0,0 +1,133 @@
#
# Per-system configuration for Kanbaru (Suruga).
#
# vim: et:ts=2:sw=2:
#
{
config,
lib,
pkgs,
deprekages,
modulesPath,
...
}:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Networking.
networking.hostName = "kanbaru";
networking.networkmanager.enable = true;
networking.firewall.enable = false;
# This is a local machine, rather than our typical network-accesed ones.
# Run an ssh-agent locally.
programs.ssh.startAgent = true;
environment.systemPackages = [
pkgs.nvitop
];
#
# Niri configuration for our monitors.
#
home-manager.users.deprekated.programs.niri.settings = {
outputs."eDP-1".scale = 1.5;
};
# Override stylix font sizes.
stylix.fonts.sizes.desktop = lib.mkForce 18;
#
# Intel+NVIDIA / prime setup.
#
services.xserver.videoDrivers = ["nvidia"];
# Set up the NVIDIA half of the GPU setup.
system.nixos.tags = ["NVIDIA" "AMDGPU"];
hardware.nvidia = {
modesetting.enable = true;
# Prefer the open NVIDIA driver.
open = true;
# Enable the nvidia-settings command.
nvidiaSettings = true;
# Offloading setup: use GPU when asked for by command, and not otherwise.
prime = {
sync.enable = true;
# Specify how to find our GPUs.
amdgpuBusId = "PCI:4:0:0";
nvidiaBusId = "PCI:1:0:0";
};
};
# Provide a way to disable the NVIDIA GPU entirely,
# for points when traveling where we don't want to burn power.
specialisation.lowpower.configuration = {
system.nixos.tags = lib.mkForce ["AMDGPU"];
# Disable the NVIDIA GPU.
hardware.nvidiaOptimus.disable = true;
# These don't actually do anything, but they make introspecting
# the configuration a bit nicer.
hardware.nvidia.modesetting.enable = lib.mkForce false;
hardware.nvidia.prime.sync.enable = lib.mkForce false;
};
#
# Hardware config.
#
boot.initrd.availableKernelModules = [
"xhci_pci"
"vmd"
"nvme"
"usbhid"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
# Support virtualization, thunderbolt, and poking the APCI directly. >.>
boot.kernelModules = [
"thunderbolt"
"acpi_call"
];
boot.extraModulePackages = [ config.boot.kernelPackages.acpi_call ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/bb880b80-992f-4e56-bb80-c5c4df0ddd72";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/5B37-C691";
fsType = "vfat";
options = [
"fmask=0022"
"dmask=0022"
];
};
swapDevices = [ { device = "/dev/disk/by-uuid/50f20263-9632-439d-b57d-b9ee8f13d62b"; } ];
# 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.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -6,6 +6,7 @@
{
config,
lib,
pkgs,
deprekages,
modulesPath,
...
@ -30,8 +31,9 @@
# Note on valere in particular this requires our overlay.
environment.systemPackages = [
deprekages.humanfx
deprekages.dell.fan
deprekages.dell.bios-fan-control
# NVIDIA tools.
pkgs.nvitop
];
#
@ -44,10 +46,48 @@
# Override stylix font sizes.
stylix.fonts.sizes.desktop = lib.mkForce 18;
# Save power!
services.udev.extraRules = ''
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030000", ATTR{power/control}="auto"
'';
#
# Intel+NVIDIA / prime setup.
#
services.xserver.videoDrivers = ["nvidia"];
# Set up the NVIDIA half of the GPU setup.
system.nixos.tags = ["NVIDIA" "Intel"];
hardware.nvidia = {
modesetting.enable = true;
# Prefer the open NVIDIA driver.
open = true;
# Enable the nvidia-settings command.
nvidiaSettings = true;
# Offloading setup: use GPU when asked for by command, and not otherwise.
prime = {
sync.enable = true;
# Specify how to find our GPUs.
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
};
# Provide a way to disable the NVIDIA GPU entirely,
# for points when traveling where we don't want to burn power.
specialisation.lowpower.configuration = {
system.nixos.tags = lib.mkForce ["Intel"];
# Disable the NVIDIA GPU.
hardware.nvidiaOptimus.disable = true;
# These don't actually do anything, but they make introspecting
# the configuration a bit nicer.
hardware.nvidia.modesetting.enable = lib.mkForce false;
hardware.nvidia.prime.sync.enable = lib.mkForce false;
};
#
# Hardware config.
@ -64,15 +104,8 @@
];
boot.initrd.kernelModules = [ ];
# Disallow nouveau so the NVIDIA device is available for VFIO.
boot.blacklistedKernelModules = [ "nouveau" ];
boot.extraModprobeConfig = ''
options nouveau modeset=0
'';
# Support virtualization, thunderbolt, and poking the APCI directly. >.>
boot.kernelModules = [
"kvm-intel"
"thunderbolt"
"acpi_call"
];

View file

@ -0,0 +1,23 @@
#
# GeForce now.
#
# vim: et:ts=2:sw=2:
{
appimageTools,
fetchurl,
}:
let
pname = "gfn-electron";
version = "2.1.2";
src = fetchurl {
url = "https://github.com/hmlendea/gfn-electron/releases/download/v2.1.2/geforcenow-electron_2.1.2_linux.AppImage";
hash = "sha256-0hsFGwPPbMuoman1b1CgsakJbHvhUyEPbxX18hlFOoM=";
};
appImageContent = appimageTools.extractType2 { inherit pname version src; };
in
appimageTools.wrapType2 {
inherit pname version src;
runScript = "appimage-exec.sh -w ${appImageContent} -- --ozone-platform-hint=auto --spoof-chromeos";
}