Skip to content

Commit

Permalink
refactor(treewide): remove unused/redundant arguments, format workspa…
Browse files Browse the repository at this point in the history
…ce module, remove whitespaces, remove `with lib;` (#390)

Signed-off-by: Fernando Rodrigues <[email protected]>
  • Loading branch information
SigmaSquadron authored Oct 19, 2024
1 parent 154ec91 commit d226a67
Show file tree
Hide file tree
Showing 31 changed files with 337 additions and 379 deletions.
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
pkgs ? import <nixpkgs> { },
}:
rec {
{
docs = import ./docs {
inherit pkgs;
lib = pkgs.lib;
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/introduction.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 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?tab=readme-ov-file#getting-started).
[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.

Expand Down
2 changes: 1 addition & 1 deletion docs/manual/preface.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module which has as a goal to be able to configure as much of KDE plasma as
possible, using nix.

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?tab=readme-ov-file#whats-supported).
[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.
2 changes: 1 addition & 1 deletion lib/types.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ let
default = true;
description = ''
Whether to escape the value according to kde's escape-format. See:
https://github.com/KDE/kconfig/blob/44f98ff5cb9008436ba5ba385cae03bbd0ab33e6/src/core/kconfigini.cpp#L882
https://invent.kde.org/frameworks/kconfig/-/blob/v6.7.0/src/core/kconfigini.cpp?ref_type=tags#L880-945
for info about this format.
'';
};
Expand Down
6 changes: 1 addition & 5 deletions lib/writeconfig.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
pkgs,
lib,
config,
}:
{ pkgs, config, ... }:

let
writeConfigScript = pkgs.writeShellApplication {
Expand Down
4 changes: 2 additions & 2 deletions modules/apps/ghostwriter.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ let

createThemes = lib.attrsets.mapAttrs' (
name: value:
lib.attrsets.nameValuePair ("ghostwriter/themes/${name}.json") ({
lib.attrsets.nameValuePair "ghostwriter/themes/${name}.json" {
enable = true;
source = value;
})
}
);

getIndexFromEnum =
Expand Down
19 changes: 7 additions & 12 deletions modules/apps/konsole.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
config,
lib,
pkgs,
...
}:
{ config, lib, ... }:
let
inherit
(import ../../lib/types.nix {
Expand All @@ -14,13 +9,13 @@ let
;

# used as shown in the example in the library docs:
# https://ryantm.github.io/nixpkgs/functions/library/attrsets/#function-library-lib.attrsets.mapAttrs-prime
# https://noogle.dev/f/lib/attrsets/mapAttrs'
createColorSchemes = lib.attrsets.mapAttrs' (
name: value:
lib.attrsets.nameValuePair ("konsole/${name}.colorscheme") ({
lib.attrsets.nameValuePair "konsole/${name}.colorscheme" {
enable = true;
source = value;
})
}
);

cfg = config.programs.konsole;
Expand Down Expand Up @@ -135,7 +130,7 @@ in
};

extraConfig = lib.mkOption {
type = with lib.types; nullOr (attrsOf (attrsOf (basicSettingsType)));
type = with lib.types; nullOr (attrsOf (attrsOf basicSettingsType));
default = null;
description = ''
Extra config to add to konsolerc.
Expand Down Expand Up @@ -165,7 +160,7 @@ in

xdg.dataFile = lib.mkMerge [
(lib.mkIf (cfg.profiles != { }) (
lib.mkMerge ([
lib.mkMerge [
(lib.mkMerge (
lib.mapAttrsToList (
attrName: profile:
Expand Down Expand Up @@ -200,7 +195,7 @@ in
}
) cfg.profiles
))
])
]
))
(createColorSchemes cfg.customColorSchemes)
];
Expand Down
2 changes: 1 addition & 1 deletion modules/files.nix
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ in
config.home.activation = lib.mkIf plasmaCfg.enable {
configure-plasma = (
lib.hm.dag.entryAfter [ "writeBoundary" ] ''
$DRY_RUN_CMD ${script}
$DRY_RUN_CMD ${script}
''
);
};
Expand Down
Loading

0 comments on commit d226a67

Please sign in to comment.