Skip to content

Commit

Permalink
style(treewide): lint and format with statix, deadnix, prettier, tapl…
Browse files Browse the repository at this point in the history
…o, shfmt, shellcheck and rufo

Signed-off-by: Fernando Rodrigues <[email protected]>
  • Loading branch information
SigmaSquadron committed Oct 19, 2024
1 parent a080694 commit 374a268
Show file tree
Hide file tree
Showing 48 changed files with 1,334 additions and 1,421 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: "Nix Checks"
on:
pull_request:
paths:
- '**/*.nix'
- 'flake.lock'
- 'script/**'
- "**/*.nix"
- "flake.lock"
- "script/**"

# cancel previous runs when pushing new changes
concurrency:
Expand All @@ -15,10 +15,10 @@ jobs:
checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
with:
extra_nix_config: "system-features = kvm nixos-test"
- run: nix flake check -L --keep-going
- run: nix flake check -L --keep-going --override-input plasma-manager . ./examples/homeManagerFlake
- run: nix flake check -L --keep-going --override-input plasma-manager . ./examples/systemFlake
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
with:
extra_nix_config: "system-features = kvm nixos-test"
- run: nix flake check -L --keep-going
- run: nix flake check -L --keep-going --override-input plasma-manager . ./examples/homeManagerFlake
- run: nix flake check -L --keep-going --override-input plasma-manager . ./examples/systemFlake
44 changes: 22 additions & 22 deletions .github/workflows/github_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@ name: GitHub Pages Docs Generation
on:
push:
branches:
- trunk
- trunk
paths:
- 'flake.nix'
- 'flake.lock'
- 'modules/**'
- 'docs/**'
- "flake.nix"
- "flake.lock"
- "modules/**"
- "docs/**"

jobs:
publish:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15
with:
name: nix-community
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: |
nix-build -A docs.html
cp -r result/share/doc/plasma-manager public
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15
with:
name: nix-community
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- run: |
nix-build -A docs.html
cp -r result/share/doc/plasma-manager public
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This project aims to provide [Home Manager][home-manager] modules which allow yo
to configure KDE Plasma using Nix.

## Table of contents

- [Manage KDE Plasma with Home Manager](#manage-kde-plasma-with-home-manager)
- [Table of contents](#table-of-contents)
- [Supported versions](#supported-versions)
Expand All @@ -17,6 +18,7 @@ to configure KDE Plasma using Nix.
- [Special Thanks](#special-thanks)

## Supported versions

`plasma-manager` supports both plasma 5 and plasma 6. The `trunk` branch is the
most up-to-date branch and is mainly focused on plasma 6, but may still work on
plasma 5. If you are running plasma 5, it's recommended to use the `plasma-5`
Expand All @@ -30,7 +32,9 @@ broken when used with plasma 5. If you want the best experience with
`plasma-manager` it's recommended running plasma 6.

## What's supported

At the moment `plasma-manager` supports configuring the following:

- KDE configuration files (via the `files` module)
- Global themes, colorschemes, icons, cursortheme, wallpaper (via the `workspace` module)
- Desktop icons, widgets, and mouse actions (via the `desktop` module)
Expand All @@ -54,8 +58,10 @@ Additionally there are more functionality than just listed above, and more
functionality to come in the future!

## What's not well supported (at the moment)

There also are some things which at the moment isn't very well supported, in
particular:

- Real-time updates of configuration without having to log out and back in
- Usage of high-level modules in the configuration generated by `rc2nix`
- Keybindings to some key combinations (`Ctrl+Alt+T` and `Print` for example, see https://github.com/nix-community/plasma-manager/issues/109 and https://github.com/nix-community/plasma-manager/issues/136)
Expand All @@ -64,13 +70,17 @@ There may also be more things we aren't aware of. If you find some other
limitations don't hesitate to open an issue or submit a pr.

## What will not be supported

There are some things which are out of bounds for this project due to technical
reasons. For example

- SDDM configuration (requires root-privileges and thus not suited for a `home-manager` module)

## Getting started

We provide some examples to help you get started. These are located in the
[examples](./examples/) directory. Here you in particular can find:

- [An example home-manager configuration](./examples/homeManager/home.nix) [with instructions](./examples/homeManager/README.md)
- [An example flake.nix for usage with home-manager only](./examples/homeManagerFlake//flake.nix)
- [An example flake.nix for usage with the system configuration](./examples/systemFlake/flake.nix)
Expand All @@ -84,6 +94,7 @@ Additionally,
may come in handy.

## Make your configuration more declarative with overrideConfig

By default `plasma-manager` will simply write the specified configurations to
various config-files and leave all other options alone. This way settings not
specified in `plasma-manager` will be left alone, meaning that configurations
Expand All @@ -105,8 +116,8 @@ To make it easier to migrate to `plasma-manager`, and to help maintain your Nix
configuration when not using `overrideConfig`, this project includes a tool
called `rc2nix`.

This tool will read KDE configuration files and translate them to Nix. The
translated configuration is written to standard output. This makes it easy to:
This tool will read KDE configuration files and translate them to Nix. The
translated configuration is written to standard output. This makes it easy to:

- Generate an initial Plasma Manager configuration file.
- See what settings are changed by a GUI tool by capturing a file
Expand Down
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
{
docs = import ./docs {
inherit pkgs;
lib = pkgs.lib;
inherit (pkgs) lib;
};
}
29 changes: 13 additions & 16 deletions docs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,19 @@ let
opt:
opt
// {
declarations = (
map (
decl:
if (lib.hasPrefix pmPath (toString decl)) then
(githubDeclaration "nix-community" "plasma-manager" "trunk" (
lib.removePrefix "/" (lib.removePrefix pmPath (toString decl))
))
else
decl
) opt.declarations
);
declarations = map (
decl:
if (lib.hasPrefix pmPath (toString decl)) then
(githubDeclaration "nix-community" "plasma-manager" "trunk" (
lib.removePrefix "/" (lib.removePrefix pmPath (toString decl))
))
else
decl
) opt.declarations;
};

buildOptionsDocs = (
args@{ modules, ... }:
buildOptionsDocs =
{ modules, ... }:
let
opts =
(lib.evalModules {
Expand All @@ -45,12 +43,11 @@ let
inherit options;
inherit transformOptions;
warningsAreErrors = false;
}
);
};

pmOptionsDoc = buildOptionsDocs { inherit modules; };
plasma-manager-options = pkgs.callPackage ./plasma-manager-options.nix {
nixos-render-docs = pkgs.nixos-render-docs;
inherit (pkgs) nixos-render-docs;
plasma-manager-options = pmOptionsDoc.optionsJSON;
revision = "latest";
};
Expand Down
3 changes: 2 additions & 1 deletion docs/manual/introduction.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Introduction {#intro}

To get started it may be helpful to check out the
[getting started section in the README](https://github.com/nix-community/plasma-manager#getting-started).
This gives a couple examples on how you can get started using plasma-manager,
either using a flake or traditional nix-channels.

More details may be available here in the future!
More details may be available here in the future!
2 changes: 1 addition & 1 deletion docs/manual/manpage-urls.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{}
{}
2 changes: 1 addition & 1 deletion docs/manual/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ introduction.md

```{=include=} appendix html:into-file=//options.xhtml
options.md
```
```
2 changes: 1 addition & 1 deletion docs/manual/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
id-prefix: opt-
list-id: plasma-manager-options
source: @OPTIONS_JSON@
```
```
3 changes: 2 additions & 1 deletion docs/manual/preface.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Preface {#preface}

Plasma-Manager is a [Home Manager](https://github.com/nix-community/home-manager)
module which has as a goal to be able to configure as much of KDE plasma as
possible, using nix.
Expand All @@ -7,4 +8,4 @@ The project has progressed a lot lately, to the extent where
[most of the configuration options present in KDE Plasma 6 are configurable through plasma-manager](https://github.com/nix-community/plasma-manager#whats-supported).

The main focus of the project has been on KDE plasma 6 for a little while now,
but it's also possible to use it to some extent on plasma 5 as well.
but it's also possible to use it to some extent on plasma 5 as well.
Loading

0 comments on commit 374a268

Please sign in to comment.