diff --git a/main.go b/main.go index 1364abb..46f5246 100644 --- a/main.go +++ b/main.go @@ -151,9 +151,11 @@ func getPkgs() string { return pkgs } if strings.HasPrefix(dist, "NixOS") { - out, _ := exec.Command("sh", "-c", "nix-env -qa --installed | wc -l").Output() - pkgs = strings.TrimSpace(string(out)) + " (nix)" - return pkgs + entries, err := os.ReadDir("/run/current-system/sw/bin") + if err != nil { + return "can't get nix packages" + } + return string(rune(len(entries))) + " (nix)" } return "unknown" } @@ -161,26 +163,17 @@ func getPkgs() string { func getAscii() string { var ascii string if strings.HasPrefix(dist, "Arch") { - content, err := os.ReadFile("ascii/arch.txt") - if err != nil { - return "no ascii, but thats arch btw\n" - } + content := " _ _ _\n /\\ | | | | (_)\n / \\ _ __ ___| |__ | | _ _ __ _ ___ __\n / /\\ \\ | '__/ __| '_ \\ | | | | '_ \\| | | \\ \\/ /\n / ____ \\| | | (__| | | | | |____| | | | | |_| |> <\n /_/ \\_\\_| \\___|_| |_| |______|_|_| |_|\\__,_/_/\\_\\\n" ascii = fmt.Sprintf(string(content)) return ascii } if strings.HasPrefix(dist, "Debian") { - content, err := os.ReadFile("ascii/debian.txt") - if err != nil { - return "no ascii, but thats necrokall\n" - } + content := " _____ _ _\n | __ \\ | | (_)\n | | | | ___ | |__ _ __ _ _ __\n | | | | / _ \\ | '_ \\ | | / _` | | '_ \\\n | |__| | | __/ | |_) | | | | (_| | | | | |\n |_____/ \\___| |_.__/ |_| \\__,_| |_| |_|\n" ascii = fmt.Sprintf(string(content)) return ascii } if strings.HasPrefix(dist, "NixOS") { - content, err := os.ReadFile("ascii/nix.txt") - if err != nil { - return "no ascii, but thats NIX POBEDA\n" - } + content := " _ _ _ ____ _____\n | \\ | (_) / __ \\ / ____|\n | \\| |___ _| | | | (___\n | . ` | \\ \\/ / | | |\\___ \\\n | |\\ | |> <| |__| |____) |\n |_| \\_|_/_/\\_\\\\____/|_____/\n" ascii = fmt.Sprintf(string(content)) return ascii }