1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-29 07:52:50 -05:00

dankinstall: remove dead nix code, add doc link

This commit is contained in:
bbedward
2025-11-30 10:22:54 -05:00
parent b1834b1958
commit a55ec6416c
8 changed files with 1 additions and 618 deletions

View File

@@ -139,8 +139,6 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m.updateSelectWindowManagerState(msg)
case StateSelectTerminal:
return m.updateSelectTerminalState(msg)
case StateMissingWMInstructions:
return m.updateMissingWMInstructionsState(msg)
case StateDetectingDeps:
return m.updateDetectingDepsState(msg)
case StateDependencyReview:
@@ -183,8 +181,6 @@ func (m Model) View() string {
return m.viewSelectWindowManager()
case StateSelectTerminal:
return m.viewSelectTerminal()
case StateMissingWMInstructions:
return m.viewMissingWMInstructions()
case StateDetectingDeps:
return m.viewDetectingDeps()
case StateDependencyReview:

View File

@@ -6,7 +6,6 @@ const (
StateWelcome ApplicationState = iota
StateSelectWindowManager
StateSelectTerminal
StateMissingWMInstructions
StateDetectingDeps
StateDependencyReview
StateGentooUseFlags

View File

@@ -1,85 +0,0 @@
package tui
import (
"strings"
tea "github.com/charmbracelet/bubbletea"
)
func (m Model) viewMissingWMInstructions() string {
var b strings.Builder
b.WriteString(m.renderBanner())
b.WriteString("\n\n")
// Determine which WM is missing
wmName := "Niri"
installCmd := `environment.systemPackages = with pkgs; [
niri
];`
alternateCmd := `# Or enable the module if available:
# programs.niri.enable = true;`
if m.selectedWM == 1 {
wmName = "Hyprland"
installCmd = `programs.hyprland.enable = true;`
alternateCmd = `# Or add to systemPackages:
# environment.systemPackages = with pkgs; [
# hyprland
# ];`
}
// Title
title := m.styles.Title.Render("⚠️ " + wmName + " Not Installed")
b.WriteString(title)
b.WriteString("\n\n")
// Explanation
explanation := m.styles.Normal.Render(wmName + " needs to be installed system-wide on NixOS.")
b.WriteString(explanation)
b.WriteString("\n\n")
// Instructions
instructions := m.styles.Subtle.Render("To install " + wmName + ", add this to your /etc/nixos/configuration.nix:")
b.WriteString(instructions)
b.WriteString("\n\n")
// Command box
cmdBox := m.styles.CodeBlock.Render(installCmd)
b.WriteString(cmdBox)
b.WriteString("\n\n")
// Alternate command
altBox := m.styles.Subtle.Render(alternateCmd)
b.WriteString(altBox)
b.WriteString("\n\n")
// Rebuild instruction
rebuildInstruction := m.styles.Normal.Render("Then rebuild your system:")
b.WriteString(rebuildInstruction)
b.WriteString("\n")
rebuildCmd := m.styles.CodeBlock.Render("sudo nixos-rebuild switch")
b.WriteString(rebuildCmd)
b.WriteString("\n\n")
// Navigation help
help := m.styles.Subtle.Render("Press Esc to go back and select a different window manager, or Ctrl+C to exit")
b.WriteString(help)
return b.String()
}
func (m Model) updateMissingWMInstructionsState(msg tea.Msg) (tea.Model, tea.Cmd) {
if keyMsg, ok := msg.(tea.KeyMsg); ok {
switch keyMsg.String() {
case "esc":
// Go back to window manager selection
m.state = StateSelectWindowManager
return m, m.listenForLogs()
case "ctrl+c":
return m, tea.Quit
}
}
return m, m.listenForLogs()
}

View File

@@ -140,20 +140,6 @@ func (m Model) updateSelectTerminalState(msg tea.Msg) (tea.Model, tea.Cmd) {
m.selectedTerminal++
}
case "enter":
if m.osInfo != nil && m.osInfo.Distribution.ID == "nixos" {
var wmInstalled bool
if m.selectedWM == 0 {
wmInstalled = m.commandExists("niri")
} else {
wmInstalled = m.commandExists("hyprland") || m.commandExists("Hyprland")
}
if !wmInstalled {
m.state = StateMissingWMInstructions
return m, m.listenForLogs()
}
}
m.state = StateDetectingDeps
m.isLoading = true
return m, tea.Batch(m.spinner.Tick, m.detectDependencies())

View File

@@ -69,7 +69,7 @@ func (m Model) viewWelcome() string {
case "debian":
errorMsg = fmt.Sprintf("Debian %s is not supported.\n\nOnly Debian 13+ (Trixie) is supported.\n\nPlease upgrade to Debian 13 or later.", m.osInfo.VersionID)
case "nixos":
errorMsg = "NixOS is currently not supported, but there is a DankMaterialShell flake available."
errorMsg = "See the NixOS documentation for installation instructions: https://danklinux.com/docs/dankmaterialshell/nixos."
default:
errorMsg = fmt.Sprintf("%s is not supported.\nFeel free to request on https://github.com/AvengeMedia/DankMaterialShell", m.osInfo.PrettyName)
}