Skip to content

Commit

Permalink
feat: flesh out docs site
Browse files Browse the repository at this point in the history
  • Loading branch information
getchoo committed May 14, 2024
1 parent 4f57d51 commit 7d74aff
Show file tree
Hide file tree
Showing 10 changed files with 274 additions and 21 deletions.
47 changes: 31 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@

## Usage

You will probably want to see our [Getting started guide](http://nix.catppuccin.com/getting-started/index.html), but as a TLDR:

1. Import the [NixOS](https://nixos.org) and [home-manager](https://github.com/nix-community/home-manager) modules

<details>
Expand All @@ -44,26 +46,26 @@
```nix
{
inputs = {
nixpkgs.url = "nixpkgs/nixos-22.11";
nixpkgs.url = "nixpkgs/nixos-unstable";
catppuccin.url = "github:catppuccin/nix";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { nixpkgs, catppuccin, home-manager }: let
system = "x86_64-linux";
pkgs = import nixpkgs {inherit system;};
in {
outputs = { nixpkgs, catppuccin, home-manager }: {
# for nixos module home-manager installations
nixosConfigurations.host = pkgs.lib.nixosSystem {
inherit system;
nixosConfigurations.pepperjacksComputer = pkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
catppuccin.nixosModules.catppuccin
# if you use home-manager
home-manager.nixosModules.home-manager
{
home-manager.users.user = {
# if you use home-manager
home-manager.users.pepperjack = {
imports = [
./home.nix
catppuccin.homeManagerModules.catppuccin
Expand All @@ -74,9 +76,10 @@
};
# for standalone home-manager installations
homeConfigurations.user = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
homeConfigurations.pepperjack = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
modules = [
./home.nix
catppuccin.homeManagerModules.catppuccin
];
};
Expand All @@ -100,11 +103,13 @@ For [NixOS module installations](https://nix-community.github.io/home-manager/in
```nix
{
imports = [
<home-manager/nixos>
<catppuccin/modules/nixos>
# if you use home-manager
<home-manager/nixos>
];
home-manager.users.user = {
# if you use home-manager
home-manager.users.pepperjack = {
imports = [
<catppuccin/modules/home-manager>
];
Expand All @@ -121,8 +126,7 @@ For [standalone installations](https://nix-community.github.io/home-manager/inde
<catppuccin/modules/home-manager>
];
home.username = "user";
home.homeDirectory = "user";
home.username = "pepperjack";
programs.home-manager.enable = true;
}
```
Expand All @@ -148,11 +152,22 @@ For [standalone installations](https://nix-community.github.io/home-manager/inde
}
```

4. Enable for all available programs you're using!

```nix
{
catppuccin.enable = true;
}
```

## 🙋 FAQ

- Q: **"How do I know what programs are supported?"**\
A: You can find programs supported through home-manager [here](https://github.com/catppuccin/nix/tree/main/modules/home-manager),
and NixOS modules [here](https://github.com/catppuccin/nix/tree/main/modules/nixos)
A: You can find programs supported through home-manager [here](https://nix.catppuccin.com/options/home-manager-options.html),
and NixOS modules [here](https://nix.catppuccin.com/options/nixos-options.html)

- Q: **"How do I set `catppuccin.enable` for everything I use?"**\
A: You can set `catppuccin.enable` [globally](options/nixos-options.md#catppuccinenable)

## 💝 Thanks to

Expand Down
6 changes: 3 additions & 3 deletions docs/mk-site.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
, writeShellApplication
, mdbook
, mdbook-catppuccin
, simple-http-server
, python3
}: { nixosDoc
, homeManagerDoc
, ...
Expand Down Expand Up @@ -47,10 +47,10 @@ stdenvNoCC.mkDerivation (finalAttrs: args // {
serve = writeShellApplication {
name = "serve";

runtimeInputs = [ simple-http-server ];
runtimeInputs = [ python3 ];

text = ''
simple-http-server --index --ip 127.0.0.1 ${finalAttrs.finalPackage}
python -m http.server --bind 127.0.0.1 --directory ${finalAttrs.finalPackage}
'';
};
};
Expand Down
5 changes: 5 additions & 0 deletions docs/src/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Contributing

`catppuccin/nix` is an open source, [MIT licensed](https://github.com/catppuccin/nix/blob/main/LICENSE) project. Contributors - including bug reports, feature requests, and improvements - can be made on our [GitHub repository](https://github.com/catppuccin/nix).

If you are interested in hacking away at our modules, make sure to read our [Contributing guidelines](https://github.com/catppuccin/nix/blob/main/CONTRIBUTING.md)
17 changes: 15 additions & 2 deletions docs/src/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Hello world!
# catppuccin/nix

TODO
*The soothing pastel theme - now for Nix!*

Built on top of [NixOS](https://nixos.org) and [home-manager](https://github.com/nix-community/home-manager), `catppuccin/nix` allows you to easily use Catppuccin across all of your apps!

## What you'll find here

You should first check out our [Getting started](getting-started) guide. Once you're done, you can take a look at all of our available options:

- [For NixOS](options/nixos-options.md)
- [For home-manager](options/home-manager-options.md)

## Find a problem?

Feel free to [open an issue!](https://github.com/catppuccin/nix/issues/new)
8 changes: 8 additions & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

[Introduction](README.md)

- [Getting started](getting-started/README.md)
- [Stable Nix](getting-started/stable-nix.md)
- [Flakes](getting-started/flakes.md)

- [Module options](options/README.md)
- [NixOS](options/nixos-options.md)
- [home-manager](options/home-manager-options.md)

- [FAQ](faq.md)

- [Contributing](CONTRIBUTING.md)
8 changes: 8 additions & 0 deletions docs/src/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# FAQ

- Q: **"How do I know what programs are supported?"**\
A: You can find programs supported through home-manager [here](options/home-manager-options.md),
and NixOS modules [here](options/nixos-options.md)

- Q: **"How do I set `catppuccin.enable` for everything I use?"**\
A: You can set `catppuccin.enable` [globally](options/nixos-options.md#catppuccinenable)
6 changes: 6 additions & 0 deletions docs/src/getting-started/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Getting started

`catppuccin/nix` supports both stable Nix and [Flakes](https://wiki.nixos.org/wiki/Flakes)! Select one of the options below based on what you want to use.

- [Stable Nix](stable-nix.md)
- [Flakes](flakes.md)
100 changes: 100 additions & 0 deletions docs/src/getting-started/flakes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Flakes

Flakes are the preferred way to to use `catppuccin/nix` and will be the easiest method for those with them enabled


First, we need to add this project to our inputs so we can use it in our configurations:

```nix
{
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
catppuccin.url = "github:catppuccin/nix";
};
}
```

After, we can use them in a NixOS configuration like so

```nix
{
nixosConfigurations.pepperjacksComputer = {
system = "x86_64-linux";
modules = [
catppuccin.nixosModules.catppuccin
# if you use home-manager
home-manager.nixosModules.home-manager
{
# if you use home-manager
home-manager.users.pepperjack = {
imports = [
./home.nix
catppuccin.homeManagerModules.catppuccin
];
};
}
];
};
}
```

or if you use a [standalone installation](https://nix-community.github.io/home-manager/index.html#sec-install-standalone) of `home-manager`

```nix
{
homeConfigurations.pepperjack = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
modules = [
./home.nix
catppuccin.homeManagerModules.catppuccin
];
};
}
```

By the end, you should have a flake.nix that looks something like this
```nix
{
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
catppuccin.url = "github:catppuccin/nix";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { nixpkgs, catppuccin, home-manager }: {
# for nixos module home-manager installations
nixosConfigurations.pepperjacksComputer = pkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
catppuccin.nixosModules.catppuccin
# if you use home-manager
home-manager.nixosModules.home-manager
{
# if you use home-manager
home-manager.users.pepperjack = {
imports = [
./home.nix
catppuccin.homeManagerModules.catppuccin
];
};
}
];
};
# for standalone home-manager installations
homeConfigurations.pepperjack = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
modules = [
./home.nix
catppuccin.homeManagerModules.catppuccin
];
};
};
}
````
94 changes: 94 additions & 0 deletions docs/src/getting-started/stable-nix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Stable Nix

When using stable Nix, we have a couple options for installing `catppuccin/nix`

### With npins

[npins](https://github.com/andir/npins) provides a way to easily ["pin"](https://nix.dev/tutorials/first-steps/towards-reproducibility-pinning-nixpkgs) and update external dependencies for your configurations.

Assuming you have followed [their getting started guide](https://github.com/andir/npins#getting-started), you can run the following:

```sh
npins add --name catppuccin github catppuccin nix --name
```

And in your system configuration:

```nix
let
sources = import ./npins;
in
{
imports = [
(sources.catppuccin + "/modules/nixos")
];
# if you use home-manager
home-manager.users.pepperjack = {
imports = [
(sources.catppuccin + "/modules/home-manager")
];
};
}
```

or if you use a [standalone installation](https://nix-community.github.io/home-manager/index.html#sec-install-standalone) of `home-manager`

```nix
let
sources = import ./npins.nix;
in
{
imports = [
(sources.catppuccin + "/modules/home-manager")
];
home.username = "pepperjack";
programs.home-manager.enable = true;
}
```

## With channels

[Nix channels](https://nixos.org/manual/nix/stable/command-ref/nix-channel.html) provide a way for you to easily download, update, and use our modules -- though at the cost of reproducibility across machines.

To add `catppuccin/nix` as a channel, you can run the following:


```sh
sudo nix-channel --add https://github.com/catppuccin/nix/archive/main.tar.gz catppuccin
sudo nix-channel --update
```

And in your system configuration:

```nix
{
imports = [
<catppuccin/modules/nixos>
];
# if you use home-manager
home-manager.users.pepperjack = {
imports = [
<catppuccin/modules/home-manager>
];
};
}
```

or if you use a [standalone installation](https://nix-community.github.io/home-manager/index.html#sec-install-standalone) of `home-manager`

```nix
{
imports = [
<catppuccin/modules/home-manager>
];
home.username = "pepperjack";
programs.home-manager.enable = true;
}
```

4 changes: 4 additions & 0 deletions docs/src/options/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Module Options

Below is a (searchable) list of all the options in the modules we provide. Enjoy!

- [NixOS options](nixos-options.md)
- [home-manager options](home-manager-options.md)

If you have any issues with this documentation, don't hesitate to [open an issue](https://github.com/catppuccin/nix/issues/new).

0 comments on commit 7d74aff

Please sign in to comment.