fix: Use usda-vision from flake inputs when loaded with athenix
This commit is contained in:
86
default.nix
86
default.nix
@@ -1,69 +1,53 @@
|
||||
{ usda-vision-packages ? null
|
||||
, envFile ? null
|
||||
, azureEnvFile ? null
|
||||
, ...
|
||||
}:
|
||||
|
||||
# ============================================================================
|
||||
# USDA Dashboard External System Module
|
||||
# ============================================================================
|
||||
# External system configuration for usda-dash
|
||||
# This module can be referenced from nixos-systems/inventory.nix using:
|
||||
#
|
||||
# nix-lxc = {
|
||||
# devices = {
|
||||
# "usda-dash" = builtins.fetchGit {
|
||||
# url = "https://git.factory.uga.edu/MODEL/usda-dash-config.git";
|
||||
# rev = "commit-hash";
|
||||
# submodules = true; # REQUIRED for usda-vision submodule
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
#
|
||||
# IMPORTANT: For LXC containers running Docker, the Proxmox LXC must be configured with:
|
||||
# - Features: nesting=1, keyctl=1
|
||||
# - Unprivileged: no (or privileged: yes)
|
||||
# Edit the container config in Proxmox: /etc/pve/lxc/<VMID>.conf
|
||||
# Add: features: nesting=1,keyctl=1
|
||||
#
|
||||
# USAGE FROM ATHENIX:
|
||||
#
|
||||
# 1. Add usda-vision as a flake input in athenix/flake.nix:
|
||||
# 1. Add required flake inputs in athenix/flake.nix:
|
||||
#
|
||||
# inputs.usda-vision = {
|
||||
# url = "path:/path/to/usda-dash-config/usda-vision";
|
||||
# inputs.nixpkgs.follows = "nixpkgs";
|
||||
# inputs = {
|
||||
# usda-vision = {
|
||||
# url = "git+https://git.factory.uga.edu/MODEL/usda-vision.git";
|
||||
# inputs.nixpkgs.follows = "nixpkgs";
|
||||
# };
|
||||
# ragenix = {
|
||||
# url = "github:yaxitech/ragenix";
|
||||
# inputs.nixpkgs.follows = "nixpkgs";
|
||||
# };
|
||||
# };
|
||||
#
|
||||
# 2. In inventory.nix, pass the usda-vision packages and ragenix-managed secrets:
|
||||
# 2. Pass inputs to modules via specialArgs:
|
||||
#
|
||||
# imports = [
|
||||
# (import /path/to/usda-dash-config/default.nix {
|
||||
# usda-vision-packages = inputs.usda-vision.packages.${system};
|
||||
# envFile = config.age.secrets.usda-vision-env.path;
|
||||
# azureEnvFile = config.age.secrets.usda-vision-azure-env.path;
|
||||
# })
|
||||
# ];
|
||||
# nixosConfigurations.proxmox-usda-dash = nixpkgs.lib.nixosSystem {
|
||||
# specialArgs = { inherit inputs; };
|
||||
# modules = [
|
||||
# ./path/to/usda-dash-config/default.nix
|
||||
# ];
|
||||
# };
|
||||
#
|
||||
# 3. Configure secrets in your athenix configuration:
|
||||
#
|
||||
# age.secrets.usda-vision-env = {
|
||||
# file = ./secrets/usda-vision/env.age;
|
||||
# };
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, inputs
|
||||
, ...
|
||||
}:
|
||||
|
||||
let
|
||||
# Get packages from the parameter passed by athenix
|
||||
# Fallback to local callPackage if not provided (for standalone testing)
|
||||
camera-sdk =
|
||||
if usda-vision-packages != null
|
||||
then usda-vision-packages.camera-sdk
|
||||
else pkgs.callPackage ./usda-vision/camera-sdk.nix {};
|
||||
|
||||
usda-vision-app =
|
||||
if usda-vision-packages != null
|
||||
then usda-vision-packages.usda-vision
|
||||
else pkgs.callPackage ./usda-vision/package.nix {};
|
||||
# Get packages from flake inputs
|
||||
camera-sdk = inputs.usda-vision.packages.${pkgs.system}.camera-sdk;
|
||||
usda-vision-app = inputs.usda-vision.packages.${pkgs.system}.usda-vision;
|
||||
|
||||
# Get secret paths from age configuration (if configured)
|
||||
envFile = config.age.secrets.usda-vision-env.path or null;
|
||||
azureEnvFile = config.age.secrets.usda-vision-azure-env.path or null;
|
||||
in
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user