[feat] Alejandra formatting

This commit is contained in:
uttarayan21
2024-03-21 21:35:51 +05:30
parent e8434fadf5
commit d5dc5a79d3
33 changed files with 699 additions and 589 deletions

View File

@@ -1,14 +1,17 @@
{ pkgs, config, lib, ... }:
with lib;
let
{
pkgs,
config,
lib,
...
}:
with lib; let
cfg = config.programs.goread;
# configDir =
# if pkgs.stdenv.isDarwin then
# "${config.home.homeDirectory}Library/Application Support/goread"
# else
# "${config.xdg.configHome}/goread";
in
{
in {
options = {
programs.goread = {
enable = mkEnableOption "goread - a terminal RSS/Atom reader";
@@ -16,17 +19,17 @@ in
config = with types; {
urls = mkOption {
type = attrsOf (listOf attrs);
default = { };
default = {};
description = ''
Urls that will be fetched ~/.config/goread/urls.yml
'';
example = { };
example = {};
};
colorscheme = mkOption {
type = attrsOf str;
default = { };
example = { };
default = {};
example = {};
description = ''
Colorscheme that will be fetched ~/.config/goread/colorscheme.json
'';
@@ -36,12 +39,11 @@ in
};
config = {
home.packages = mkIf cfg.enable [ pkgs.goread ];
home.packages = mkIf cfg.enable [pkgs.goread];
xdg.configFile = mkIf cfg.enable {
"goread/urls.yml".text = generators.toYAML { } cfg.config.urls;
"goread/urls.yml".text = generators.toYAML {} cfg.config.urls;
# "goread/colorscheme.json".text = lib.generators.toJSON cfg.config.colorscheme;
};
};
}

View File

@@ -1,8 +1,11 @@
{ pkgs, config, lib, ... }:
with lib;
let cfg = config.programs.hyprpaper;
{
pkgs,
config,
lib,
...
}:
with lib; let
cfg = config.programs.hyprpaper;
in {
options = {
programs.hyprpaper = {
@@ -24,17 +27,17 @@ in {
settings = with types; {
preload = mkOption {
type = listOf path;
default = [ ];
default = [];
description = ''
Wallpaper images that should be preloaded into memory
Wallpaper images that should be preloaded into memory
'';
example = [ ./wallpapers/tensura.png ];
example = [./wallpapers/tensura.png];
};
wallpapers = mkOption {
type = attrsOf str;
default = { };
example = { "DP-1" = ./wallpapers/tensura.png; };
default = {};
example = {"DP-1" = ./wallpapers/tensura.png;};
description = ''
Wallpaper to monitor mapper
'';
@@ -43,8 +46,7 @@ in {
extraConfig = mkOption {
type = str;
default = "";
description =
"Check https://github.com/hyprwm/hyprpaper#usage for info";
description = "Check https://github.com/hyprwm/hyprpaper#usage for info";
example = ''
newConfigOption = foo,bar
'';
@@ -54,14 +56,14 @@ in {
};
config = {
home.packages = mkIf cfg.enable [ pkgs.hyprpaper ];
home.packages = mkIf cfg.enable [pkgs.hyprpaper];
systemd.user.services.hyprpaper = mkIf cfg.systemd.enable {
Unit = {
Description = "autostart service for Hyprpaper";
Documentation = "https://github.com/hyprwm/hyprpaper";
BindsTo = [ "graphical-session.target" ];
After = [ "graphical-session-pre.target" ];
BindsTo = ["graphical-session.target"];
After = ["graphical-session-pre.target"];
};
Service = {
@@ -71,7 +73,7 @@ in {
KillMode = "mixed";
};
Install = { WantedBy = [ cfg.systemd.target ]; };
Install = {WantedBy = [cfg.systemd.target];};
};
xdg.configFile = mkIf cfg.enable {
@@ -80,16 +82,19 @@ in {
# hyprpaper.settings.preload
${(lists.foldl (acc: v:
acc + ''
acc
+ ''
preload = ${v}
'') "" cfg.settings.preload)}
'') ""
cfg.settings.preload)}
# hyprpaper.settings.wallpapers
${(lists.foldl (acc: v:
acc + ''
acc
+ ''
wallpaper = ${v}
'') "" (pkgs.lib.attrsets.mapAttrsToList (name: val: name + "," + val)
cfg.settings.wallpapers))}
cfg.settings.wallpapers))}
# hyprpaper.settings.extraConfig
${cfg.settings.extraConfig}

View File

@@ -1,12 +1,13 @@
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.programs.tuifeed;
tomlFormat = pkgs.formats.toml { };
in
{
pkgs,
config,
lib,
...
}:
with lib; let
cfg = config.programs.tuifeed;
tomlFormat = pkgs.formats.toml {};
in {
options = {
programs.tuifeed = {
enable = mkEnableOption "tuifeed - a terminal RSS/Atom reader";
@@ -14,11 +15,11 @@ in
config = with types; {
sources = mkOption {
type = attrsOf str;
default = { };
default = {};
description = ''
Urls that will be fetched ~/.config/tuifeed/urls.yml
'';
example = { };
example = {};
};
article_title = mkOption {
@@ -30,15 +31,14 @@ in
description = ''
Urls that will be fetched ~/.config/tuifeed/urls.yml
'';
example = { };
example = {};
};
};
};
};
config = {
home.packages = mkIf cfg.enable [ pkgs.tuifeed ];
home.packages = mkIf cfg.enable [pkgs.tuifeed];
xdg.configFile = mkIf cfg.enable {
"tuifeed/config.toml".source = tomlFormat.generate "tuifeed-config" {
@@ -46,6 +46,5 @@ in
"article-title" = cfg.config.article_title;
};
};
};
}