From d55f807f120bb7954e67fe9f39fb13c91464e5df Mon Sep 17 00:00:00 2001 From: Kieran Klukas Date: Fri, 19 Sep 2025 14:32:43 -0400 Subject: [PATCH] docs: add bit about nixos module (#606) --- README.md | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/README.md b/README.md index 616b6191f4364325bcea8d985dff9594173765de..aedd503e42ed3564627a891d41d8874740c1ea3c 100644 --- a/README.md +++ b/README.md @@ -64,8 +64,64 @@ nix-channel --update nix-shell -p '(import { pkgs = import {}; }).repos.charmbracelet.crush' ``` +### NixOS & Home Manager Module Usage via NUR + +Crush provides NixOS and Home Manager modules via NUR. +You can use these modules directly in your flake by importing them from NUR. Since it auto detects whether its a home manager or nixos context you can use the import the exact same way :) + +```nix +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + nur.url = "github:nix-community/NUR"; + }; + + outputs = { self, nixpkgs, nur, ... }: { + nixosConfigurations.your-hostname = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + nur.modules.nixos.default + nur.repos.charmbracelet.modules.crush + { + programs.crush = { + enable = true; + settings = { + providers = { + openai = { + id = "openai"; + name = "OpenAI"; + base_url = "https://api.openai.com/v1"; + type = "openai"; + api_key = "sk-fake123456789abcdef..."; + models = [ + { + id = "gpt-4"; + name = "GPT-4"; + } + ]; + }; + }; + lsp = { + go = { command = "gopls"; enabled = true; }; + nix = { command = "nil"; enabled = true; }; + }; + options = { + context_paths = [ "/etc/nixos/configuration.nix" ]; + tui = { compact_mode = true; }; + debug = false; + }; + }; + }; + } + ]; + }; + }; +} +``` + +
Debian/Ubuntu