https://github.com/typovrak/nixos-stylus
π¨ Declarative NixOS module to automatically deploy and manage Stylus extension themes, Catppuccin mocha green, in Chromium and Firefox
https://github.com/typovrak/nixos-stylus
automation chromium declarative firefox nix nixos stylus
Last synced: about 1 month ago
JSON representation
π¨ Declarative NixOS module to automatically deploy and manage Stylus extension themes, Catppuccin mocha green, in Chromium and Firefox
- Host: GitHub
- URL: https://github.com/typovrak/nixos-stylus
- Owner: typovrak
- License: mit
- Created: 2025-04-27T21:00:52.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-22T11:54:21.000Z (about 1 year ago)
- Last Synced: 2025-09-02T08:44:37.215Z (10 months ago)
- Topics: automation, chromium, declarative, firefox, nix, nixos, stylus
- Language: Nix
- Homepage: https://typovrak.tv/nixos
- Size: 589 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
[](https://nixos.org/)
[](LICENSE.md)
[](https://typovrak.tv/coffee)
[](https://typovrak.tv/nixos)
[](https://typovrak.tv/discord)
# π¨ NixOS Stylus
> NixOS module for automated Stylus browser extension theme deployment with directory setup, theme file installation and idempotent configuration.
## π§© Part of the Typovrak NixOS ecosystem
This module is part of ```Typovrak NixOS```, a fully modular and declarative operating system configuration built entirely with :
- π§± **30+ standalone modules :** Each managing a specific tool, feature or aesthetic like ```zsh```, ```i3```, ```lighdm```, ```polybar```, ```gtk``` and more.
- π¨ **Catppuccin Mocha :** The default theme across terminal, GUI, and login interfaces.
- π‘οΈ **100% FOSS compliant :** No proprietary software included unless explicitly chosen.
- π§βπ» **Built for developers :** Optimized for speed, keyboard-centric workflows and expressive CLI tooling.
*Explore the full system : π [github.com/typovrak/nixos](https://github.com/typovrak/nixos)*
> [!CAUTION]
> This module is opinionated, it may **override**, **replace**, or **remove** files and settings **without** prompt. To avoid unexpected changes, **back up** your existing files or **fork** this module to take full control. **Follow this documentation** to avoid any of this problem.
## π¦ Features
- π **Secure config directory :** Creates and protects ```~/.config/stylus``` with correct ownership and permissions.
- π¨ **Theme deployment :** Installs ```catppuccin-mocha-green.json``` into the Stylus configuration folder.
- π **Idempotent :** Cleans and recreates the config directory on each rebuild for consistent state.
- βοΈ **Zero-friction setup :** Works out-of-the-box with minimal options.
- π¦ **Dependency handling :** Ensures ```chromium``` and ```firefox``` are installed via ```environment.systemPackages```.
- πΎ **Backups :** Backup instructions for existing Stylus configs are provided in the documentation.
## π Repository structure
```bash
β― tree -a -I ".git*"
.
βββ catppuccin-mocha-green.json # stylus catppuccin mocha green websites theme
βββ configuration.nix # module configuration
βββ LICENSE.md # MIT license
βββ README.md # this documentation
1 directory, 4 files
```
## βοΈ Prerequisites
### 1. NixOS version
Requires NixOS 24.11 or newer.
### 2. User validation
the target user must be defined in ```config.username```. See [typovrak main nixos configuration](https://github.com/typovrak/nixos) for more details.
### 3. Backup
Before proceeding, back up existing configuration if needed
```bash
cp ~/.config/stylus{,.bak}
```
## β¬οΈ Installation
### π Method 1 : Out-of-the-box
Fetch the module directly in your [main nixos configuration](https://github.com/typovrak/nixos) at ```/etc/nixos/configuration.nix``` using fetchGit
```nix
# /etc/nixos/configuration.nix
let
nixos-stylus = fetchGit {
url = "https://github.com/typovrak/nixos-stylus.git";
ref = "main";
rev = "76462ddf0919bdfd040a3c0b06ed081879d5176b"; # update to the desired commit
};
in
{
imports = [
/etc/nixos/hardware-configuration.nix # system hardware settings
/etc/nixos/variables.nix # defines config.username and other variables, see https://github.com/typovrak/nixos for more details
(import "${nixos-stylus}/configuration.nix")
];
}
```
Once imported, rebuild your system to apply changes
```bash
sudo nixos-rebuild switch
```
### π΄ Method 2 : Fork
Want to **personalize** this module ?
Fork it and add this custom module in your [main nixos configuration](https://github.com/typovrak/nixos) at ```/etc/nixos/configuration.nix``` using fetchGit
```nix
let
nixos-stylus = fetchGit {
url = "https://github.com//nixos-stylus.git";
ref = "main";
rev = ""; # see below
};
in {
imports = [
/etc/nixos/hardware-configuration.nix # system hardware settings
/etc/nixos/variables.nix # defines config.username and other variables, see https://github.com/typovrak/nixos for more details
(import "${nixos-stylus}/configuration.nix")
];
}
```
Get the latest commit hash by executing
```bash
git clone https://github.com//nixos-stylus.git &&
cd nixos-stylus &&
git log -1 --pretty=format:"%H"
```
## π¬ Usage
1. Open you favorite browser, ~~Firefox~~ Chromium.
2. Download the chrome extension [Stylus](https://chromewebstore.google.com/detail/stylus/clngdbkpkpeebahjckkjfobafhncgmne).
3. Open the extension and import the Catppuccin mocha green theme at ```~/.config/stylus```.
4. Apply all themes & Enjoy !
## π Learn more
- π¨ [Stylus Chrome extension](https://chromewebstore.google.com/detail/stylus/clngdbkpkpeebahjckkjfobafhncgmne) : The official extension page to install Stylus in Chromium-based browsers.
- π§ [Stylus documentation](https://github.com/openstyles/stylus/wiki) : Full details on import, export, theming and config files.
## π Discover my NixOS system portal
Dive into [typovrak.tv/nixos](https://typovrak.tv/nixos) Catppuccin mocha green themed **gateway** to my GitHub and NixOS setup.
Browse **every module**, example and config in a sleek with an interactive interface that feels just like your desktop.
## β€οΈ Support
If this module saved you time, please βοΈ the repo and share feedback.
You can also support me on β [Buy me a coffee](https://typovrak.tv/coffee)
## π¬ Join the Typovrak community on Discord π«π·
If you've ever ```rm -rf```ed your config by mistake or rebuilt for the 42nd time because a semicolon was missingβ¦
You're not alone, **Welcome home !**
π― [Join us on Discord Β»](https://typovrak.tv/discord)
π§ What youβll find is :
- ```π» #nixos-setup``` - get help with modules, rebuilds and configs.
- ```π #web-dev``` - talk JS, TypeScript, React, Node and more.
- ```π§ #open-source``` - share your repos, contribute to others and discuss FOSS culture.
- ```β¨οΈ #typing``` - layouts, mechanical keyboards and speed goals.
- ```π¨ #ricing``` - dotfiles, theming tips and desktop screenshots.
*Everyone's welcome no matter how many times you've broken your system ~~(except for Windows users)~~ π*
---
Made with π by typovrak