diff --git a/src/app/page.tsx b/src/app/page.tsx index 99b74ef..f887c5e 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -38,7 +38,9 @@ export default function Home() { aurAppNames, isHydrated, selectedHelper, - setSelectedHelper + setSelectedHelper, + hasUnfreePackages, + unfreeAppNames, } = useLinuxInit(); // Search state @@ -349,6 +351,8 @@ export default function Home() { clearAll={clearAll} selectedHelper={selectedHelper} setSelectedHelper={setSelectedHelper} + hasUnfreePackages={hasUnfreePackages} + unfreeAppNames={unfreeAppNames} /> ); diff --git a/src/components/command/CommandDrawer.tsx b/src/components/command/CommandDrawer.tsx index acb1529..ae2f39d 100644 --- a/src/components/command/CommandDrawer.tsx +++ b/src/components/command/CommandDrawer.tsx @@ -1,8 +1,9 @@ 'use client'; import { useState, useRef } from 'react'; -import { Check, Copy, X, Download } from 'lucide-react'; +import { Check, Copy, X, Download, AlertTriangle } from 'lucide-react'; import { AurDrawerSettings } from './AurDrawerSettings'; +import type { DistroId } from '@/lib/data'; interface CommandDrawerProps { isOpen: boolean; @@ -21,13 +22,14 @@ interface CommandDrawerProps { selectedHelper: 'yay' | 'paru'; setSelectedHelper: (helper: 'yay' | 'paru') => void; distroColor: string; + distroId: DistroId; + // Nix unfree warning + hasUnfreePackages?: boolean; + unfreeAppNames?: string[]; } -/** - * Command drawer that shows the generated install command. - * Acts as a bottom sheet on mobile (swipe to dismiss) and a centered modal on desktop. - * If you're reading this, yes, I did spend way too much time on the animations. - */ +// Command drawer - bottom sheet on mobile, modal on desktop. +// Nix gets special treatment: shows config file instead of terminal command. export function CommandDrawer({ isOpen, isClosing, @@ -44,7 +46,11 @@ export function CommandDrawer({ selectedHelper, setSelectedHelper, distroColor, + distroId, + hasUnfreePackages = false, + unfreeAppNames = [], }: CommandDrawerProps) { + const isNix = distroId === 'nix'; // Swipe-to-dismiss for mobile users who hate tapping tiny X buttons const [dragOffset, setDragOffset] = useState(0); const [isDragging, setIsDragging] = useState(false); @@ -126,7 +132,9 @@ export function CommandDrawer({
{selectedCount} apps selected
@@ -154,10 +162,25 @@ export function CommandDrawer({ /> )} + {/* Nix unfree packages warning */} + {isNix && hasUnfreePackages && ( +Unfree packages
+
+ {unfreeAppNames.join(', ')} require nixpkgs.config.allowUnfree = true
+