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 15, 2024
1 parent 8956126 commit d10f8b3
Show file tree
Hide file tree
Showing 16 changed files with 1,417 additions and 59 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ trim_trailing_whitespace = false
# windows shell scripts
[*.{cmd,bat,ps1}]
end_of_line = crlf

# npins
[.sources/sources.json]
trim_trailing_whitespace = false
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
21 changes: 0 additions & 21 deletions dev/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 2 additions & 7 deletions dev/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,9 @@
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};

mdbook = {
url = "github:catppuccin/mdbook";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = { self, nixpkgs, home-manager, mdbook }:
outputs = { self, nixpkgs, home-manager }:
let
systems = [
"x86_64-linux"
Expand Down Expand Up @@ -60,7 +55,7 @@
let
version = self.shortRev or self.dirtyShortRev or "unknown";
mkOptionDoc = pkgs.callPackage ../docs/options-doc.nix { };
mkSite = pkgs.callPackage ../docs/mk-site.nix { inherit (mdbook.packages.${system}) mdbook-catppuccin; };
mkSite = pkgs.callPackage ../docs/mk-site.nix { };
packages' = self.packages.${system};
in
{
Expand Down
1 change: 1 addition & 0 deletions docs/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ src = "src"
[output.html]
default-theme = "mocha"
preferred-dark-theme = "mocha"
additional-css = ["./theme/catppuccin.css"]
no-section-label = true
git-repository-url = "https://github.com/catppuccin/nix"
git-repository-icon = "fa-github"
Expand Down
17 changes: 4 additions & 13 deletions docs/mk-site.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,20 @@
, stdenvNoCC
, writeShellApplication
, mdbook
, mdbook-catppuccin
, simple-http-server
, python3
}: { nixosDoc
, homeManagerDoc
, ...
}@args:
stdenvNoCC.mkDerivation (finalAttrs: args // {
nativeBuildInputs = [
mdbook
mdbook-catppuccin
];

dontPatch = true;
dontConfigure = true;
doCheck = false;

configurePhase = ''
runHook preConfigure
mdbook-catppuccin install
runHook postConfigure
'';

buildPhase = ''
runHook preBuild
Expand All @@ -47,10 +38,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. Contributions - 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
];
};
};
}
````
Loading

0 comments on commit d10f8b3

Please sign in to comment.