From 729496b421fd54c7cdf8356803cdcad719c57a03 Mon Sep 17 00:00:00 2001 From: haras-unicorn Date: Thu, 17 Sep 2026 09:58:51 +0000 Subject: [PATCH] feat(machines): init gabi --- assets/hardware/gabi.json | 1238 ++++++++++++++++++++ flake.lock | 47 +- flake.nix | 9 +- src/cspell.yaml | 1 + src/deprecated/comfyui.nix | 4 +- src/deprecated/mistral-rs.nix | 5 +- src/deprecated/ollama-openwebui.nix | 4 +- src/dev/default.nix | 4 + src/machines/gabi.nix | 11 + src/modules/ai/llama-cpp.nix | 12 +- src/modules/ai/stable-diffusion-cpp.nix | 4 +- src/modules/ai/whisper-cpp.nix | 4 +- src/modules/desktop/toolbelt/default.nix | 60 +- src/modules/desktop/xdg.nix | 56 +- src/modules/hardware/nvidia/default.nix | 7 +- src/modules/hardware/wsl.nix | 55 + src/modules/meta/commands.nix | 66 +- src/modules/meta/hardware.nix | 13 + src/modules/meta/programs.nix | 21 +- src/modules/nix/nix.nix | 4 +- src/modules/nix/nixpkgs.nix | 23 +- src/modules/programs/wf-recorder-slurp.nix | 2 +- src/modules/services/syncthing.nix | 4 +- 23 files changed, 1531 insertions(+), 123 deletions(-) create mode 100644 assets/hardware/gabi.json create mode 100644 src/machines/gabi.nix create mode 100644 src/modules/hardware/wsl.nix diff --git a/assets/hardware/gabi.json b/assets/hardware/gabi.json new file mode 100644 index 000000000..b343dbd06 --- /dev/null +++ b/assets/hardware/gabi.json @@ -0,0 +1,1238 @@ +{ + "version": 1, + "system": "x86_64-linux", + "virtualisation": "wsl", + "uefi": { + "supported": false + }, + "hardware": { + "bios": { + "apm_info": { + "supported": false, + "enabled": false, + "version": 0, + "sub_version": 0, + "bios_flags": 0 + }, + "vbe_info": { + "version": 0, + "video_memory": 0 + }, + "pnp": false, + "pnp_id": 0, + "lba_support": false, + "low_memory_size": 0, + "smbios_version": 0 + }, + "cpu": [ + { + "architecture": "x86_64", + "vendor_name": "AuthenticAMD", + "model_name": "AMD Ryzen 5 5600X 6-Core Processor", + "family": 25, + "model": 33, + "stepping": 0, + "features": [ + "fpu", + "vme", + "de", + "pse", + "tsc", + "msr", + "pae", + "mce", + "cx8", + "apic", + "sep", + "mtrr", + "pge", + "mca", + "cmov", + "pat", + "pse36", + "clflush", + "mmx", + "fxsr", + "sse", + "sse2", + "ht", + "syscall", + "nx", + "mmxext", + "fxsr_opt", + "pdpe1gb", + "rdtscp", + "lm", + "rep_good", + "nopl", + "cpuid", + "extd_apicid", + "tsc_known_freq", + "pni", + "pclmulqdq", + "ssse3", + "fma", + "cx16", + "sse4_1", + "sse4_2", + "movbe", + "popcnt", + "aes", + "xsave", + "avx", + "f16c", + "rdrand", + "hypervisor", + "lahf_lm", + "cmp_legacy", + "cr8_legacy", + "abm", + "sse4a", + "misalignsse", + "3dnowprefetch", + "osvw", + "topoext", + "ibrs", + "ibpb", + "stibp", + "vmmcall", + "fsgsbase", + "bmi1", + "avx2", + "smep", + "bmi2", + "erms", + "rdseed", + "adx", + "smap", + "clflushopt", + "clwb", + "sha_ni", + "xsaveopt", + "xsavec", + "xgetbv1", + "xsaves", + "clzero", + "xsaveerptr", + "arat", + "umip", + "vaes", + "vpclmulqdq", + "rdpid", + "fsrm" + ], + "bugs": [ + "sysret_ss_attrs", + "null_seg", + "spectre_v1", + "spectre_v2", + "spec_store_bypass", + "srso", + "ibpb_no_ret", + "spectre_v2_user", + "tsa" + ], + "power_management": [""], + "bogo": 7408, + "cache": 512, + "units": 16, + "page_size": 4096, + "physical_id": 0, + "siblings": 12, + "cores": 6, + "fpu": false, + "fpu_exception": false, + "cpuid_level": 13, + "write_protect": false, + "tlb_size": 2560, + "clflush_size": 64, + "cache_alignment": 64, + "address_sizes": { + "physical": "0x30", + "virtual": "0x30" + } + } + ], + "disk": [ + { + "index": 23, + "attached_to": 0, + "class_list": ["disk", "block_device"], + "base_class": { + "hex": "0106", + "name": "Mass Storage Device", + "value": 262 + }, + "sub_class": { + "hex": "0000", + "name": "Disk", + "value": 0 + }, + "model": "Disk", + "sysfs_id": "/class/block/ram2", + "unix_device_names": ["/dev/ram2"], + "resources": [ + { + "type": "size", + "unit": "sectors", + "value_1": 8192, + "value_2": 512 + } + ] + }, + { + "index": 24, + "attached_to": 20, + "class_list": ["disk", "scsi", "block_device"], + "bus_type": { + "hex": "0084", + "name": "SCSI", + "value": 132 + }, + "slot": { + "bus": 0, + "number": 0 + }, + "base_class": { + "hex": "0106", + "name": "Mass Storage Device", + "value": 262 + }, + "sub_class": { + "hex": "0000", + "name": "Disk", + "value": 0 + }, + "vendor": { + "hex": "0000", + "name": "Msft", + "value": 0 + }, + "device": { + "hex": "0000", + "name": "Virtual Disk", + "value": 0 + }, + "revision": { + "hex": "0000", + "name": "1.0", + "value": 0 + }, + "model": "Msft Virtual Disk", + "sysfs_id": "/class/block/sdd", + "sysfs_bus_id": "0:0:0:3", + "sysfs_device_link": "/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/fd1d2cbd-ce7c-535c-966b-eb5f811c95f0/host0/target0:0:0/0:0:0:3", + "unix_device_names": [ + "/dev/disk/by-id/scsi-3600224806d5133c78557ba74dcaaee5b", + "/dev/disk/by-id/wwn-0x600224806d5133c78557ba74dcaaee5b", + "/dev/disk/by-path/acpi-VMBUS:00-vmbus-fd1d2cbdce7c535c966beb5f811c95f0-lun-3", + "/dev/disk/by-uuid/b17bcbfb-0ff9-4977-a52d-d7f2f7d804cc", + "/dev/sdd" + ], + "unix_device_name2": "/dev/sg3", + "resources": [ + { + "type": "disk_geo", + "cylinders": 133674, + "heads": 255, + "sectors": 63, + "size": "0x0", + "geo_type": "logical" + }, + { + "type": "size", + "unit": "sectors", + "value_1": 2147483648, + "value_2": 512 + } + ], + "driver": "hv_storvsc", + "driver_module": "hv_storvsc", + "drivers": ["hv_storvsc", "sd"], + "driver_modules": ["hv_storvsc"] + }, + { + "index": 25, + "attached_to": 0, + "class_list": ["disk", "block_device"], + "base_class": { + "hex": "0106", + "name": "Mass Storage Device", + "value": 262 + }, + "sub_class": { + "hex": "0000", + "name": "Disk", + "value": 0 + }, + "model": "Disk", + "sysfs_id": "/class/block/ram0", + "unix_device_names": ["/dev/ram0"], + "resources": [ + { + "type": "size", + "unit": "sectors", + "value_1": 8192, + "value_2": 512 + } + ] + }, + { + "index": 26, + "attached_to": 20, + "class_list": ["disk", "scsi", "block_device"], + "bus_type": { + "hex": "0084", + "name": "SCSI", + "value": 132 + }, + "slot": { + "bus": 0, + "number": 0 + }, + "base_class": { + "hex": "0106", + "name": "Mass Storage Device", + "value": 262 + }, + "sub_class": { + "hex": "0000", + "name": "Disk", + "value": 0 + }, + "vendor": { + "hex": "0000", + "name": "Msft", + "value": 0 + }, + "device": { + "hex": "0000", + "name": "Virtual Disk", + "value": 0 + }, + "revision": { + "hex": "0000", + "name": "1.0", + "value": 0 + }, + "model": "Msft Virtual Disk", + "sysfs_id": "/class/block/sdb", + "sysfs_bus_id": "0:0:0:1", + "sysfs_device_link": "/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/fd1d2cbd-ce7c-535c-966b-eb5f811c95f0/host0/target0:0:0/0:0:0:1", + "unix_device_names": [ + "/dev/disk/by-id/scsi-360022480e63378b2d3a4a263252875a1", + "/dev/disk/by-id/wwn-0x60022480e63378b2d3a4a263252875a1", + "/dev/disk/by-path/acpi-VMBUS:00-vmbus-fd1d2cbdce7c535c966beb5f811c95f0-lun-1", + "/dev/sdb" + ], + "unix_device_name2": "/dev/sg1", + "resources": [ + { + "type": "disk_geo", + "cylinders": 20, + "heads": 255, + "sectors": 63, + "size": "0x0", + "geo_type": "logical" + }, + { + "type": "size", + "unit": "sectors", + "value_1": 326464, + "value_2": 512 + } + ], + "driver": "hv_storvsc", + "driver_module": "hv_storvsc", + "drivers": ["hv_storvsc", "sd"], + "driver_modules": ["hv_storvsc"] + }, + { + "index": 27, + "attached_to": 0, + "class_list": ["disk", "block_device"], + "base_class": { + "hex": "0106", + "name": "Mass Storage Device", + "value": 262 + }, + "sub_class": { + "hex": "0000", + "name": "Disk", + "value": 0 + }, + "model": "Disk", + "sysfs_id": "/class/block/ram9", + "unix_device_names": ["/dev/ram9"], + "resources": [ + { + "type": "size", + "unit": "sectors", + "value_1": 8192, + "value_2": 512 + } + ] + }, + { + "index": 28, + "attached_to": 0, + "class_list": ["disk", "block_device"], + "base_class": { + "hex": "0106", + "name": "Mass Storage Device", + "value": 262 + }, + "sub_class": { + "hex": "0000", + "name": "Disk", + "value": 0 + }, + "model": "Disk", + "sysfs_id": "/class/block/ram14", + "unix_device_names": ["/dev/ram14"], + "resources": [ + { + "type": "size", + "unit": "sectors", + "value_1": 8192, + "value_2": 512 + } + ] + }, + { + "index": 29, + "attached_to": 0, + "class_list": ["disk", "block_device"], + "base_class": { + "hex": "0106", + "name": "Mass Storage Device", + "value": 262 + }, + "sub_class": { + "hex": "0000", + "name": "Disk", + "value": 0 + }, + "model": "Disk", + "sysfs_id": "/class/block/ram7", + "unix_device_names": ["/dev/ram7"], + "resources": [ + { + "type": "size", + "unit": "sectors", + "value_1": 8192, + "value_2": 512 + } + ] + }, + { + "index": 30, + "attached_to": 0, + "class_list": ["disk", "block_device"], + "base_class": { + "hex": "0106", + "name": "Mass Storage Device", + "value": 262 + }, + "sub_class": { + "hex": "0000", + "name": "Disk", + "value": 0 + }, + "model": "Disk", + "sysfs_id": "/class/block/ram12", + "unix_device_names": ["/dev/ram12"], + "resources": [ + { + "type": "size", + "unit": "sectors", + "value_1": 8192, + "value_2": 512 + } + ] + }, + { + "index": 31, + "attached_to": 0, + "class_list": ["disk", "block_device"], + "base_class": { + "hex": "0106", + "name": "Mass Storage Device", + "value": 262 + }, + "sub_class": { + "hex": "0000", + "name": "Disk", + "value": 0 + }, + "model": "Disk", + "sysfs_id": "/class/block/ram5", + "unix_device_names": ["/dev/ram5"], + "resources": [ + { + "type": "size", + "unit": "sectors", + "value_1": 8192, + "value_2": 512 + } + ] + }, + { + "index": 32, + "attached_to": 0, + "class_list": ["disk", "block_device"], + "base_class": { + "hex": "0106", + "name": "Mass Storage Device", + "value": 262 + }, + "sub_class": { + "hex": "0000", + "name": "Disk", + "value": 0 + }, + "model": "Disk", + "sysfs_id": "/class/block/ram10", + "unix_device_names": ["/dev/ram10"], + "resources": [ + { + "type": "size", + "unit": "sectors", + "value_1": 8192, + "value_2": 512 + } + ] + }, + { + "index": 33, + "attached_to": 0, + "class_list": ["disk", "block_device"], + "base_class": { + "hex": "0106", + "name": "Mass Storage Device", + "value": 262 + }, + "sub_class": { + "hex": "0000", + "name": "Disk", + "value": 0 + }, + "model": "Disk", + "sysfs_id": "/class/block/ram3", + "unix_device_names": ["/dev/ram3"], + "resources": [ + { + "type": "size", + "unit": "sectors", + "value_1": 8192, + "value_2": 512 + } + ] + }, + { + "index": 34, + "attached_to": 0, + "class_list": ["disk", "block_device"], + "base_class": { + "hex": "0106", + "name": "Mass Storage Device", + "value": 262 + }, + "sub_class": { + "hex": "0000", + "name": "Disk", + "value": 0 + }, + "model": "Disk", + "sysfs_id": "/class/block/ram1", + "unix_device_names": ["/dev/ram1"], + "resources": [ + { + "type": "size", + "unit": "sectors", + "value_1": 8192, + "value_2": 512 + } + ] + }, + { + "index": 35, + "attached_to": 20, + "class_list": ["disk", "scsi", "block_device"], + "bus_type": { + "hex": "0084", + "name": "SCSI", + "value": 132 + }, + "slot": { + "bus": 0, + "number": 0 + }, + "base_class": { + "hex": "0106", + "name": "Mass Storage Device", + "value": 262 + }, + "sub_class": { + "hex": "0000", + "name": "Disk", + "value": 0 + }, + "vendor": { + "hex": "0000", + "name": "Msft", + "value": 0 + }, + "device": { + "hex": "0000", + "name": "Virtual Disk", + "value": 0 + }, + "revision": { + "hex": "0000", + "name": "1.0", + "value": 0 + }, + "model": "Msft Virtual Disk", + "sysfs_id": "/class/block/sdc", + "sysfs_bus_id": "0:0:0:2", + "sysfs_device_link": "/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/fd1d2cbd-ce7c-535c-966b-eb5f811c95f0/host0/target0:0:0/0:0:0:2", + "unix_device_names": [ + "/dev/disk/by-id/scsi-3600224809ee553408c2825d04c21f1dd", + "/dev/disk/by-id/wwn-0x600224809ee553408c2825d04c21f1dd", + "/dev/disk/by-path/acpi-VMBUS:00-vmbus-fd1d2cbdce7c535c966beb5f811c95f0-lun-2", + "/dev/disk/by-uuid/2115ea9e-ef4c-4e2d-985a-fd0eec2e0064", + "/dev/sdc" + ], + "unix_device_name2": "/dev/sg2", + "resources": [ + { + "type": "disk_geo", + "cylinders": 1044, + "heads": 255, + "sectors": 63, + "size": "0x0", + "geo_type": "logical" + }, + { + "type": "size", + "unit": "sectors", + "value_1": 16777224, + "value_2": 512 + } + ], + "driver": "hv_storvsc", + "driver_module": "hv_storvsc", + "drivers": ["hv_storvsc", "sd"], + "driver_modules": ["hv_storvsc"] + }, + { + "index": 36, + "attached_to": 0, + "class_list": ["disk", "block_device"], + "base_class": { + "hex": "0106", + "name": "Mass Storage Device", + "value": 262 + }, + "sub_class": { + "hex": "0000", + "name": "Disk", + "value": 0 + }, + "model": "Disk", + "sysfs_id": "/class/block/ram15", + "unix_device_names": ["/dev/ram15"], + "resources": [ + { + "type": "size", + "unit": "sectors", + "value_1": 8192, + "value_2": 512 + } + ] + }, + { + "index": 37, + "attached_to": 20, + "class_list": ["disk", "scsi", "block_device"], + "bus_type": { + "hex": "0084", + "name": "SCSI", + "value": 132 + }, + "slot": { + "bus": 0, + "number": 0 + }, + "base_class": { + "hex": "0106", + "name": "Mass Storage Device", + "value": 262 + }, + "sub_class": { + "hex": "0000", + "name": "Disk", + "value": 0 + }, + "vendor": { + "hex": "0000", + "name": "Msft", + "value": 0 + }, + "device": { + "hex": "0000", + "name": "Virtual Disk", + "value": 0 + }, + "revision": { + "hex": "0000", + "name": "1.0", + "value": 0 + }, + "model": "Msft Virtual Disk", + "sysfs_id": "/class/block/sda", + "sysfs_bus_id": "0:0:0:0", + "sysfs_device_link": "/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/fd1d2cbd-ce7c-535c-966b-eb5f811c95f0/host0/target0:0:0/0:0:0:0", + "unix_device_names": [ + "/dev/disk/by-id/scsi-360022480df18deb7e179255b7b21f6fa", + "/dev/disk/by-id/wwn-0x60022480df18deb7e179255b7b21f6fa", + "/dev/disk/by-path/acpi-VMBUS:00-vmbus-fd1d2cbdce7c535c966beb5f811c95f0-lun-0", + "/dev/sda" + ], + "unix_device_name2": "/dev/sg0", + "resources": [ + { + "type": "disk_geo", + "cylinders": 45, + "heads": 255, + "sectors": 63, + "size": "0x0", + "geo_type": "logical" + }, + { + "type": "size", + "unit": "sectors", + "value_1": 730960, + "value_2": 512 + } + ], + "driver": "hv_storvsc", + "driver_module": "hv_storvsc", + "drivers": ["hv_storvsc", "sd"], + "driver_modules": ["hv_storvsc"] + }, + { + "index": 38, + "attached_to": 0, + "class_list": ["disk", "block_device"], + "base_class": { + "hex": "0106", + "name": "Mass Storage Device", + "value": 262 + }, + "sub_class": { + "hex": "0000", + "name": "Disk", + "value": 0 + }, + "model": "Disk", + "sysfs_id": "/class/block/ram8", + "unix_device_names": ["/dev/ram8"], + "resources": [ + { + "type": "size", + "unit": "sectors", + "value_1": 8192, + "value_2": 512 + } + ] + }, + { + "index": 39, + "attached_to": 0, + "class_list": ["disk", "block_device"], + "base_class": { + "hex": "0106", + "name": "Mass Storage Device", + "value": 262 + }, + "sub_class": { + "hex": "0000", + "name": "Disk", + "value": 0 + }, + "model": "Disk", + "sysfs_id": "/class/block/ram13", + "unix_device_names": ["/dev/ram13"], + "resources": [ + { + "type": "size", + "unit": "sectors", + "value_1": 8192, + "value_2": 512 + } + ] + }, + { + "index": 40, + "attached_to": 0, + "class_list": ["disk", "block_device"], + "base_class": { + "hex": "0106", + "name": "Mass Storage Device", + "value": 262 + }, + "sub_class": { + "hex": "0000", + "name": "Disk", + "value": 0 + }, + "model": "Disk", + "sysfs_id": "/class/block/ram6", + "unix_device_names": ["/dev/ram6"], + "resources": [ + { + "type": "size", + "unit": "sectors", + "value_1": 8192, + "value_2": 512 + } + ] + }, + { + "index": 41, + "attached_to": 0, + "class_list": ["disk", "block_device"], + "base_class": { + "hex": "0106", + "name": "Mass Storage Device", + "value": 262 + }, + "sub_class": { + "hex": "0000", + "name": "Disk", + "value": 0 + }, + "model": "Disk", + "sysfs_id": "/class/block/ram11", + "unix_device_names": ["/dev/ram11"], + "resources": [ + { + "type": "size", + "unit": "sectors", + "value_1": 8192, + "value_2": 512 + } + ] + }, + { + "index": 42, + "attached_to": 0, + "class_list": ["disk", "block_device"], + "base_class": { + "hex": "0106", + "name": "Mass Storage Device", + "value": 262 + }, + "sub_class": { + "hex": "0000", + "name": "Disk", + "value": 0 + }, + "model": "Disk", + "sysfs_id": "/class/block/ram4", + "unix_device_names": ["/dev/ram4"], + "resources": [ + { + "type": "size", + "unit": "sectors", + "value_1": 8192, + "value_2": 512 + } + ] + } + ], + "graphics_card": [ + { + "index": 17, + "attached_to": 0, + "class_list": ["graphics_card", "pci"], + "bus_type": { + "hex": "0004", + "name": "PCI", + "value": 4 + }, + "slot": { + "bus": 9934080, + "number": 0 + }, + "base_class": { + "hex": "0003", + "name": "Display controller", + "value": 3 + }, + "sub_class": { + "hex": "0002", + "name": "3D controller", + "value": 2 + }, + "vendor": { + "hex": "1414", + "value": 5140 + }, + "device": { + "hex": "008e", + "value": 142 + }, + "model": "3D controller", + "sysfs_id": "/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/34bd0ebc-9795-43c5-8a0b-b27a0c752ca7/pci9795:00/9795:00:00.0", + "sysfs_bus_id": "9795:00:00.0", + "detail": { + "function": 0, + "command": 7, + "header_type": 0, + "secondary_bus": 0, + "prog_if": 0 + }, + "driver": "dxgkrnl", + "driver_module": "dxgkrnl", + "drivers": ["dxgkrnl"], + "driver_modules": ["dxgkrnl", "dxgkrnl"], + "module_alias": "pci:v00001414d0000008Esv00000000sd00000000bc03sc02i00" + } + ], + "memory": [ + { + "index": 15, + "attached_to": 0, + "class_list": ["memory"], + "base_class": { + "hex": "0101", + "name": "Internally Used Class", + "value": 257 + }, + "sub_class": { + "hex": "0002", + "name": "Main Memory", + "value": 2 + }, + "model": "Main Memory", + "resources": [ + { + "type": "phys_mem", + "range": 34359738368 + } + ] + } + ], + "network_controller": [ + { + "index": 19, + "attached_to": 0, + "class_list": ["network_controller"], + "base_class": { + "hex": "0002", + "name": "Network controller", + "value": 2 + }, + "sub_class": { + "hex": "0000", + "name": "Ethernet controller", + "value": 0 + }, + "vendor": "Virtual", + "device": "Virtual Ethernet Card 0", + "model": "Virtual Ethernet Card 0", + "sysfs_id": "/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/9dff3312-2679-4053-bdd6-db52779926b9", + "sysfs_bus_id": "9dff3312-2679-4053-bdd6-db52779926b9", + "unix_device_names": ["eth0"], + "resources": [ + { + "type": "hwaddr", + "address": 48 + }, + { + "type": "phwaddr", + "address": 48 + } + ], + "driver": "hv_netvsc", + "driver_module": "hv_netvsc", + "drivers": ["hv_netvsc"], + "driver_modules": ["hv_netvsc"], + "driver_info": { + "type": "module", + "db_entry_0": ["hv_netvsc"], + "active": true, + "modprobe": true, + "names": ["hv_netvsc"], + "module_args": [""], + "conf": "" + } + } + ], + "network_interface": [ + { + "index": 43, + "attached_to": 0, + "class_list": ["network_interface"], + "base_class": { + "hex": "0107", + "name": "Network Interface", + "value": 263 + }, + "sub_class": { + "hex": "0000", + "name": "Loopback", + "value": 0 + }, + "model": "Loopback network interface", + "sysfs_id": "/class/net/lo", + "unix_device_name": "lo", + "unix_device_names": ["lo"] + }, + { + "index": 44, + "attached_to": 19, + "class_list": ["network_interface"], + "base_class": { + "hex": "0107", + "name": "Network Interface", + "value": 263 + }, + "sub_class": { + "hex": "0001", + "name": "Ethernet", + "value": 1 + }, + "model": "Ethernet network interface", + "sysfs_id": "/class/net/eth0", + "sysfs_device_link": "/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/9dff3312-2679-4053-bdd6-db52779926b9", + "unix_device_name": "eth0", + "unix_device_names": ["eth0"], + "resources": [ + { + "type": "hwaddr", + "address": 48 + }, + { + "type": "phwaddr", + "address": 48 + } + ], + "driver": "hv_netvsc", + "driver_module": "hv_netvsc", + "drivers": ["hv_netvsc"], + "driver_modules": ["hv_netvsc"] + } + ], + "pci": [ + { + "index": 18, + "attached_to": 0, + "class_list": ["pci", "unknown"], + "bus_type": { + "hex": "0004", + "name": "PCI", + "value": 4 + }, + "slot": { + "bus": 14059008, + "number": 0 + }, + "base_class": { + "hex": "0008", + "name": "Generic system peripheral", + "value": 8 + }, + "sub_class": { + "hex": "0080", + "name": "System peripheral", + "value": 128 + }, + "vendor": { + "hex": "1af4", + "value": 6900 + }, + "sub_vendor": { + "hex": "1af4", + "value": 6900 + }, + "device": { + "hex": "105a", + "value": 4186 + }, + "sub_device": { + "hex": "0040", + "value": 64 + }, + "revision": { + "hex": "0001", + "value": 1 + }, + "model": "System peripheral", + "sysfs_id": "/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/23d89ec8-d686-4731-85a6-860912bc0a1b/pcid686:00/d686:00:00.0", + "sysfs_bus_id": "d686:00:00.0", + "detail": { + "function": 0, + "command": 1030, + "header_type": 0, + "secondary_bus": 0, + "prog_if": 0 + }, + "driver": "virtio-pci", + "driver_module": "virtio_pci", + "drivers": ["virtio-pci"], + "driver_modules": ["virtio_pci"], + "module_alias": "pci:v00001AF4d0000105Asv00001AF4sd00000040bc08sc80i00" + } + ], + "storage_controller": [ + { + "index": 16, + "attached_to": 0, + "class_list": ["storage_controller", "pci"], + "bus_type": { + "hex": "0004", + "name": "PCI", + "value": 4 + }, + "slot": { + "bus": 4111360, + "number": 0 + }, + "base_class": { + "hex": "0001", + "name": "Mass storage controller", + "value": 1 + }, + "sub_class": { + "hex": "0000", + "name": "SCSI storage controller", + "value": 0 + }, + "vendor": { + "hex": "1af4", + "value": 6900 + }, + "sub_vendor": { + "hex": "1af4", + "value": 6900 + }, + "device": { + "hex": "1043", + "value": 4163 + }, + "sub_device": { + "hex": "0040", + "value": 64 + }, + "revision": { + "hex": "0001", + "value": 1 + }, + "model": "SCSI storage controller", + "sysfs_id": "/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/40c6d8d9-3ebc-463b-9fca-cc8f69baac3f/pci3ebc:00/3ebc:00:00.0", + "sysfs_bus_id": "3ebc:00:00.0", + "detail": { + "function": 0, + "command": 1030, + "header_type": 0, + "secondary_bus": 0, + "prog_if": 0 + }, + "driver": "virtio-pci", + "driver_module": "virtio_pci", + "drivers": ["virtio-pci"], + "driver_modules": ["virtio_pci"], + "module_alias": "pci:v00001AF4d00001043sv00001AF4sd00000040bc01sc00i00" + }, + { + "index": 20, + "attached_to": 0, + "class_list": ["storage_controller"], + "base_class": { + "hex": "0001", + "name": "Mass storage controller", + "value": 1 + }, + "sub_class": { + "hex": "0080", + "name": "Storage controller", + "value": 128 + }, + "vendor": "Virtual", + "device": "Storage 0", + "model": "Virtual Storage 0", + "sysfs_id": "/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/fd1d2cbd-ce7c-535c-966b-eb5f811c95f0", + "sysfs_bus_id": "fd1d2cbd-ce7c-535c-966b-eb5f811c95f0", + "driver": "hv_storvsc", + "driver_module": "hv_storvsc", + "drivers": ["hv_storvsc"], + "driver_modules": ["hv_storvsc"], + "driver_info": { + "type": "module", + "db_entry_0": ["hv_storvsc"], + "active": true, + "modprobe": true, + "names": ["hv_storvsc"], + "module_args": [""], + "conf": "" + } + } + ], + "system": { + "form_factor": "desktop" + }, + "unknown": [ + { + "index": 21, + "attached_to": 18, + "class_list": ["unknown"], + "base_class": { + "hex": "0000", + "name": "Unclassified device", + "value": 0 + }, + "sub_class": { + "hex": "0000", + "name": "Unclassified device", + "value": 0 + }, + "vendor": "Virtio", + "device": "", + "model": "Virtio Unclassified device", + "sysfs_id": "/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/23d89ec8-d686-4731-85a6-860912bc0a1b/pcid686:00/d686:00:00.0/virtio1", + "sysfs_bus_id": "virtio1", + "driver": "virtiofs", + "drivers": ["virtiofs"], + "module_alias": "virtio:d0000001Av00001AF4" + }, + { + "index": 22, + "attached_to": 16, + "class_list": ["unknown"], + "base_class": { + "hex": "0000", + "name": "Unclassified device", + "value": 0 + }, + "sub_class": { + "hex": "0000", + "name": "Unclassified device", + "value": 0 + }, + "vendor": "Virtio", + "device": "", + "model": "Virtio Unclassified device", + "sysfs_id": "/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/40c6d8d9-3ebc-463b-9fca-cc8f69baac3f/pci3ebc:00/3ebc:00:00.0/virtio0", + "sysfs_bus_id": "virtio0", + "driver": "virtio_console", + "drivers": ["virtio_console"], + "module_alias": "virtio:d00000003v00001AF4" + } + ] + }, + "smbios": {} +} diff --git a/flake.lock b/flake.lock index 772b64810..93dc03c9c 100644 --- a/flake.lock +++ b/flake.lock @@ -175,6 +175,22 @@ "type": "github" } }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1767039857, + "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": [ @@ -608,20 +624,42 @@ ] }, "locked": { - "lastModified": 1782941409, - "narHash": "sha256-MIPkSMwStyZxdlh4/rdTg0q1Me/A2hb+UnYtm3FGhKc=", + "lastModified": 1789709555, + "narHash": "sha256-G61pnHerbFZgABasSb+b/Ttb8cUPH5RWQZGBdMWJyIg=", "owner": "haras-unicorn", "repo": "nixos-facter-detection-modules", - "rev": "ac52c95b56102a84d6db2832286cd0fd43817cb6", + "rev": "8d5e7cb643a8b9d30321636789efbd3519444be6", "type": "github" }, "original": { "owner": "haras-unicorn", - "ref": "refs/tags/v1.0.0", + "ref": "refs/tags/v1.1.0", "repo": "nixos-facter-detection-modules", "type": "github" } }, + "nixos-wsl": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1789164534, + "narHash": "sha256-DoYGPM6QpnYBLWj9gGw6ZwAzIX+HrAVov1BoT+8Jixo=", + "owner": "nix-community", + "repo": "NixOS-WSL", + "rev": "72c92b11bb8289e6651c7fef29cc0a885fd6a255", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "main", + "repo": "NixOS-WSL", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1785747939, @@ -822,6 +860,7 @@ "nix-index-database": "nix-index-database", "nix-vscode-extensions": "nix-vscode-extensions", "nixos-facter-detection-modules": "nixos-facter-detection-modules", + "nixos-wsl": "nixos-wsl", "nixpkgs": "nixpkgs_4", "nixpkgs-unstable": "nixpkgs-unstable", "noctalia": "noctalia", diff --git a/flake.nix b/flake.nix index 944fb6d25..ecd0c62d0 100644 --- a/flake.nix +++ b/flake.nix @@ -10,9 +10,12 @@ nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; - nixos-facter-detection-modules.url = "github:haras-unicorn/nixos-facter-detection-modules/refs/tags/v1.0.0"; + nixos-facter-detection-modules.url = "github:haras-unicorn/nixos-facter-detection-modules/refs/tags/v1.1.0"; nixos-facter-detection-modules.inputs.nixpkgs.follows = "nixpkgs"; + nixos-wsl.url = "github:nix-community/NixOS-WSL/main"; + nixos-wsl.inputs.nixpkgs.follows = "nixpkgs"; + home-manager.url = "github:nix-community/home-manager/release-26.05"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; @@ -59,7 +62,7 @@ "https://haras.cachix.org" "https://cache.nixos.org" "https://nix-community.cachix.org" - "https://cuda-maintainers.cachix.org" + "https://cache.nixos-cuda.org" "https://comfyui.cachix.org" "https://cache.numtide.com" "https://noctalia.cachix.org" @@ -69,7 +72,7 @@ "haras.cachix.org-1:/HIo1JYqOIH1Nwk1EGXhuPPvDW0WekxIbY5CiXUZbYw=" "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E=" + "cache.nixos-cuda.org:74DUi4Ye579gUqzH4ziL9IyiJBlDpMRn9MBN8oNan9M=" "comfyui.cachix.org-1:33mf9VzoIjzVbp0zwj+fT51HG0y31ZTK3nzYZAX0rec=" "niks3.numtide.com-1:DTx8wZduET09hRmMtKdQDxNNthLQETkc/yaX7M4qK0g=" "noctalia.cachix.org-1:pCOR47nnMEo5thcxNDtzWpOxNFQsBRglJzxWPp3dkU4=" diff --git a/src/cspell.yaml b/src/cspell.yaml index b255dce3b..f45982736 100644 --- a/src/cspell.yaml +++ b/src/cspell.yaml @@ -554,3 +554,4 @@ ignoreWords: - wrapup - multimodal - omarchy + - gabi diff --git a/src/deprecated/comfyui.nix b/src/deprecated/comfyui.nix index 6a8014261..d60b4bf10 100644 --- a/src/deprecated/comfyui.nix +++ b/src/deprecated/comfyui.nix @@ -10,11 +10,11 @@ ... }: let - cuda = config.nixpkgs.config.cudaSupport; + cuda = osConfig.dot.hardware.cuda; chromium = osConfig.dot.programs.chromium.package; - package = if config.nixpkgs.config.cudaSupport then pkgs.comfy-ui-cuda else pkgs.comfy-ui; + package = if cuda then pkgs.comfy-ui-cuda else pkgs.comfy-ui; mkComfyuiInstance = instanceName: rec { comfyui = pkgs.writeShellApplication { diff --git a/src/deprecated/mistral-rs.nix b/src/deprecated/mistral-rs.nix index ccf0c6682..d4af6e846 100644 --- a/src/deprecated/mistral-rs.nix +++ b/src/deprecated/mistral-rs.nix @@ -26,7 +26,7 @@ in ... }: let - cuda = config.nixpkgs.config.cudaSupport; + cuda = config.dot.hardware.cuda; models = makeModels pkgs; in @@ -44,11 +44,12 @@ in { pkgs, config, + osConfig, lib, ... }: let - cuda = config.nixpkgs.config.cudaSupport; + cuda = osConfig.dot.hardware.cuda; package = pkgs.mistral-rs; diff --git a/src/deprecated/ollama-openwebui.nix b/src/deprecated/ollama-openwebui.nix index 852bf8060..f49d135c9 100644 --- a/src/deprecated/ollama-openwebui.nix +++ b/src/deprecated/ollama-openwebui.nix @@ -4,7 +4,7 @@ self.lib.deprecated.nixosModules.ollama-openwebui = { lib, config, ... }: let - cuda = config.nixpkgs.config.cudaSupport; + cuda = config.dot.hardware.cuda; in lib.mkIf cuda { dot.nixpkgs.allowUnfreePredicates = [ @@ -27,7 +27,7 @@ ... }: let - cuda = config.nixpkgs.config.cudaSupport; + cuda = osConfig.dot.hardware.cuda; chromium = osConfig.dot.programs.chromium.package; diff --git a/src/dev/default.nix b/src/dev/default.nix index e8c66c3a5..9f2bbd98b 100644 --- a/src/dev/default.nix +++ b/src/dev/default.nix @@ -30,6 +30,10 @@ helix opencode fd + ripgrep + fastmod + lazygit + git prettier yaml-language-server diff --git a/src/machines/gabi.nix b/src/machines/gabi.nix new file mode 100644 index 000000000..416680a59 --- /dev/null +++ b/src/machines/gabi.nix @@ -0,0 +1,11 @@ +{ + machines.machines.gabi = { + dot.hardware.deviceType = "wsl"; + + dot.location.latitude = 45.815010; + dot.location.longitude = 15.981919; + dot.location.altitude = 125; + dot.location.accuracy = 30000; + dot.location.address = "Zagreb, Croatia"; + }; +} diff --git a/src/modules/ai/llama-cpp.nix b/src/modules/ai/llama-cpp.nix index a8ea888f8..a9b8779e9 100644 --- a/src/modules/ai/llama-cpp.nix +++ b/src/modules/ai/llama-cpp.nix @@ -7,9 +7,8 @@ let makePackage = - pkgs: + pkgs: cuda: let - cuda = pkgs.config.cudaSupport; system = pkgs.stdenv.hostPlatform.system; @@ -101,9 +100,9 @@ in }: let models = makeModels pkgs; - package = makePackage pkgs; + package = makePackage pkgs config.dot.hardware.cuda; in - lib.mkIf config.nixpkgs.config.cudaSupport { + lib.mkIf config.dot.hardware.cuda { environment.systemPackages = [ package ]; @@ -311,11 +310,12 @@ in lib, config, pkgs, + osConfig, ... }: let models = makeModels pkgs; - package = makePackage pkgs; + package = makePackage pkgs osConfig.dot.hardware.cuda; imagePrompt = '' You are an image captioner. @@ -455,7 +455,7 @@ in ''; }; in - lib.mkIf config.nixpkgs.config.cudaSupport { + lib.mkIf osConfig.dot.hardware.cuda { dot.processing.nodes = { llama-cpp-describe-image = { note = "Describe an image into text"; diff --git a/src/modules/ai/stable-diffusion-cpp.nix b/src/modules/ai/stable-diffusion-cpp.nix index 715af9fb2..7b8f060da 100644 --- a/src/modules/ai/stable-diffusion-cpp.nix +++ b/src/modules/ai/stable-diffusion-cpp.nix @@ -35,7 +35,7 @@ in ... }: let - cuda = config.nixpkgs.config.cudaSupport; + cuda = config.dot.hardware.cuda; models = makeModels pkgs; in @@ -62,7 +62,7 @@ in ... }: let - cuda = config.nixpkgs.config.cudaSupport; + cuda = osConfig.dot.hardware.cuda; models = makeModels pkgs; diff --git a/src/modules/ai/whisper-cpp.nix b/src/modules/ai/whisper-cpp.nix index e63011b2b..dd5d67365 100644 --- a/src/modules/ai/whisper-cpp.nix +++ b/src/modules/ai/whisper-cpp.nix @@ -22,7 +22,7 @@ in ... }: let - cuda = config.nixpkgs.config.cudaSupport; + cuda = config.dot.hardware.cuda; models = makeModels pkgs; in @@ -48,7 +48,7 @@ in let hardware = osConfig.dot.hardware; - cuda = config.nixpkgs.config.cudaSupport; + cuda = hardware.cuda; models = makeModels pkgs; diff --git a/src/modules/desktop/toolbelt/default.nix b/src/modules/desktop/toolbelt/default.nix index 3de797135..c352ebb7d 100644 --- a/src/modules/desktop/toolbelt/default.nix +++ b/src/modules/desktop/toolbelt/default.nix @@ -97,7 +97,7 @@ dmenu = lib.getExe config.dot.commands.dmenu; - kandoCmd = config.dot.commands.kando; + kando = lib.getExe config.dot.commands.kando; ui = if hardware.graphics then @@ -110,7 +110,7 @@ common = '' $env.DOT_TOOLBELT_TOOLS = r#'${tools}'# | from json $env.DOT_TOOLBELT_DMENU = "${dmenu}" - $env.DOT_TOOLBELT_KANDO = "${if kandoCmd != null then lib.getExe kandoCmd else ""}" + $env.DOT_TOOLBELT_KANDO = "${kando}" $env.PATH ++= [ ${path} ] ${builtins.readFile ./log.nu} @@ -150,29 +150,35 @@ } ''; in - lib.mkIf (hardware.editor || hardware.graphics) { - home.packages = [ - toolbelt - pipeline - ] - ++ packages; - - dot.desktop.keybinds = [ - { - mods = [ - "super" - ]; - key = "q"; - command = lib.getExe pipeline; - } - { - mods = [ - "super" - "ctrl" - ]; - key = "q"; - command = lib.getExe toolbelt; - } - ]; - }; + lib.mkIf + ( + (hardware.editor || hardware.graphics) + && config.dot.commands.dmenu != null + && config.dot.commands.kando != null + ) + { + home.packages = [ + toolbelt + pipeline + ] + ++ packages; + + dot.desktop.keybinds = [ + { + mods = [ + "super" + ]; + key = "q"; + command = lib.getExe pipeline; + } + { + mods = [ + "super" + "ctrl" + ]; + key = "q"; + command = lib.getExe toolbelt; + } + ]; + }; } diff --git a/src/modules/desktop/xdg.nix b/src/modules/desktop/xdg.nix index 95b9cc069..5827fe20f 100644 --- a/src/modules/desktop/xdg.nix +++ b/src/modules/desktop/xdg.nix @@ -2,7 +2,9 @@ { machines.nixosModules.xdg = { config, ... }: { - environment.systemPackages = builtins.attrValues config.dot.commands; + environment.systemPackages = builtins.filter (package: package != null) ( + builtins.attrValues config.dot.commands + ); }; machines.homeModules.xdg = @@ -14,8 +16,6 @@ ... }: let - hardware = osConfig.dot.hardware; - copy = pkgs.writeShellApplication { name = "copy"; text = '' @@ -57,9 +57,13 @@ ''; }; - commands = builtins.attrValues config.dot.commands ++ builtins.attrValues osConfig.dot.commands; + commands = builtins.filter (package: package != null) ( + builtins.attrValues config.dot.commands ++ builtins.attrValues osConfig.dot.commands + ); - programs = builtins.map ({ package, ... }: package) (builtins.attrValues config.dot.programs); + programs = builtins.filter (package: package != null) ( + builtins.map ({ package, ... }: package) (builtins.attrValues config.dot.programs) + ); makeScreenshot = name: @@ -153,28 +157,28 @@ }; dot.desktop.keybinds = lib.mkMerge [ - (lib.mkIf hardware.browser [ + (lib.mkIf (config.dot.programs.browser.package != null) [ { mods = [ "super" ]; key = "w"; command = lib.getExe config.dot.programs.browser.package; } ]) - (lib.mkIf hardware.browser [ + (lib.mkIf (config.dot.programs.terminal.package != null) [ { mods = [ "super" ]; key = "t"; command = lib.getExe config.dot.programs.terminal.package; } ]) - (lib.mkIf hardware.browser [ + (lib.mkIf (config.dot.commands.screenshot != null) [ { mods = [ "super" ]; key = "p"; command = lib.getExe config.dot.commands.screenshot; } ]) - (lib.mkIf hardware.browser [ + (lib.mkIf (config.dot.commands.regionshot != null) [ { mods = [ "super" @@ -184,7 +188,7 @@ command = lib.getExe config.dot.commands.regionshot; } ]) - (lib.mkIf hardware.browser [ + (lib.mkIf (config.dot.commands.screenrecord != null) [ { mods = [ "super" @@ -194,7 +198,7 @@ command = lib.getExe config.dot.commands.screenrecord; } ]) - (lib.mkIf hardware.browser [ + (lib.mkIf (config.dot.commands.regionrecord != null) [ { mods = [ "super" @@ -205,7 +209,7 @@ command = lib.getExe config.dot.commands.regionrecord; } ]) - (lib.mkIf hardware.visual [ + (lib.mkIf (config.dot.commands.launcher != null) [ { mods = [ "super" @@ -214,7 +218,7 @@ command = lib.getExe config.dot.commands.launcher; } ]) - (lib.mkIf hardware.visual [ + (lib.mkIf (config.dot.commands.emoji != null) [ { mods = [ "super" @@ -223,7 +227,7 @@ command = lib.getExe config.dot.commands.emoji; } ]) - (lib.mkIf hardware.sound [ + (lib.mkIf (config.dot.commands.volume-up != null) [ { mods = [ "super" @@ -233,7 +237,7 @@ command = lib.getExe config.dot.commands.volume-up; } ]) - (lib.mkIf hardware.sound [ + (lib.mkIf (config.dot.commands.volume-down != null) [ { mods = [ "super" @@ -243,7 +247,7 @@ command = lib.getExe config.dot.commands.volume-down; } ]) - (lib.mkIf hardware.sound [ + (lib.mkIf (config.dot.commands.volume-mute-unmute != null) [ { mods = [ "super" @@ -253,7 +257,7 @@ command = lib.getExe config.dot.commands.volume-mute-unmute; } ]) - (lib.mkIf hardware.sound [ + (lib.mkIf (config.dot.commands.play-pause != null) [ { mods = [ "super" @@ -262,7 +266,7 @@ command = lib.getExe config.dot.commands.play-pause; } ]) - (lib.mkIf hardware.graphics [ + (lib.mkIf (config.dot.commands.brightness-up != null) [ { mods = [ "super" @@ -272,7 +276,7 @@ command = lib.getExe config.dot.commands.brightness-up; } ]) - (lib.mkIf hardware.graphics [ + (lib.mkIf (config.dot.commands.brightness-down != null) [ { mods = [ "super" @@ -285,25 +289,25 @@ ]; dot.mime.apps = lib.mkMerge [ - (lib.mkIf hardware.browser [ + (lib.mkIf (config.dot.programs.browser.package != null) [ { package = config.dot.programs.browser.package; types = selfLib.mime.browser; } ]) - (lib.mkIf hardware.visual [ + (lib.mkIf (config.dot.programs.visual.package != null) [ { package = config.dot.programs.visual.package; types = selfLib.mime.editor; } ]) - (lib.mkIf hardware.editor [ + (lib.mkIf (config.dot.programs.editor.package != null) [ { package = config.dot.programs.editor.package; types = selfLib.mime.editor; } ]) - (lib.mkIf hardware.browser [ + (lib.mkIf (config.dot.programs.files.package != null) [ { package = config.dot.programs.files.package; types = selfLib.mime.files; @@ -328,13 +332,13 @@ { PAGER = lib.getExe config.dot.programs.pager.package; } - (lib.mkIf hardware.browser { + (lib.mkIf (config.dot.programs.browser.package != null) { BROWSER = lib.getExe config.dot.programs.browser.package; }) - (lib.mkIf hardware.visual { + (lib.mkIf (config.dot.programs.visual.package != null) { VISUAL = lib.getExe config.dot.programs.visual.package; }) - (lib.mkIf hardware.editor { + (lib.mkIf (config.dot.programs.editor.package != null) { EDITOR = lib.getExe config.dot.programs.editor.package; }) ]; diff --git a/src/modules/hardware/nvidia/default.nix b/src/modules/hardware/nvidia/default.nix index ec51766c5..609105a96 100644 --- a/src/modules/hardware/nvidia/default.nix +++ b/src/modules/hardware/nvidia/default.nix @@ -30,10 +30,9 @@ ) ]; - nixpkgs.config = { - nvidia.acceptLicense = true; - cudaSupport = cuda; - }; + nixpkgs.config.nvidia.acceptLicense = true; + dot.hardware.cuda = cuda; + dot.hardware.rocm = false; # NOTE: needed for early splash boot.initrd.availableKernelModules = [ diff --git a/src/modules/hardware/wsl.nix b/src/modules/hardware/wsl.nix new file mode 100644 index 000000000..4e2c0b3ff --- /dev/null +++ b/src/modules/hardware/wsl.nix @@ -0,0 +1,55 @@ +{ inputs, ... }: + +{ + machines.nixosModules.wsl = + { + config, + lib, + ... + }: + { + imports = [ inputs.nixos-wsl.nixosModules.default ]; + + config = lib.mkIf (config.dot.hardware.deviceType == "wsl") { + wsl.enable = true; + wsl.defaultUser = config.dot.user.user; + wsl.wslConf.network.hostname = config.networking.hostName; + + # NOTE: WSL provides its own kernel, init, mounts and swap. + # There is no bootloader, no /boot and no labeled disks. + boot.loader.grub.enable = lib.mkForce false; + fileSystems = lib.mkForce { }; + swapDevices = lib.mkForce [ ]; + + # NOTE: interface, DNS, firewall and time are managed by Windows/WSL. + networking.networkmanager.enable = lib.mkForce false; + networking.nameservers = lib.mkForce [ ]; + networking.firewall.enable = lib.mkForce false; + services.coredns.enable = lib.mkForce false; + services.chrony.enable = lib.mkForce false; + + # NOTE: binfmt without WSL interop re-registration breaks .exe launching. + boot.binfmt.emulatedSystems = lib.mkForce [ ]; + wsl.interop.register = true; + + # NOTE: no KVM/libvirt in WSL. + virtualisation.libvirtd.enable = lib.mkForce false; + programs.virt-manager.enable = lib.mkForce false; + + # NOTE: headless CLI only, no desktop or sound stack. + dot.hardware.graphics = lib.mkForce false; + dot.hardware.sound = lib.mkForce false; + dot.hardware.wayland = lib.mkForce false; + dot.hardware.gaming = lib.mkForce false; + dot.hardware.browser = lib.mkForce false; + dot.hardware.visual = lib.mkForce false; + dot.hardware.multimedia = lib.mkForce false; + dot.wallpaper.static = true; + dot.hardware.temperature = lib.mkDefault "/sys/class/thermal/thermal_zone0/temp"; + dot.hardware.display = lib.mkDefault ""; + + # NOTE: gc does not work well with WSL + dot.nix.gc = false; + }; + }; +} diff --git a/src/modules/meta/commands.nix b/src/modules/meta/commands.nix index 534b9f471..efb006a40 100644 --- a/src/modules/meta/commands.nix +++ b/src/modules/meta/commands.nix @@ -8,7 +8,8 @@ options.dot = { commands = { pinentry = lib.mkOption { - type = lib.types.package; + type = lib.types.nullOr lib.types.package; + default = null; description = '' Default pinentry package. @@ -18,7 +19,8 @@ }; mangohud = lib.mkOption { - type = lib.types.package; + type = lib.types.nullOr lib.types.package; + default = null; description = '' Default mangohud package. @@ -28,7 +30,8 @@ }; gamemode = lib.mkOption { - type = lib.types.package; + type = lib.types.nullOr lib.types.package; + default = null; description = '' Default gamemode package. @@ -38,7 +41,8 @@ }; gamescope = lib.mkOption { - type = lib.types.package; + type = lib.types.nullOr lib.types.package; + default = null; description = '' Default gamescope package. @@ -56,7 +60,8 @@ options.dot = { commands = { copy = lib.mkOption { - type = lib.types.package; + type = lib.types.nullOr lib.types.package; + default = null; description = '' Copy command. @@ -69,7 +74,8 @@ }; paste = lib.mkOption { - type = lib.types.package; + type = lib.types.nullOr lib.types.package; + default = null; description = '' Paste command. @@ -81,7 +87,8 @@ }; type = lib.mkOption { - type = lib.types.package; + type = lib.types.nullOr lib.types.package; + default = null; description = '' Type command. @@ -91,7 +98,8 @@ }; screenshot = lib.mkOption { - type = lib.types.package; + type = lib.types.nullOr lib.types.package; + default = null; description = '' Screenshot command. @@ -104,7 +112,8 @@ }; regionshot = lib.mkOption { - type = lib.types.package; + type = lib.types.nullOr lib.types.package; + default = null; description = '' Region screenshot command. @@ -118,7 +127,8 @@ }; screenrecord = lib.mkOption { - type = lib.types.package; + type = lib.types.nullOr lib.types.package; + default = null; description = '' Screenrecord command. @@ -131,7 +141,8 @@ }; regionrecord = lib.mkOption { - type = lib.types.package; + type = lib.types.nullOr lib.types.package; + default = null; description = '' Region screenrecord command. @@ -145,7 +156,8 @@ }; tree = lib.mkOption { - type = lib.types.package; + type = lib.types.nullOr lib.types.package; + default = null; description = '' Directory tree command. @@ -156,7 +168,8 @@ }; list = lib.mkOption { - type = lib.types.package; + type = lib.types.nullOr lib.types.package; + default = null; description = '' Directory list command. @@ -167,7 +180,8 @@ }; dmenu = lib.mkOption { - type = lib.types.package; + type = lib.types.nullOr lib.types.package; + default = null; description = '' Dmenu command. @@ -181,7 +195,8 @@ }; launcher = lib.mkOption { - type = lib.types.package; + type = lib.types.nullOr lib.types.package; + default = null; description = '' Program picker command. @@ -192,7 +207,8 @@ }; emoji = lib.mkOption { - type = lib.types.package; + type = lib.types.nullOr lib.types.package; + default = null; description = '' Emoji picker command. @@ -202,7 +218,8 @@ }; volume-up = lib.mkOption { - type = lib.types.package; + type = lib.types.nullOr lib.types.package; + default = null; description = '' Volume increase command. @@ -212,7 +229,8 @@ }; volume-down = lib.mkOption { - type = lib.types.package; + type = lib.types.nullOr lib.types.package; + default = null; description = '' Volume decrease command. @@ -222,7 +240,8 @@ }; volume-mute-unmute = lib.mkOption { - type = lib.types.package; + type = lib.types.nullOr lib.types.package; + default = null; description = '' Mute/unmute command. @@ -232,7 +251,8 @@ }; play-pause = lib.mkOption { - type = lib.types.package; + type = lib.types.nullOr lib.types.package; + default = null; description = '' Play/pause command. @@ -242,7 +262,8 @@ }; brightness-up = lib.mkOption { - type = lib.types.package; + type = lib.types.nullOr lib.types.package; + default = null; description = '' Brightness increase command. @@ -252,7 +273,8 @@ }; brightness-down = lib.mkOption { - type = lib.types.package; + type = lib.types.nullOr lib.types.package; + default = null; description = '' Brightness decrease command. diff --git a/src/modules/meta/hardware.nix b/src/modules/meta/hardware.nix index cd5402024..ad9dd39ef 100644 --- a/src/modules/meta/hardware.nix +++ b/src/modules/meta/hardware.nix @@ -12,6 +12,7 @@ type = lib.types.enum [ "generic" "rpi4" + "wsl" ]; default = "generic"; description = "Machine device type."; @@ -72,6 +73,16 @@ description = "Whether the machine can be used to game."; }; + cuda = lib.mkOption { + type = lib.types.bool; + description = "Whether the machine supports CUDA."; + }; + + rocm = lib.mkOption { + type = lib.types.bool; + description = "Whether the machine supports ROCm."; + }; + wayland = lib.mkOption { type = lib.types.bool; description = "Whether the machine supports wayland."; @@ -132,6 +143,8 @@ visual = capabilities.graphics && capabilities.typing; gaming = capabilities.sound && capabilities.graphics && capabilities.typing && capabilities.pointing; + cuda = lib.mkDefault false; + rocm = lib.mkDefault false; wayland = detection.graphics.cards.default.wayland or false; threads = detection.cpu.threads; memory = detection.memory.size; diff --git a/src/modules/meta/programs.nix b/src/modules/meta/programs.nix index efc95dfd3..a2750c697 100644 --- a/src/modules/meta/programs.nix +++ b/src/modules/meta/programs.nix @@ -76,7 +76,8 @@ programs = { shell = { package = lib.mkOption { - type = lib.types.package; + type = lib.types.nullOr lib.types.package; + default = null; description = "Default shell package"; }; @@ -114,7 +115,8 @@ pager = { package = lib.mkOption { - type = lib.types.package; + type = lib.types.nullOr lib.types.package; + default = null; description = '' Default pager package. ''; @@ -123,7 +125,8 @@ editor = { package = lib.mkOption { - type = lib.types.package; + type = lib.types.nullOr lib.types.package; + default = null; description = '' Default editor package. ''; @@ -132,7 +135,8 @@ terminal = { package = lib.mkOption { - type = lib.types.package; + type = lib.types.nullOr lib.types.package; + default = null; description = '' Default terminal package. ''; @@ -156,7 +160,8 @@ visual = { package = lib.mkOption { - type = lib.types.package; + type = lib.types.nullOr lib.types.package; + default = null; description = '' Default visual editor package. ''; @@ -165,7 +170,8 @@ browser = { package = lib.mkOption { - type = lib.types.package; + type = lib.types.nullOr lib.types.package; + default = null; description = '' Default browser package. ''; @@ -174,7 +180,8 @@ files = { package = lib.mkOption { - type = lib.types.package; + type = lib.types.nullOr lib.types.package; + default = null; description = '' Default file manager package. ''; diff --git a/src/modules/nix/nix.nix b/src/modules/nix/nix.nix index a3315cc4b..1949bca58 100644 --- a/src/modules/nix/nix.nix +++ b/src/modules/nix/nix.nix @@ -33,7 +33,7 @@ let "https://haras.cachix.org" "https://cache.nixos.org" "https://nix-community.cachix.org" - "https://cuda-maintainers.cachix.org" + "https://cache.nixos-cuda.org" "https://comfyui.cachix.org" "https://cache.numtide.com" "https://noctalia.cachix.org" @@ -42,7 +42,7 @@ let "haras.cachix.org-1:/HIo1JYqOIH1Nwk1EGXhuPPvDW0WekxIbY5CiXUZbYw=" "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E=" + "cache.nixos-cuda.org:74DUi4Ye579gUqzH4ziL9IyiJBlDpMRn9MBN8oNan9M=" "comfyui.cachix.org-1:33mf9VzoIjzVbp0zwj+fT51HG0y31ZTK3nzYZAX0rec=" "niks3.numtide.com-1:DTx8wZduET09hRmMtKdQDxNNthLQETkc/yaX7M4qK0g=" "noctalia.cachix.org-1:pCOR47nnMEo5thcxNDtzWpOxNFQsBRglJzxWPp3dkU4=" diff --git a/src/modules/nix/nixpkgs.nix b/src/modules/nix/nixpkgs.nix index 0d945bbb1..79f07f026 100644 --- a/src/modules/nix/nixpkgs.nix +++ b/src/modules/nix/nixpkgs.nix @@ -21,16 +21,21 @@ }; }; - config = { - _module.args.unstablePkgs = import inputs.nixpkgs-unstable { - system = pkgs.stdenv.hostPlatform.system; - }; + config = + let + hardware = config.dot.hardware; + in + { + _module.args.unstablePkgs = import inputs.nixpkgs-unstable { + system = pkgs.stdenv.hostPlatform.system; + }; - # NOTE: lots of packages broken right now - nixpkgs.config.rocmSupport = false; - nixpkgs.config.allowUnfreePredicate = - package: builtins.any (predicate: predicate package) config.dot.nixpkgs.allowUnfreePredicates; - }; + nixpkgs.config.cudaSupport = hardware.cuda; + # NOTE: lots of packages broken right now + nixpkgs.config.rocmSupport = hardware.rocm; + nixpkgs.config.allowUnfreePredicate = + package: builtins.any (predicate: predicate package) config.dot.nixpkgs.allowUnfreePredicates; + }; }; machines.homeModules.nixpkgs = { osConfig, ... }: { diff --git a/src/modules/programs/wf-recorder-slurp.nix b/src/modules/programs/wf-recorder-slurp.nix index e30a6f6e2..e9ea1cb11 100644 --- a/src/modules/programs/wf-recorder-slurp.nix +++ b/src/modules/programs/wf-recorder-slurp.nix @@ -8,7 +8,7 @@ ... }: let - cuda = config.nixpkgs.config.cudaSupport; + cuda = osConfig.dot.hardware.cuda; codec = if cuda then "hevc_nvenc" else "libx265"; diff --git a/src/modules/services/syncthing.nix b/src/modules/services/syncthing.nix index 0127c3bb5..63f2aa737 100644 --- a/src/modules/services/syncthing.nix +++ b/src/modules/services/syncthing.nix @@ -13,7 +13,7 @@ in let hardware = config.dot.hardware; in - lib.mkIf hardware.network { + lib.mkIf (hardware.network && hardware.browser) { networking.firewall.allowedTCPPorts = [ port ]; @@ -30,7 +30,7 @@ in let hardware = osConfig.dot.hardware; in - lib.mkIf hardware.network { + lib.mkIf (hardware.network && hardware.browser) { services.syncthing.enable = true; services.syncthing.guiAddress = address; services.syncthing.tray.enable = lib.mkIf hardware.graphics true;