hyprpanel: nixify

This commit is contained in:
Christoph Hollizeck 2025-08-18 20:51:25 +02:00
parent d12a96ff76
commit fe595e335d
Signed by: Daholli
GPG key ID: 249300664F2AF2C7
3 changed files with 578 additions and 583 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,35 @@
{
lib,
config,
pkgs,
namespace,
...
}:
let
inherit (lib) mkIf mkEnableOption;
cfg = config.${namespace}.system.hardware.gpu.amd;
amdvlk-run = pkgs.writeShellScriptBin "amdvlk-run" ''
export VK_DRIVER_FILES="${pkgs.amdvlk}/share/vulkan/icd.d/amd_icd64.json:${pkgs.pkgsi686Linux.amdvlk}/share/vulkan/icd.d/amd_icd32.json"
exec "$@"
'';
in
{
options.${namespace}.system.hardware.gpu.amd = {
enable = mkEnableOption "Enable AMD GPU";
};
config = mkIf cfg.enable {
hardware.graphics = {
enable = true;
enable32Bit = true;
};
environment = {
systemPackages = [ amdvlk-run ];
variables = {
AMD_VULKAN_ICD = "RADV";
};
};
};
}

View file

@ -0,0 +1,68 @@
# 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,
inputs,
pkgs,
modulesPath,
...
}:
let
inherit (inputs) nixos-hardware;
in
{
imports = with nixos-hardware.nixosModules; [
(modulesPath + "/installer/scan/not-detected.nix")
common-cpu-amd
common-pc
common-pc-ssd
];
boot.initrd.availableKernelModules = [
"nvme"
"ahci"
"xhci_pci"
"usbhid"
"usb_storage"
"sd_mod"
];
boot.kernelModules = [ "kvm-amd" ];
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/b1a956f4-91d5-456e-a92b-be505bb719bd";
fsType = "ext4";
};
"/boot" = {
device = "/dev/disk/by-uuid/B4D4-8BA0";
fsType = "vfat";
options = [
"fmask=0077"
"dmask=0077"
];
};
"/storage" = {
device = "/dev/disk/by-uuid/c3c1dec1-7716-4c37-a3f2-bb60f9af84fd";
fsType = "ext4";
};
};
swapDevices = [
{ device = "/dev/disk/by-uuid/4bec00ec-e9eb-4034-836a-ecf15e0bb40e"; }
];
# 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.enp14s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp15s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}