Add Gowin FPGA toolchain for desktop development.

Vendor Gowin EDU IDE, add openFPGALoader/Yosys/nextpnr/Apicula, and USB udev rules for Tang boards.
This commit is contained in:
WHC
2026-09-19 18:34:38 +08:00
parent e9aa3124fe
commit cac29b4c79
11 changed files with 296 additions and 28 deletions
+1
View File
@@ -10,6 +10,7 @@
../../modules/gaming.nix
../../modules/printing.nix
../../modules/apps.nix
../../modules/fpga.nix
];
networking.hostName = "desktop";
+26 -25
View File
@@ -1,43 +1,42 @@
# 目标机(i7-12700F + RTX 4060)上必须重新生成本文件,当前为占位骨架。
#
# 安装时在目标机执行:
# sudo nixos-generate-config --root /mnt # 若在 live 安装环境
# # 或已装系统上:
# sudo nixos-generate-config
# 然后把生成的 hardware-configuration.nix 内容覆盖本文件(保留下面 nvidia 相关不要被冲掉的话,
# 显卡驱动在 modules/nvidia.nix,本文件只放磁盘/CPU/固件)。
#
# 切勿带着本仓库里旧机器(Ultra 9 / 另一块盘 UUID)的分区信息开机。
# Generated for this machine by ‘nixos-generate-config’ (from the installer).
# Disk layout: single btrfs disk with /, /nix, /home subvolumes + ESP + swap.
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [
"vmd"
"xhci_pci"
"ahci"
"nvme"
"usbhid"
"uas"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
# === 必须按目标机实际分区改 UUID / 挂载点 ===
# fileSystems."/" = { device = "/dev/disk/by-uuid/REPLACE-ROOT"; fsType = "ext4"; };
# fileSystems."/boot" = { device = "/dev/disk/by-uuid/REPLACE-ESP"; fsType = "vfat"; options = [ "fmask=0077" "dmask=0077" ]; };
# swapDevices = [ { device = "/dev/disk/by-uuid/REPLACE-SWAP"; } ];
fileSystems."/" = lib.mkDefault {
device = "/dev/disk/by-uuid/REPLACE-ME-ROOT-UUID";
fsType = "ext4";
fileSystems."/" = {
device = "/dev/disk/by-uuid/6fe797fa-edcc-4e9f-b3e0-aac88c454563";
fsType = "btrfs";
};
fileSystems."/boot" = lib.mkDefault {
device = "/dev/disk/by-uuid/REPLACE-ME-BOOT-UUID";
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/6fe797fa-edcc-4e9f-b3e0-aac88c454563";
fsType = "btrfs";
options = [ "subvol=nix" ];
};
fileSystems."/home" = {
device = "/dev/disk/by-uuid/6fe797fa-edcc-4e9f-b3e0-aac88c454563";
fsType = "btrfs";
options = [ "subvol=home" ];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/5779-DFED";
fsType = "vfat";
options = [
"fmask=0077"
@@ -45,7 +44,9 @@
];
};
swapDevices = lib.mkDefault [ ];
swapDevices = [
{ device = "/dev/disk/by-uuid/55d9c36c-6692-4fb7-bc2e-20fe4978576e"; }
];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
@@ -0,0 +1,53 @@
# 目标机(i7-12700F + RTX 4060)上必须重新生成本文件,当前为占位骨架。
#
# 安装时在目标机执行:
# sudo nixos-generate-config --root /mnt # 若在 live 安装环境
# # 或已装系统上:
# sudo nixos-generate-config
# 然后把生成的 hardware-configuration.nix 内容覆盖本文件(保留下面 nvidia 相关不要被冲掉的话,
# 显卡驱动在 modules/nvidia.nix,本文件只放磁盘/CPU/固件)。
#
# 切勿带着本仓库里旧机器(Ultra 9 / 另一块盘 UUID)的分区信息开机。
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usbhid"
"uas"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
# === 必须按目标机实际分区改 UUID / 挂载点 ===
# fileSystems."/" = { device = "/dev/disk/by-uuid/REPLACE-ROOT"; fsType = "ext4"; };
# fileSystems."/boot" = { device = "/dev/disk/by-uuid/REPLACE-ESP"; fsType = "vfat"; options = [ "fmask=0077" "dmask=0077" ]; };
# swapDevices = [ { device = "/dev/disk/by-uuid/REPLACE-SWAP"; } ];
fileSystems."/" = lib.mkDefault {
device = "/dev/disk/by-uuid/REPLACE-ME-ROOT-UUID";
fsType = "ext4";
};
fileSystems."/boot" = lib.mkDefault {
device = "/dev/disk/by-uuid/REPLACE-ME-BOOT-UUID";
fsType = "vfat";
options = [
"fmask=0077"
"dmask=0077"
];
};
swapDevices = lib.mkDefault [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.enableRedistributableFirmware = true;
}