on main help sign in
docs: add bit about nixos module (#606)
d55f807Kieran Klukas
README.md+56
@@ -64,8 +64,64 @@ nix-channel --update
64nix-shell -p '(import <nur> { pkgs = import <nixpkgs> {}; }).repos.charmbracelet.crush'
64nix-shell -p '(import <nur> { pkgs = import <nixpkgs> {}; }).repos.charmbracelet.crush'
65```
65```
66
66
67+### NixOS & Home Manager Module Usage via NUR
68+
69+Crush provides NixOS and Home Manager modules via NUR.
70+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 :)
71+
72+```nix
73+{
74+ inputs = {
75+ nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
76+ nur.url = "github:nix-community/NUR";
77+ };
78+
79+ outputs = { self, nixpkgs, nur, ... }: {
80+ nixosConfigurations.your-hostname = nixpkgs.lib.nixosSystem {
81+ system = "x86_64-linux";
82+ modules = [
83+ nur.modules.nixos.default
84+ nur.repos.charmbracelet.modules.crush
85+ {
86+ programs.crush = {
87+ enable = true;
88+ settings = {
89+ providers = {
90+ openai = {
91+ id = "openai";
92+ name = "OpenAI";
93+ base_url = "https://api.openai.com/v1";
94+ type = "openai";
95+ api_key = "sk-fake123456789abcdef...";
96+ models = [
97+ {
98+ id = "gpt-4";
99+ name = "GPT-4";
100+ }
101+ ];
102+ };
103+ };
104+ lsp = {
105+ go = { command = "gopls"; enabled = true; };
106+ nix = { command = "nil"; enabled = true; };
107+ };
108+ options = {
109+ context_paths = [ "/etc/nixos/configuration.nix" ];
110+ tui = { compact_mode = true; };
111+ debug = false;
112+ };
113+ };
114+ };
115+ }
116+ ];
117+ };
118+ };
119+}
120+```
121+
67</details>
122</details>
68
123
124+
69<details>
125<details>
70<summary><strong>Debian/Ubuntu</strong></summary>
126<summary><strong>Debian/Ubuntu</strong></summary>
71
127