Skip to content

Commit

Permalink
treewide: test PR #519 (v6)
Browse files Browse the repository at this point in the history
  • Loading branch information
trueNAHO committed Dec 30, 2024
1 parent f9daee0 commit 5ab7de5
Show file tree
Hide file tree
Showing 173 changed files with 10,807 additions and 186 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
version: 2

updates:
- package-ecosystem: github-actions

commit-message:
prefix: ci

directory: /

schedule:
interval: daily
44 changes: 44 additions & 0 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
# Derived from
# https://github.com/NixOS/nixpkgs/blob/2ab6f6d61630889491f86396b27a76ffb6fbc7bb/.github/workflows/backport.yml
name: Backport

on: # yamllint disable-line rule:truthy
pull_request_target:
types: [closed, labeled]

permissions: {}

jobs:
backport:
runs-on: ubuntu-latest

if: >
(
github.repository_owner == 'danth' &&
github.event.pull_request.merged == true &&
(
github.event_name != 'labeled' ||
startsWith('backport', github.event.label.name)
)
)
steps:
# Use a GitHub App rather than the default token so that GitHub Actions
# workflows may run on the created pull request.
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.BACKPORT_APP_ID }}
private-key: ${{ secrets.BACKPORT_PRIVATE_KEY }}

- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
token: ${{ steps.app-token.outputs.token }}

- uses: korthout/backport-action@v3
with:
github_token: ${{ steps.app-token.outputs.token }}
pull_title: "[${target_branch}] ${pull_title}"
pull_description: "This is an automated backport of #${pull_number}."
36 changes: 36 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Docs

on: # yamllint disable-line rule:truthy
push:
branches:
- master

concurrency:
cancel-in-progress: true
group: pages

jobs:
docs:
runs-on: ubuntu-24.04

permissions:
contents: read
id-token: write
pages: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v16
- uses: DeterminateSystems/magic-nix-cache-action@v8
- run: nix build .#docs

- uses: actions/upload-pages-artifact@v3
with:
path: result

- uses: actions/deploy-pages@v4
15 changes: 15 additions & 0 deletions .github/workflows/nix_flake_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Nix Flake Check

on: # yamllint disable-line rule:truthy
push:

jobs:
nix-flake-check:
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v16
- uses: DeterminateSystems/magic-nix-cache-action@v8
- run: nix flake check --no-update-lock-file
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.direnv/
/.pre-commit-config.yaml
result
result-*
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020-2024 Daniel Thwaites and the Stylix contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
68 changes: 68 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Stylix

Stylix is a NixOS module which applies the same colour scheme, font and
wallpaper to a range of applications and desktop environments.

## What's this?

[base16.nix](https://github.com/SenchoPens/base16.nix#readme) allows you to
import colours from [base16](https://github.com/chriskempson/base16#readme)
into Nix code. Stylix takes this a step further:

- Automatically colours and changes the font of apps
- Sets your wallpaper
- Exports the colour scheme to be used manually for anything we missed
- Can also generate themes based on an image

For those not familiar with [NixOS](https://nixos.org/) and
[Home Manager](https://github.com/nix-community/home-manager#readme):

- NixOS is a Linux distribution
- Home Manager is a program which runs anywhere
- Both use the Nix language and package manager
- Both let you install programs and change settings via code

Stylix supports either NixOS + Home Manager, or Home Manager on its own.
Certain features are only available with NixOS.

## Resources

Please refer to the [Stylix book](https://danth.github.io/stylix/)
for instructions and a list of supported apps.

For a visual guide, watch the [*Ricing Linux Has Never Been Easier | NixOS +
Stylix*](https://youtu.be/ljHkWgBaQWU) YouTube video by
[Vimjoyer](https://www.youtube.com/@vimjoyer).

> [!NOTE]
>
> It's now necessary to include `stylix.enable = true` in your configuration
> for any other settings to take effect. This is not mentioned in the video
> linked above.
If you have any questions, you are welcome to
join our [Matrix room](https://matrix.to/#/#stylix:danth.me),
or ask on [GitHub Discussions](https://github.com/danth/stylix/discussions).

## Example configurations

### GNOME 46

![GNOME 46](./gnome.png)

Photos by [Clay Banks](https://unsplash.com/photos/three-bicycles-parked-in-front-of-building-hwLAI5lRhdM)
and [Derrick Cooper](https://unsplash.com/photos/brown-road-in-forest-during-daytime-L505cPnmIds).

Try a live demo of this theme by running
`nix run github:danth/stylix#testbed-gnome-light` or
`nix run github:danth/stylix#testbed-gnome-dark`.

### KDE Plasma 5

![KDE Plasma 5](./kde.png)

Photos by [Aniket Deole](https://unsplash.com/photos/mountain-surrounded-by-trees-under-cloudy-sky-T-tOgjWZ0fQ)
and [Tom Gainor](https://unsplash.com/photos/landscape-photography-of-body-of-water-overlooking-mountain-range-ZqLeQDjY6fY).

KDE theming is still a work in progress - so some manual steps may be needed
to apply the settings completely.
14 changes: 9 additions & 5 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
imports = [
./stylix/default.nix
];
}
(import (
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
) { src = ./.; }).defaultNix
9 changes: 9 additions & 0 deletions docs/book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[book]
title = "Stylix"
language = "en"

[output.html]
site-url = "/stylix/"
git-repository-url = "https://github.com/danth/stylix"
edit-url-template = "https://github.com/danth/stylix/edit/master/docs/{path}"

78 changes: 78 additions & 0 deletions docs/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
pkgs,
lib,
inputs,
...
}:

let
makeOptionsDoc =
configuration:
pkgs.nixosOptionsDoc {
inherit (configuration) options;

# Filter out any options not beginning with `stylix`
transformOptions =
option:
option
// {
visible = option.visible && builtins.elemAt option.loc 0 == "stylix";
};
};

nixos = makeOptionsDoc (
lib.nixosSystem {
inherit (pkgs) system;
modules = [
inputs.home-manager.nixosModules.home-manager
inputs.self.nixosModules.stylix
./settings.nix
];
}
);

homeManager = makeOptionsDoc (
inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
inputs.self.homeManagerModules.stylix
./settings.nix
{
home = {
homeDirectory = "/home/book";
stateVersion = "22.11";
username = "book";
};
}
];
}
);

in
pkgs.stdenvNoCC.mkDerivation {
name = "stylix-book";
src = ./.;

patchPhase = ''
cp ${../README.md} src/README.md
cp ${../gnome.png} src/gnome.png
cp ${../kde.png} src/kde.png
# mdBook doesn't support this Markdown extension yet
substituteInPlace **/*.md \
--replace-quiet '> [!NOTE]' '> **Note**' \
--replace-quiet '> [!TIP]' '> **Tip**' \
--replace-quiet '> [!IMPORTANT]' '> **Important**' \
--replace-quiet '> [!WARNING]' '> **Warning**' \
--replace-quiet '> [!CAUTION]' '> **Caution**'
# The "declared by" links point to a file which only exists when the docs
# are built locally. This removes the links.
sed '/*Declared by:*/,/^$/d' <${nixos.optionsCommonMark} >>src/options/nixos.md
sed '/*Declared by:*/,/^$/d' <${homeManager.optionsCommonMark} >>src/options/hm.md
'';

buildPhase = ''
${pkgs.mdbook}/bin/mdbook build --dest-dir $out
'';
}
26 changes: 26 additions & 0 deletions docs/settings.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Dummy values to avoid errors when generating the documentation.

{
stylix = {
image = "/a/b/c";

base16Scheme = {
base00 = "ffffff";
base01 = "ffffff";
base02 = "ffffff";
base03 = "ffffff";
base04 = "ffffff";
base05 = "ffffff";
base06 = "ffffff";
base07 = "ffffff";
base08 = "ffffff";
base09 = "ffffff";
base0A = "ffffff";
base0B = "ffffff";
base0C = "ffffff";
base0D = "ffffff";
base0E = "ffffff";
base0F = "ffffff";
};
};
}
20 changes: 20 additions & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[Introduction](README.md)

# User guide

- [Installation](installation.md)
- [Configuration](configuration.md)
- [Tips and tricks](tricks.md)

# Reference

- [NixOS options](options/nixos.md)
- [Home Manager options](options/hm.md)

# Contributing

- [Commit Convention](commit_convention.md)
- [Development Environment](development_environment.md)
- [Adding modules](modules.md)
- [Testbeds](testbeds.md)
- [Style guide](styling.md)
30 changes: 30 additions & 0 deletions docs/src/commit_convention.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Commit Convention

To keep things consistent, commit messages should follow a format
[similar to Nixpkgs](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#commit-conventions):

```
«scope»: «summary»
«motivation for change»
```

Where the scope is one of:

| Scope | Purpose |
|----------------|------------------------------------------------------------------------|
| `ci` | Changes to GitHub Actions workflows. |
| `doc` | Changes to the website, `README.md`, and so on. |
| `stylix` | Changes in the `stylix` directory, `flake.nix`, and other global code. |
| Name of target | Changes to code for a particular target. |
| `treewide` | Changes across many targets. |

The scope is meant to indicate which area of the code was changed. Specifying
the type of change, such as `feat` or `fix`, is not necessary. Dependency
updates should use whichever scope they are related to.

The summary should start with a lowercase letter, and should not end with
punctuation.

Most commits to `master` will also include a pull request number in brackets
after the summary. GitHub adds this automatically when creating a squash merge.
Loading

0 comments on commit 5ab7de5

Please sign in to comment.