switch nixfmt to alejandra to format nix code

This commit is contained in:
ulic-youthlic 2025-04-28 21:20:32 +08:00
parent 582bdb783c
commit e44894c666
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
120 changed files with 1163 additions and 1237 deletions

View file

@ -3,8 +3,7 @@
unixName,
config,
...
}:
{
}: {
youthlic = {
xdg-dirs.enable = true;
programs = {

View file

@ -1 +1 @@
{ ... }: { }
{...}: {}

View file

@ -4,8 +4,7 @@
config,
rootPath,
...
}:
{
}: {
youthlic = {
xdg-dirs.enable = true;
programs = {

View file

@ -5,8 +5,7 @@
inputs,
unixName,
...
}:
{
}: {
youthlic = {
xdg-dirs.enable = true;
programs = {

View file

@ -1,5 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
imports = [
./wallpaper.nix
./programs

View file

@ -1,5 +1,4 @@
{ ... }:
{
{...}: {
imports = [
./openssh.nix
./niri

View file

@ -1,8 +1,10 @@
{ config, lib, ... }:
let
cfg = config.david.programs.niri;
in
{
config,
lib,
...
}: let
cfg = config.david.programs.niri;
in {
options = {
david.programs.niri = {
enable = lib.mkEnableOption "niri";

View file

@ -3,11 +3,9 @@
config,
lib,
...
}:
let
}: let
cfg = config.david.programs.openssh;
in
{
in {
options = {
david.programs.openssh = {
enable = lib.mkEnableOption "openssh";
@ -35,10 +33,9 @@ in
};
};
};
})
(lib.mkIf (cfg.enable && config.youthlic.programs.sops.enable) {
programs.ssh.includes = [ config.sops.secrets.ssh-config.path ];
programs.ssh.includes = [config.sops.secrets.ssh-config.path];
sops.secrets = {
"ssh-private-key/tytonidae" = {
mode = "0600";

View file

@ -1,8 +1,10 @@
{ lib, config, ... }:
let
cfg = config.david.programs.wluma;
in
{
lib,
config,
...
}: let
cfg = config.david.programs.wluma;
in {
options = {
david.programs.wluma = {
enable = lib.mkEnableOption "wluma";

View file

@ -3,11 +3,9 @@
lib,
config,
...
}:
let
}: let
cfg = config.david.wallpaper;
in
{
in {
options = {
david.wallpaper = {
enable = lib.mkEnableOption "wallpaper";

View file

@ -1,5 +1,4 @@
{ inputs, ... }:
{
{inputs, ...}: {
imports =
(with inputs; [
niri-flake.homeModules.niri

View file

@ -4,13 +4,12 @@
pkgs,
inputs,
...
}:
{
}: {
config = {
nixpkgs = {
config = {
allowUnfree = true;
allowUnfreePredicate = (_: true);
allowUnfreePredicate = _: true;
};
overlays = [
outputs.overlays.modifications

View file

@ -1,8 +1,4 @@
{
inputs,
...
}:
{
{inputs, ...}: {
imports =
(with inputs; [
sops-nix.homeManagerModules.sops

View file

@ -1,8 +1,10 @@
{ lib, config, ... }:
let
cfg = config.youthlic.programs.atuin;
in
{
lib,
config,
...
}: let
cfg = config.youthlic.programs.atuin;
in {
options = {
youthlic.programs.atuin = {
enable = lib.mkEnableOption "atuin";

View file

@ -1,8 +1,10 @@
{ lib, config, ... }:
let
cfg = config.youthlic.programs.chromium;
in
{
lib,
config,
...
}: let
cfg = config.youthlic.programs.chromium;
in {
options = {
youthlic.programs.chromium = {
enable = lib.mkEnableOption "chromium";

View file

@ -1,5 +1,4 @@
{ ... }:
{
{...}: {
imports = [
./zed.nix
./rustypaste-cli.nix

View file

@ -3,11 +3,9 @@
lib,
pkgs,
...
}:
let
}: let
cfg = config.youthlic.programs.espanso;
in
{
in {
options = {
youthlic.programs.espanso = {
enable = lib.mkEnableOption "espanso";
@ -18,7 +16,7 @@ in
enable = true;
package = pkgs.espanso-wayland;
configs = {
default = { };
default = {};
};
matches = {
base = {

View file

@ -5,11 +5,9 @@
lib,
config,
...
}:
let
}: let
cfg = config.youthlic.programs.firefox;
in
{
in {
options = {
youthlic.programs.firefox = {
enable = lib.mkEnableOption "firefox";
@ -60,7 +58,7 @@ in
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ];
definedAliases = ["@np"];
};
"Nix Options" = {
urls = [
@ -78,7 +76,7 @@ in
];
}
];
definedAliases = [ "@no" ];
definedAliases = ["@no"];
};
"Home Manager Options" = {
urls = [
@ -96,7 +94,7 @@ in
];
}
];
definedAliases = [ "hm" ];
definedAliases = ["hm"];
};
"NUR Packages" = {
urls = [
@ -104,7 +102,7 @@ in
template = "https://nur.nix-community.org/";
}
];
definedAliases = [ "nu" ];
definedAliases = ["nu"];
};
"Nix Flakes" = {
urls = [
@ -122,7 +120,7 @@ in
];
}
];
definedAliases = [ "nf" ];
definedAliases = ["nf"];
};
"NixOS Wiki" = {
urls = [
@ -136,7 +134,7 @@ in
];
}
];
definedAliases = [ "nw" ];
definedAliases = ["nw"];
};
"bing".metaData.hidden = true;
"google".metaData.alias = "@g"; # builtin engines only support specifying one additional alias

View file

@ -1,8 +1,10 @@
{ config, lib, ... }:
let
cfg = config.youthlic.programs.foot;
in
{
config,
lib,
...
}: let
cfg = config.youthlic.programs.foot;
in {
options = {
youthlic.programs.foot = {
enable = lib.mkEnableOption "foot";

View file

@ -1,8 +1,10 @@
{ config, lib, ... }:
let
cfg = config.youthlic.programs.fuzzel;
in
{
config,
lib,
...
}: let
cfg = config.youthlic.programs.fuzzel;
in {
options = {
youthlic.programs.fuzzel = {
enable = lib.mkEnableOption "fuzzel";

View file

@ -3,61 +3,58 @@
config,
lib,
...
}:
{
}: {
options = {
youthlic.programs.ghostty = {
enable = lib.mkEnableOption "ghostty";
};
};
config =
let
cfg = config.youthlic.programs.ghostty;
in
(lib.mkIf cfg.enable {
programs.ghostty = lib.mkMerge [
{
enable = true;
package = pkgs.ghostty;
settings = {
# font-family = "FiraCode Nerd Font";
# font-feature = [
# "calt=1"
# "clig=1"
# "liga=1"
# "cv01"
# "cv02"
# "cv06"
# "zero"
# "onum"
# "cv17"
# "ss05"
# "ss03"
# "cv16"
# "cv31"
# "cv29"
# "cv30"
# ];
config = let
cfg = config.youthlic.programs.ghostty;
in (lib.mkIf cfg.enable {
programs.ghostty = lib.mkMerge [
{
enable = true;
package = pkgs.ghostty;
settings = {
# font-family = "FiraCode Nerd Font";
# font-feature = [
# "calt=1"
# "clig=1"
# "liga=1"
# "cv01"
# "cv02"
# "cv06"
# "zero"
# "onum"
# "cv17"
# "ss05"
# "ss03"
# "cv16"
# "cv31"
# "cv29"
# "cv30"
# ];
# font-family = "Maple Mono SC NF";
font-feature = [
"calt"
"zero"
"cv03"
"ss08"
];
font-size = lib.mkForce 17;
# theme = "ayu";
background-opacity = lib.mkForce 0.8;
confirm-close-surface = "false";
};
}
(lib.mkIf config.youthlic.programs.fish.enable {
enableFishIntegration = true;
})
(lib.mkIf config.youthlic.programs.bash.enable {
enableBashIntegration = true;
})
];
});
# font-family = "Maple Mono SC NF";
font-feature = [
"calt"
"zero"
"cv03"
"ss08"
];
font-size = lib.mkForce 17;
# theme = "ayu";
background-opacity = lib.mkForce 0.8;
confirm-close-surface = "false";
};
}
(lib.mkIf config.youthlic.programs.fish.enable {
enableFishIntegration = true;
})
(lib.mkIf config.youthlic.programs.bash.enable {
enableBashIntegration = true;
})
];
});
}

View file

@ -2,8 +2,7 @@
config,
lib,
...
}:
{
}: {
options = {
youthlic.programs.git = {
email = lib.mkOption {
@ -31,10 +30,9 @@
encrypt-credential = lib.mkEnableOption "encrypt git credential";
};
};
config =
let
cfg = config.youthlic.programs.git;
in
config = let
cfg = config.youthlic.programs.git;
in
lib.mkMerge [
{
programs.lazygit = {

View file

@ -4,17 +4,15 @@
lib,
outputs,
...
}:
{
}: {
options = {
youthlic.programs.gpg = {
enable = lib.mkEnableOption "gpg";
};
};
config =
let
cfg = config.youthlic.programs.gpg;
in
config = let
cfg = config.youthlic.programs.gpg;
in
lib.mkIf cfg.enable {
services.gpg-agent = lib.mkMerge [
{

View file

@ -4,17 +4,15 @@
config,
outputs,
...
}:
{
}: {
options = {
youthlic.programs.helix = {
enable = lib.mkEnableOption "helix";
extraPackages = lib.mkOption {
type = lib.types.listOf lib.types.package;
default = [ ];
default = [];
example = (
with pkgs;
[
with pkgs; [
deno
]
);
@ -24,236 +22,232 @@
};
};
};
config =
let
cfg = config.youthlic.programs.helix;
in
{
stylix.targets.helix.enable = false;
programs.helix = lib.mkIf cfg.enable {
enable = true;
package = outputs.packages."${pkgs.system}".helix;
defaultEditor = true;
extraPackages = cfg.extraPackages;
settings =
let
config-file = builtins.readFile ./config.toml;
config = builtins.fromTOML config-file;
in
config;
languages = {
language-server = {
neocmakelsp = {
command = "neocmakelsp";
args = [
"stdio"
];
};
fish-lsp = {
command = "fish-lsp";
args = [
"start"
];
};
config = let
cfg = config.youthlic.programs.helix;
in {
stylix.targets.helix.enable = false;
programs.helix = lib.mkIf cfg.enable {
enable = true;
package = outputs.packages."${pkgs.system}".helix;
defaultEditor = true;
extraPackages = cfg.extraPackages;
settings = let
config-file = builtins.readFile ./config.toml;
config = builtins.fromTOML config-file;
in
config;
languages = {
language-server = {
neocmakelsp = {
command = "neocmakelsp";
args = [
"stdio"
];
};
fish-lsp = {
command = "fish-lsp";
args = [
"start"
];
};
language = [
{
name = "cmake";
language-servers = [
"neocmakelsp"
"cmake-language-server"
];
}
{
name = "kdl";
formatter = {
command = "kdlfmt";
args = [
"format"
"-"
];
};
}
{
name = "just";
formatter = {
command = "just";
args = [
"--dump"
];
};
}
{
name = "nix";
formatter = {
command = "nixfmt";
args = [ "-" ];
};
}
{
name = "xml";
formatter = {
command = "xmllint";
args = [
"--format"
"-"
];
};
}
{
name = "typst";
formatter = {
command = "typstyle";
};
}
{
name = "c";
formatter = {
command = "clang-format";
};
}
{
name = "cpp";
formatter = {
command = "clang-format";
};
}
{
name = "python";
formatter = {
command = "ruff";
args = [
"format"
"-s"
"--line-length"
"88"
"-"
];
};
language-servers = [
"pyright"
"ruff"
];
}
{
name = "go";
formatter = {
command = "goimports";
};
}
{
name = "awk";
formatter = {
command = "awk";
timeout = 5;
args = [
"--file=/dev/stdin"
"--pretty-print=/dev/stdout"
];
};
}
{
name = "fish";
language-servers = [
"fish-lsp"
];
}
{
name = "yaml";
formatter = {
command = "deno";
args = [
"fmt"
"-"
"--ext"
"yaml"
];
};
}
{
name = "html";
formatter = {
command = "deno";
args = [
"fmt"
"-"
"--ext"
"html"
];
};
language-servers = [
"vscode-html-language-server"
];
}
{
name = "css";
formatter = {
command = "deno";
args = [
"fmt"
"-"
"--ext"
"css"
];
};
language-servers = [
"vscode-css-language-server"
];
}
{
name = "toml";
formatter = {
command = "taplo";
args = [
"fmt"
"-"
];
};
}
{
name = "markdown";
formatter = {
command = "deno";
args = [
"fmt"
"-"
"--ext"
"md"
];
};
}
{
name = "json";
language-servers = [
"vscode-json-language-server"
];
formatter = {
command = "deno";
args = [
"fmt"
"-"
"--ext"
"json"
];
};
}
{
name = "jsonc";
language-servers = [
"vscode-json-language-server"
];
formatter = {
command = "deno";
args = [
"fmt"
"-"
"--ext"
"jsonc"
];
};
}
];
};
language = [
{
name = "cmake";
language-servers = [
"neocmakelsp"
"cmake-language-server"
];
}
{
name = "kdl";
formatter = {
command = "kdlfmt";
args = [
"format"
"-"
];
};
}
{
name = "just";
formatter = {
command = "just";
args = [
"--dump"
];
};
}
{
name = "nix";
formatter = {
command = "alejandra";
};
}
{
name = "xml";
formatter = {
command = "xmllint";
args = [
"--format"
"-"
];
};
}
{
name = "typst";
formatter = {
command = "typstyle";
};
}
{
name = "c";
formatter = {
command = "clang-format";
};
}
{
name = "cpp";
formatter = {
command = "clang-format";
};
}
{
name = "python";
formatter = {
command = "ruff";
args = [
"format"
"-s"
"--line-length"
"88"
"-"
];
};
language-servers = [
"pyright"
"ruff"
];
}
{
name = "go";
formatter = {
command = "goimports";
};
}
{
name = "awk";
formatter = {
command = "awk";
timeout = 5;
args = [
"--file=/dev/stdin"
"--pretty-print=/dev/stdout"
];
};
}
{
name = "fish";
language-servers = [
"fish-lsp"
];
}
{
name = "yaml";
formatter = {
command = "deno";
args = [
"fmt"
"-"
"--ext"
"yaml"
];
};
}
{
name = "html";
formatter = {
command = "deno";
args = [
"fmt"
"-"
"--ext"
"html"
];
};
language-servers = [
"vscode-html-language-server"
];
}
{
name = "css";
formatter = {
command = "deno";
args = [
"fmt"
"-"
"--ext"
"css"
];
};
language-servers = [
"vscode-css-language-server"
];
}
{
name = "toml";
formatter = {
command = "taplo";
args = [
"fmt"
"-"
];
};
}
{
name = "markdown";
formatter = {
command = "deno";
args = [
"fmt"
"-"
"--ext"
"md"
];
};
}
{
name = "json";
language-servers = [
"vscode-json-language-server"
];
formatter = {
command = "deno";
args = [
"fmt"
"-"
"--ext"
"json"
];
};
}
{
name = "jsonc";
language-servers = [
"vscode-json-language-server"
];
formatter = {
command = "deno";
args = [
"fmt"
"-"
"--ext"
"jsonc"
];
};
}
];
};
};
};
}

View file

@ -3,11 +3,9 @@
config,
lib,
...
}:
let
}: let
cfg = config.youthlic.programs.jujutsu;
in
{
in {
options = {
youthlic.programs.jujutsu = {
enable = lib.mkEnableOption "jujutsu";

View file

@ -1,8 +1,10 @@
{ config, lib, ... }:
let
cfg = config.youthlic.programs.kvm;
in
{
config,
lib,
...
}: let
cfg = config.youthlic.programs.kvm;
in {
options = {
youthlic.programs.kvm = {
enable = lib.mkEnableOption "kvm";
@ -12,8 +14,8 @@ in
dconf = {
settings = {
"org/virt-manager/virt-manager/connections" = {
autoconnect = [ "qemu:///system" ];
uris = [ "qemu:///system" ];
autoconnect = ["qemu:///system"];
uris = ["qemu:///system"];
};
};
};

View file

@ -1,8 +1,10 @@
{ lib, config, ... }:
let
cfg = config.youthlic.programs.mpv;
in
{
lib,
config,
...
}: let
cfg = config.youthlic.programs.mpv;
in {
options = {
youthlic.programs.mpv = {
enable = lib.mkEnableOption "mpv";

View file

@ -4,12 +4,10 @@
lib,
osConfig ? null,
...
}:
let
}: let
cfg = config.youthlic.programs.niri;
niri = osConfig.programs.niri.package;
in
{
in {
options = {
youthlic.programs.niri = {
enable = lib.mkEnableOption "niri";
@ -32,36 +30,34 @@ in
wl-clipboard
cliphist
])
++ [ niri ];
++ [niri];
qt = {
enable = true;
};
xdg.portal = {
configPackages = [ niri ];
configPackages = [niri];
enable = true;
extraPortals = lib.mkIf (
!niri.cargoBuildNoDefaultFeatures || builtins.elem "xdp-gnome-screencast" niri.cargoBuildFeatures
) [ pkgs.xdg-desktop-portal-gnome ];
) [pkgs.xdg-desktop-portal-gnome];
};
xdg.configFile =
let
qtctConf =
''
[Appearance]
standard_dialogs=xdgdesktopportal
''
+ lib.optionalString (config.qt.style ? name) ''
style=${config.qt.style.name}
'';
in
{
"qt5ct/qt5ct.conf" = lib.mkForce {
text = qtctConf;
};
"qt6ct/qt6ct.conf" = lib.mkForce {
text = qtctConf;
};
xdg.configFile = let
qtctConf =
''
[Appearance]
standard_dialogs=xdgdesktopportal
''
+ lib.optionalString (config.qt.style ? name) ''
style=${config.qt.style.name}
'';
in {
"qt5ct/qt5ct.conf" = lib.mkForce {
text = qtctConf;
};
"qt6ct/qt6ct.conf" = lib.mkForce {
text = qtctConf;
};
};
youthlic.programs = {
fuzzel.enable = true;
wluma.enable = true;

View file

@ -3,11 +3,9 @@
config,
lib,
...
}:
let
}: let
cfg = config.youthlic.programs.obs;
in
{
in {
options = {
youthlic.programs.obs = {
enable = lib.mkEnableOption "obs";

View file

@ -3,22 +3,20 @@
lib,
pkgs,
...
}:
let
}: let
cfg = config.youthlic.programs.rustypaste-cli;
in
{
in {
options = {
youthlic.programs.rustypaste-cli = {
enable = lib.mkEnableOption "rustypaste-cli";
};
};
config = lib.mkIf cfg.enable {
home.packages = [ pkgs.rustypaste-cli ];
home.packages = [pkgs.rustypaste-cli];
sops = {
secrets = {
"rustypaste/auth" = { };
"rustypaste/delete" = { };
"rustypaste/auth" = {};
"rustypaste/delete" = {};
};
templates."rustypaste-config.toml" = {
path = "${config.xdg.configHome}/rustypaste/config.toml";

View file

@ -2,13 +2,11 @@
config,
lib,
...
}:
let
}: let
inherit (lib) mkEnableOption mkIf mkMerge;
fish-cfg = config.youthlic.programs.fish;
bash-cfg = config.youthlic.programs.bash;
cfg-helper =
conf:
cfg-helper = conf:
mkMerge [
conf
(mkIf fish-cfg.enable {
@ -18,8 +16,7 @@ let
enableBashIntegration = true;
})
];
in
{
in {
options = {
youthlic.programs = {
fish = {

View file

@ -4,8 +4,7 @@
pkgs,
rootPath,
...
}:
{
}: {
options = {
youthlic.programs.sops = {
enable = lib.mkOption {
@ -25,14 +24,12 @@
};
};
};
config =
let
cfg = config.youthlic.programs.sops;
in
config = let
cfg = config.youthlic.programs.sops;
in
lib.mkIf cfg.enable {
home.packages = (
with pkgs;
[
with pkgs; [
sops
age
]

View file

@ -1,8 +1,10 @@
{ lib, config, ... }:
let
cfg = config.youthlic.programs.starship;
in
{
lib,
config,
...
}: let
cfg = config.youthlic.programs.starship;
in {
options = {
youthlic.programs.starship = {
enable = lib.mkEnableOption "starship";
@ -12,10 +14,9 @@ in
programs.starship = lib.mkMerge [
{
enable = true;
settings =
let
config-file = builtins.readFile ./config.toml;
in
settings = let
config-file = builtins.readFile ./config.toml;
in
builtins.fromTOML config-file;
}
(lib.mkIf config.youthlic.programs.fish.enable {

View file

@ -3,11 +3,9 @@
config,
lib,
...
}:
let
}: let
cfg = config.youthlic.programs.swaylock;
in
{
in {
options = {
youthlic.programs.swaylock = {
enable = lib.mkEnableOption "swaylock";

View file

@ -1,8 +1,10 @@
{ lib, config, ... }:
let
cfg = config.youthlic.programs.swaync;
in
{
lib,
config,
...
}: let
cfg = config.youthlic.programs.swaync;
in {
options = {
youthlic.programs.swaync = {
enable = lib.mkEnableOption "swaync";
@ -16,7 +18,7 @@ in
};
})
(lib.mkIf (!cfg.systemd.enable) {
systemd.user.services.swaync = lib.mkForce { };
systemd.user.services.swaync = lib.mkForce {};
})
];
}

View file

@ -1,8 +1,10 @@
{ config, lib, ... }:
let
cfg = config.youthlic.programs.thunderbird;
in
{
config,
lib,
...
}: let
cfg = config.youthlic.programs.thunderbird;
in {
options = {
youthlic.programs.thunderbird = {
enable = lib.mkEnableOption "thunderbird";

View file

@ -3,11 +3,9 @@
config,
lib,
...
}:
let
}: let
cfg = config.youthlic.programs.waybar;
in
{
in {
options = {
youthlic.programs.waybar = {
enable = lib.mkEnableOption "waybar";
@ -26,7 +24,7 @@ in
"niri/workspaces"
"wlr/taskbar"
];
modules-center = [ "clock" ];
modules-center = ["clock"];
modules-right = [
"tray"
"idle_inhibitor"
@ -40,7 +38,7 @@ in
on-click = "activate";
};
"niri/worksapces" = { };
"niri/worksapces" = {};
"niri/taskbar" = {
icon-size = 15;
on-click = "activate";

View file

@ -3,11 +3,9 @@
pkgs,
lib,
...
}:
let
}: let
cfg = config.youthlic.programs.wluma;
in
{
in {
options = {
youthlic.programs.wluma = {
enable = lib.mkEnableOption "wluma";
@ -39,18 +37,18 @@ in
systemd.user.services.wluma = {
Unit = {
Description = "Adjusting screen brightness based on screen contents and amount of ambient light";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
PartOf = ["graphical-session.target"];
After = ["graphical-session.target"];
};
Service = {
ExecStart = [ "${lib.getExe cfg.package}" ];
ExecStart = ["${lib.getExe cfg.package}"];
Restart = "always";
EnvironmentFile = [ "-%E/wluma/service.conf" ];
EnvironmentFile = ["-%E/wluma/service.conf"];
PrivateNetwork = true;
PrivateMounts = false;
};
Install = {
WantedBy = [ "graphical-session.target" ];
WantedBy = ["graphical-session.target"];
};
};
};

View file

@ -3,11 +3,9 @@
config,
lib,
...
}:
let
}: let
cfg = config.youthlic.programs.zed-editor;
in
{
in {
options = {
youthlic.programs.zed-editor = {
enable = lib.mkEnableOption "zed-editor";

View file

@ -1,8 +1,10 @@
{ lib, config, ... }:
let
cfg = config.youthlic.xdg-dirs;
in
{
lib,
config,
...
}: let
cfg = config.youthlic.xdg-dirs;
in {
options = {
youthlic.xdg-dirs = {
enable = lib.mkEnableOption "xdg-dirs";