Initial commit

This commit is contained in:
kirbara 2025-12-01 13:23:24 +07:00
commit cfcc57a8bd
Signed by: exp
GPG key ID: D7E63AD0019E75D9
353 changed files with 18756 additions and 0 deletions

View file

@ -0,0 +1,62 @@
{
den.aspects = {
kirakira = {
nixos =
{ pkgs, ... }:
{
boot.initrd.kernelModules = [ "amdgpu" ];
boot.kernelModules = [ "amdgpu" ];
hardware.graphics = {
enable = true;
enable32Bit = true;
package = pkgs.mesa;
extraPackages = with pkgs; [
rocmPackages.clr.icd
intel-media-driver
vaapi-intel-hybrid
libvdpau-va-gl
libva
];
};
hardware.amdgpu.opencl.enable = true;
services.xserver = {
deviceSection = ''
Option "TearFree" "true"
'';
videoDrivers = [ "modesetting" ];
};
environment.variables = {
AMD_VULKAN_ICD = "RADV";
MESA_SHADER_CACHE_MAX_SIZE = "12G";
RADV_PERFTEST = "rt";
};
# HIP support
systemd.tmpfiles.rules =
let
rocmEnv = pkgs.symlinkJoin {
name = "rocm-combined";
paths = with pkgs.rocmPackages; [
rocblas
hipblas
clr
];
};
in
[
"L+ /opt/rocm - - - - ${rocmEnv}"
];
# Graphic tools
environment.systemPackages = [
pkgs.clinfo
pkgs.glxinfo
pkgs.lact
pkgs.amdgpu_top
pkgs.vulkan-tools
pkgs.vulkan-loader
pkgs.vulkan-validation-layers
pkgs.libva-utils
];
};
};
};
}

View file

@ -0,0 +1,26 @@
{
den.aspects = {
kirakira = {
nixos =
{ lib, ... }:
{
boot = {
loader.systemd-boot.enable = true;
loader.efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot";
};
kernel = {
sysctl = {
"net.ipv4.conf.all.forwarding" = lib.mkForce true;
"net.ipv6.conf.all.forwarding" = lib.mkForce true;
};
};
kernelModules = [
"v4l2loopback"
];
};
};
};
};
}

View file

@ -0,0 +1,42 @@
{
den.aspects = {
kirakira = {
nixos =
{ pkgs, ... }:
{
boot.supportedFilesystems = [
"ext4"
"btrfs"
"xfs"
"ntfs"
"fat"
"vfat"
"exfat"
];
environment.systemPackages = [
pkgs.ntfs3g
pkgs.sshfs
];
fileSystems."/mnt/infra" = {
device = "/home/kirbara/infra";
fsType = "none";
options = [ "bind" ];
};
fileSystems."/mnt/desktop-data" = {
device = "UUID=f4910404-6ca1-4e5f-8f2b-07d7cd911b07";
fsType = "btrfs";
options = [
"defaults"
"noatime"
"compress=zstd:3"
"space_cache=v2"
"discard=async"
];
};
};
};
};
}

View file

@ -0,0 +1,70 @@
{
flake-file.inputs = {
nixos-vfio.url = "github:j-brn/nixos-vfio";
nixos-vfio.inputs.nixpkgs.follows = "nixpkgs";
};
den.aspects = {
kirakira = {
nixos =
{ inputs, config, pkgs, lib, ... }:
{
imports = [
inputs.nixos-vfio.nixosModules.vfio
];
virtualisation.libvirtd = {
deviceACL = [
"/dev/kvm"
"/dev/kvmfr0"
"/dev/kvmfr1"
"/dev/kvmfr2"
"/dev/shm/scream"
"/dev/shm/looking-glass"
"/dev/null"
"/dev/full"
"/dev/zero"
"/dev/random"
"/dev/urandom"
"/dev/ptmx"
"/dev/kvm"
"/dev/kqemu"
"/dev/rtc"
"/dev/hpet"
"/dev/vfio/vfio"
];
};
virtualisation.vfio = {
enable = true;
IOMMUType = "intel";
devices = [ # run `lspci -nn` for check
"1002:73df" # amd graphic card
"8086:4682" # intel uhd
];
};
virtualisation.kvmfr = {
enable = true;
devices = lib.singleton {
size = 128;
permissions = {
user = "kirbara"; #unsolved
mode = "0777";
};
};
};
# boot.blacklistedKernelModules = [
# "amdgpu"
# "radeon"
# ];
environment.systemPackages = [
pkgs.looking-glass-client
pkgs.pciutils
];
};
};
};
}

View file

@ -0,0 +1,43 @@
{
den.aspects = {
kirakira = {
nixos =
# ----- configuration-hardware. generated, do not change
{ config, lib, modulesPath, ... }:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [
"vmd"
"xhci_pci"
"ahci"
"nvme"
"usbhid"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/0edb145c-5843-4cb2-b6ff-3589958fca15";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/DF8F-3E3A";
fsType = "vfat";
options = [
"fmask=0077"
"dmask=0077"
];
};
swapDevices = [ ];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
};
};
};
}

View file

@ -0,0 +1,11 @@
{
den.aspects = {
home-file-kirakira = {
homeManager =
{ config, ... }:
{
home.file."note/widget/diary".source = config.lib.file.mkOutOfStoreSymlink "/home/kirbara/note/main/diary";
};
};
};
}

View file

@ -0,0 +1,20 @@
{
den.aspects = {
kirakira = {
nixos =
{ pkgs, ... }:
{
services.ollama = {
acceleration = "rocm";
environmentVariables = {
HCC_AMDGPU_TARGET = "gfx1031";
};
rocmOverrideGfx = "10.3.0";
};
environment.systemPackages = [
pkgs.latest.ollama-rocm
];
};
};
};
}

View file

@ -0,0 +1,18 @@
{
den.aspects = {
kirakira = {
nixos =
{ pkgs, ... }:
{
users.groups.libvirtd.members = [ "kirbara" ];
users.users.kirbara = {
extraGroups = [
"podman"
"libvirtd"
"vboxusers"
];
};
};
};
};
}