treewide: format using nixfmt

Signed-off-by: Bloxx12 <charlie@charlieroot.dev>
Change-Id: I6a6a69641c36f9763e104087a559c148d0449f00
This commit is contained in:
Bloxx12 2025-07-20 01:23:48 +02:00
commit e641dfa114
Signed by: faukah
SSH key fingerprint: SHA256:jpYIt4Vkz1NBTQcks/N9OPTfTFxE6KF2W/rV7hrfrIw
113 changed files with 1545 additions and 1019 deletions

View file

@ -2,12 +2,19 @@
inputs,
pkgs,
sources,
}: let
}:
let
inherit (pkgs) lib;
helix = pkgs.callPackage ./helix {};
kakoune = pkgs.callPackage ./kakoune.nix {};
fish = pkgs.callPackage ./fish {inherit lib;};
nushell = pkgs.callPackage ./nushell {};
in {
inherit kakoune fish helix nushell;
helix = pkgs.callPackage ./helix { };
kakoune = pkgs.callPackage ./kakoune.nix { };
fish = pkgs.callPackage ./fish { inherit lib; };
nushell = pkgs.callPackage ./nushell { };
in
{
inherit
kakoune
fish
helix
nushell
;
}

View file

@ -1,6 +1,8 @@
{pkgs, ...}: let
{ pkgs, ... }:
let
inherit (pkgs.lib) getExe;
in {
in
{
ls = "${getExe pkgs.eza} --icons=never";
la = "${getExe pkgs.eza} --icons=never -lha --git";

View file

@ -1,14 +1,15 @@
# This shell setup was originally inspired by sioodmy.
# Some further cool tricks, like using vendor_conf.d to avoid having
# to build fish myself, are taken from viperml's setup.
{pkgs, ...}: let
{ pkgs, ... }:
let
inherit (pkgs) lib;
inherit (lib.strings) concatStringsSep;
inherit (lib.attrsets) mapAttrsToList;
toml = pkgs.formats.toml {};
toml = pkgs.formats.toml { };
starship-config = import ./starship.nix;
aliases = import ./aliases.nix {inherit pkgs;};
aliases = import ./aliases.nix { inherit pkgs; };
vendorConf = "share/fish/vendor_conf.d";
fishinit = import ./fishinit.nix {
@ -19,27 +20,25 @@
;
};
aliasesStr =
mapAttrsToList (k: v: "alias ${k}=\"${v}\"") aliases
|> concatStringsSep "\n";
aliasesStr = mapAttrsToList (k: v: "alias ${k}=\"${v}\"") aliases |> concatStringsSep "\n";
packages = import ./packages.nix pkgs;
in
(pkgs.symlinkJoin {
name = "fish";
paths = [pkgs.fish] ++ packages;
nativeBuildInputs = [pkgs.makeWrapper];
postBuild = ''
wrapProgram $out/bin/fish \
--set STARSHIP_CONFIG "${toml.generate "starship.toml" starship-config}" \
--prefix XDG_DATA_DIRS : "${
lib.makeSearchPathOutput "out" "share" [
fishinit
]
}"
'';
})
.overrideAttrs (_: {
(pkgs.symlinkJoin {
name = "fish";
paths = [ pkgs.fish ] ++ packages;
nativeBuildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/fish \
--set STARSHIP_CONFIG "${toml.generate "starship.toml" starship-config}" \
--prefix XDG_DATA_DIRS : "${
lib.makeSearchPathOutput "out" "share" [
fishinit
]
}"
'';
}).overrideAttrs
(_: {
passthru = {
shellPath = "/bin/fish";
};

View file

@ -4,31 +4,31 @@
vendorConf,
}:
pkgs.writeTextDir "${vendorConf}/blox_config.fish"
# fish
''
# source ${pkgs.fishPlugins.sponge}/share/zsh-defer/zsh-defer.plugin.zsh
${pkgs.atuin}/bin/atuin init fish | source
bind up _atuin_bind_up
# fish
''
# source ${pkgs.fishPlugins.sponge}/share/zsh-defer/zsh-defer.plugin.zsh
${pkgs.atuin}/bin/atuin init fish | source
bind up _atuin_bind_up
${pkgs.zoxide}/bin/zoxide init fish | source
# abbr --erase cd &>/dev/null
# alias cd=__zoxide_z
${pkgs.zoxide}/bin/zoxide init fish | source
# abbr --erase cd &>/dev/null
# alias cd=__zoxide_z
# abbr --erase ci &>/dev/null
# alias ci=__zoxide_zi
# abbr --erase ci &>/dev/null
# alias ci=__zoxide_zi
${pkgs.starship}/bin/starship init fish | source
${pkgs.direnv}/bin/direnv hook fish | source
${pkgs.pay-respects}/bin/pay-respects fish --alias f --nocnf | source
${pkgs.starship}/bin/starship init fish | source
${pkgs.direnv}/bin/direnv hook fish | source
${pkgs.pay-respects}/bin/pay-respects fish --alias f --nocnf | source
# I need to source /etc/profile using foreign-env, to get stuff set by nixos, e.g. environment.systemVariables.
# set -p fish_function_path ${pkgs.fishPlugins.foreign-env}/share/fish/vendor_functions.d
# I need to source /etc/profile using foreign-env, to get stuff set by nixos, e.g. environment.systemVariables.
# set -p fish_function_path ${pkgs.fishPlugins.foreign-env}/share/fish/vendor_functions.d
# fenv source /etc/profile
# fenv source /etc/profile
source ${./config.fish}
source ${./config.fish}
${aliasesStr}
''
${aliasesStr}
''

View file

@ -1,7 +1,6 @@
pkgs:
builtins.attrValues {
inherit
(pkgs)
inherit (pkgs)
# better cd
zoxide
# pipe viewer

View file

@ -14,44 +14,110 @@
docker_context.symbol = " ";
elixir.symbol = " ";
elm.symbol = " ";
fennel = {symbol = " ";};
fossil_branch = {symbol = " ";};
gcloud = {symbol = " ";};
git_branch = {symbol = " ";};
git_commit = {tag_symbol = " ";};
fennel = {
symbol = " ";
};
fossil_branch = {
symbol = " ";
};
gcloud = {
symbol = " ";
};
git_branch = {
symbol = " ";
};
git_commit = {
tag_symbol = " ";
};
golang.symbol = " ";
gradle = {symbol = " ";};
guix_shell = {symbol = " ";};
haskell = {symbol = " ";};
haxe = {symbol = " ";};
hg_branch = {symbol = " ";};
hostname = {ssh_symbol = " ";};
java = {symbol = " ";};
julia = {symbol = " ";};
kotlin = {symbol = " ";};
lua = {symbol = " ";};
memory_usage = {symbol = "󰍛 ";};
meson = {symbol = "󰔷 ";};
nim = {symbol = "󰆥 ";};
nix_shell = {symbol = " ";};
nodejs = {symbol = " ";};
ocaml = {symbol = " ";};
gradle = {
symbol = " ";
};
guix_shell = {
symbol = " ";
};
haskell = {
symbol = " ";
};
haxe = {
symbol = " ";
};
hg_branch = {
symbol = " ";
};
hostname = {
ssh_symbol = " ";
};
java = {
symbol = " ";
};
julia = {
symbol = " ";
};
kotlin = {
symbol = " ";
};
lua = {
symbol = " ";
};
memory_usage = {
symbol = "󰍛 ";
};
meson = {
symbol = "󰔷 ";
};
nim = {
symbol = "󰆥 ";
};
nix_shell = {
symbol = " ";
};
nodejs = {
symbol = " ";
};
ocaml = {
symbol = " ";
};
os = {
symbols = {
Linux = " ";
NixOS = " ";
};
};
package = {symbol = "󰏗 ";};
perl = {symbol = " ";};
php = {symbol = " ";};
pijul_channel = {symbol = " ";};
pixi = {symbol = "󰏗 ";};
python = {symbol = " ";};
rlang = {symbol = "󰟔 ";};
ruby = {symbol = " ";};
rust = {symbol = "󱘗 ";};
scala = {symbol = " ";};
swift = {symbol = " ";};
zig = {symbol = " ";};
package = {
symbol = "󰏗 ";
};
perl = {
symbol = " ";
};
php = {
symbol = " ";
};
pijul_channel = {
symbol = " ";
};
pixi = {
symbol = "󰏗 ";
};
python = {
symbol = " ";
};
rlang = {
symbol = "󰟔 ";
};
ruby = {
symbol = " ";
};
rust = {
symbol = "󱘗 ";
};
scala = {
symbol = " ";
};
swift = {
symbol = " ";
};
zig = {
symbol = " ";
};
}

View file

@ -1,4 +1,4 @@
{
inherits = "gruvbox_dark_hard";
"ui.background" = {};
"ui.background" = { };
}

View file

@ -38,12 +38,12 @@
vscode-langservers-extracted,
zls,
...
}: let
}:
let
inherit (lib.meta) getExe;
custom-helix =
helix.overrideAttrs
(finalAttrs: previousAttrs: {
custom-helix = helix.overrideAttrs (
finalAttrs: previousAttrs: {
version = "25.07.2";
src = fetchzip {
url = "https://github.com/bloxx12/helix/releases/download/${finalAttrs.version}/helix-${finalAttrs.version}-source.tar.xz";
@ -57,11 +57,12 @@
inherit (custom-helix) src;
hash = "sha256-3poZSvIrkx8lguxxDeNfngW6+4hH8TV/LHcZx5W5aXg=";
};
});
}
);
toml = formats.toml {};
toml = formats.toml { };
helix-languages = callPackage ./languages.nix {inherit lib sources;};
helix-languages = callPackage ./languages.nix { inherit lib sources; };
colorscheme = toml.generate "colorscheme.toml" (import ./colorscheme.nix);
helix-config = {
@ -97,10 +98,25 @@
select = "underline";
};
statusline = {
left = ["spinner" "version-control" "diagnostics" "file-name"];
right = ["file-base-name" "file-type" "position" "file-encoding"];
left = [
"spinner"
"version-control"
"diagnostics"
"file-name"
];
right = [
"file-base-name"
"file-type"
"position"
"file-encoding"
];
};
gutters.layout = ["diff" "diagnostics" "line-numbers" "spacer"];
gutters.layout = [
"diff"
"diagnostics"
"line-numbers"
"spacer"
];
inline-diagnostics = {
cursor-line = "hint";
other-lines = "error";
@ -109,17 +125,29 @@
keys = {
normal = {
space = {
g = [":new" ":insert-output XDG_CONFIG_HOME=~/.config ${getExe lazygit}" ":buffer-close!" ":redraw"];
g = [
":new"
":insert-output XDG_CONFIG_HOME=~/.config ${getExe lazygit}"
":buffer-close!"
":redraw"
];
i = ":toggle lsp.display-inlay-hints";
};
esc = ["collapse_selection" "keep_primary_selection" "normal_mode"];
esc = [
"collapse_selection"
"keep_primary_selection"
"normal_mode"
];
A-H = "goto_previous_buffer";
A-L = "goto_next_buffer";
A-w = ":buffer-close";
A-f = ":format";
A-r = ":reload";
A-x = "extend_to_line_bounds";
X = ["extend_line_up" "extend_to_line_bounds"];
X = [
"extend_line_up"
"extend_to_line_bounds"
];
";" = "flip_selections";
"A-;" = "collapse_selection";
@ -131,8 +159,13 @@
};
select = {
A-x = "extend_to_line_bounds";
X = ["extend_line_up" "extend_to_line_bounds"];
g = {e = "goto_file_end";};
X = [
"extend_line_up"
"extend_to_line_bounds"
];
g = {
e = "goto_file_end";
};
};
};
};
@ -173,7 +206,7 @@
# zig language server
zls
];
nativeBuildInputs = [makeWrapper];
nativeBuildInputs = [ makeWrapper ];
postBuild = ''
mkdir -p $out/config/helix/themes
cp "${toml.generate "config.toml" helix-config}" $out/config/helix/config.toml
@ -184,4 +217,4 @@
'';
};
in
wrapped-helix
wrapped-helix

View file

@ -22,12 +22,13 @@
vscode-langservers-extracted,
zls,
...
}: let
}:
let
inherit (lib.meta) getExe getExe';
toml = formats.toml {};
toml = formats.toml { };
nixfmt = callPackage "${sources.nixfmt}/default.nix" {};
nixfmt = callPackage "${sources.nixfmt}/default.nix" { };
# a newer nil version, for pipes support.
new-nil = nil.overrideAttrs (_: {
@ -48,129 +49,157 @@
};
});
new-deadnix = deadnix.overrideAttrs (finalAttrs: previousAttrs: {
version = "unstable-15-07-2025";
src = fetchFromGitHub {
owner = "astro";
repo = "deadnix";
rev = "d75457b95d7cfa82fcd60970939f76fccfce19e5";
hash = "sha256-O/z2neAXL8JNkGosvxC+DyZnnJ8zYP9XHApxHVmlzfY=";
};
doInstallCheck = false;
cargoDeps = rustPlatform.fetchCargoVendor {
inherit (new-deadnix) src;
hash = "sha256-O8yhqyPflOvQXAA19k1XpbrHysgV5VNWLBX0l5Q5GkM=";
};
});
helix-languages = {
language = let
mark = lang: {
command = getExe deno;
args = ["fmt" "-" "--ext" lang];
new-deadnix = deadnix.overrideAttrs (
finalAttrs: previousAttrs: {
version = "unstable-15-07-2025";
src = fetchFromGitHub {
owner = "astro";
repo = "deadnix";
rev = "d75457b95d7cfa82fcd60970939f76fccfce19e5";
hash = "sha256-O/z2neAXL8JNkGosvxC+DyZnnJ8zYP9XHApxHVmlzfY=";
};
in [
{
name = "bash";
auto-format = true;
formatter = {
command = getExe shfmt;
args = ["-i" "2"];
};
}
{
name = "clojure";
injection-regex = "(clojure|clj|edn|boot|yuck)";
file-types = ["clj" "cljs" "cljc" "clje" "cljr" "cljx" "edn" "boot" "yuck"];
}
{
name = "cmake";
auto-format = true;
language-servers = ["cmake-language-server"];
formatter = {
command = getExe cmake-format;
args = ["-"];
};
}
{
name = "javascript";
auto-format = true;
language-servers = ["dprint" "typescript-language-server"];
}
{
name = "json";
formatter = mark "json";
}
{
name = "markdown";
auto-format = true;
formatter = mark "md";
language-servers = ["taplo"];
}
{
name = "nix";
language-servers = ["nil"];
}
{
name = "qml";
language-servers = ["qmlls"];
}
{
name = "python";
auto-format = true;
language-servers = [
"basedpyright"
"ruff"
];
}
{
name = "typescript";
auto-format = true;
language-servers = ["dprint" "typescript-language-server"];
}
{
name = "rust";
}
{
name = "c";
auto-format = true;
language-servers = ["clangd"];
}
{
name = "zig";
auto-format = true;
}
{
name = "c";
debugger = {
name = "gdb";
command = getExe gdb;
transport = "stdio";
templates = [
{
name = "binary";
request = "launch";
completion = [
{
name = "binary";
completion = "filename";
}
];
args = {
program = "{0}";
runInTerminal = true;
};
}
doInstallCheck = false;
cargoDeps = rustPlatform.fetchCargoVendor {
inherit (new-deadnix) src;
hash = "sha256-O8yhqyPflOvQXAA19k1XpbrHysgV5VNWLBX0l5Q5GkM=";
};
}
);
helix-languages = {
language =
let
mark = lang: {
command = getExe deno;
args = [
"fmt"
"-"
"--ext"
lang
];
};
}
];
in
[
{
name = "bash";
auto-format = true;
formatter = {
command = getExe shfmt;
args = [
"-i"
"2"
];
};
}
{
name = "clojure";
injection-regex = "(clojure|clj|edn|boot|yuck)";
file-types = [
"clj"
"cljs"
"cljc"
"clje"
"cljr"
"cljx"
"edn"
"boot"
"yuck"
];
}
{
name = "cmake";
auto-format = true;
language-servers = [ "cmake-language-server" ];
formatter = {
command = getExe cmake-format;
args = [ "-" ];
};
}
{
name = "javascript";
auto-format = true;
language-servers = [
"dprint"
"typescript-language-server"
];
}
{
name = "json";
formatter = mark "json";
}
{
name = "markdown";
auto-format = true;
formatter = mark "md";
language-servers = [ "taplo" ];
}
{
name = "nix";
language-servers = [ "nil" ];
}
{
name = "qml";
language-servers = [ "qmlls" ];
}
{
name = "python";
auto-format = true;
language-servers = [
"basedpyright"
"ruff"
];
}
{
name = "typescript";
auto-format = true;
language-servers = [
"dprint"
"typescript-language-server"
];
}
{
name = "rust";
}
{
name = "c";
auto-format = true;
language-servers = [ "clangd" ];
}
{
name = "zig";
auto-format = true;
}
{
name = "c";
debugger = {
name = "gdb";
command = getExe gdb;
transport = "stdio";
templates = [
{
name = "binary";
request = "launch";
completion = [
{
name = "binary";
completion = "filename";
}
];
args = {
program = "{0}";
runInTerminal = true;
};
}
];
};
}
];
language-server = {
bash-language-server = {
command = getExe bash-language-server;
args = ["start"];
args = [ "start" ];
};
rust-analyzer = {
@ -186,7 +215,15 @@
};
check = {
command = "clippy";
extraArgs = ["--" "-W" "clippy::pedantic" "-W" "clippy::nursery" "-W" "clippy::perf"];
extraArgs = [
"--"
"-W"
"clippy::pedantic"
"-W"
"clippy::nursery"
"-W"
"clippy::perf"
];
};
lens = {
references = true;
@ -200,7 +237,7 @@
clangd = {
command = "${clang-tools}/bin/clangd";
clangd.fallbackFlags = ["-std=c++2b"];
clangd.fallbackFlags = [ "-std=c++2b" ];
};
cmake-language-server = {
@ -209,7 +246,7 @@
deno-lsp = {
command = getExe deno;
args = ["lsp"];
args = [ "lsp" ];
environment.NO_COLOR = "1";
config.deno = {
enable = true;
@ -217,7 +254,9 @@
unstable = true;
suggest = {
completeFunctionCalls = false;
imports = {hosts."https://deno.land" = true;};
imports = {
hosts."https://deno.land" = true;
};
};
inlayHints = {
enumMemberValues.enabled = true;
@ -231,13 +270,13 @@
};
dprint = {
command = getExe dprint;
args = ["lsp"];
args = [ "lsp" ];
};
nil = {
command = getExe new-nil;
config.nil = {
formatting.command = ["${getExe nixfmt}"];
formatting.command = [ "${getExe nixfmt}" ];
diagnostics = {
bindingEndHintMinLines = 3;
};
@ -254,7 +293,7 @@
typescript-language-server = {
command = getExe typescript-language-server;
args = ["--stdio"];
args = [ "--stdio" ];
config = {
typescript-language-server.source = {
addMissingImports.ts = true;
@ -267,18 +306,18 @@
};
ruff = {
command = getExe ruff;
args = ["server"];
args = [ "server" ];
};
qmlls = {
command = getExe' kdePackages.qtdeclarative "qmlls";
args = ["-E"];
args = [ "-E" ];
};
basedpyright.command = "${basedpyright}/bin/basedpyright-langserver";
vscode-css-language-server = {
command = "${vscode-langservers-extracted}/bin/vscode-css-language-server";
args = ["--stdio"];
args = [ "--stdio" ];
config = {
provideFormatter = true;
css.validate.enable = true;
@ -289,7 +328,11 @@
command = getExe zls;
config = {
enable_build_on_save = true;
build_on_save_args = ["check" "-fincremental" "--watch"];
build_on_save_args = [
"check"
"-fincremental"
"--watch"
];
enable_autofix = false;
warn_style = true;
highlight_global_var_declarations = true;
@ -298,4 +341,4 @@
};
};
in
toml.generate "languages.toml" helix-languages
toml.generate "languages.toml" helix-languages

View file

@ -5,7 +5,8 @@
symlinkJoin,
kakounePlugins,
...
}: let
}:
let
custom-kakoune = stdenv.mkDerivation {
name = "custom-kakoune";
src = fetchFromGitHub {
@ -15,7 +16,10 @@
hash = "sha256-+xqJrJr6nnmEpQaizQ3JMDEISCD8IMB84NJZiXJ74kY=";
};
makeFlags = ["debug=no" "PREFIX=${placeholder "out"}"];
makeFlags = [
"debug=no"
"PREFIX=${placeholder "out"}"
];
enableParallellBuilding = true;
@ -32,13 +36,13 @@
'';
};
plugins = builtins.attrValues {
inherit (kakounePlugins);
inherit (kakounePlugins) ;
};
kakoune-wrapped = symlinkJoin {
name = "kakoune-wrapped";
nativeBuildInputs = [makeWrapper];
paths = [custom-kakoune] ++ plugins;
nativeBuildInputs = [ makeWrapper ];
paths = [ custom-kakoune ] ++ plugins;
postBuild = ''
# create a directory for bins that kakoune needs
@ -62,4 +66,4 @@
'';
};
in
kakoune-wrapped
kakoune-wrapped

View file

@ -1,44 +1,45 @@
{pkgs, ...}: let
{ pkgs, ... }:
let
inherit (pkgs) lib;
inherit (lib.meta) getExe;
nu-config =
pkgs.writeText "nu-init"
# nu
''
#!/usr/bin/env nu
source ${./config.nu}
source ${./prompt.nu}
# nu
''
#!/usr/bin/env nu
source ${./config.nu}
source ${./prompt.nu}
let autoload_dir = $nu.user-autoload-dirs.0
mkdir $autoload_dir
let autoload_dir = $nu.user-autoload-dirs.0
mkdir $autoload_dir
let zoxide_path = $autoload_dir | path join zoxide.nu
if not ($zoxide_path | path exists) {
${getExe pkgs.zoxide} init nushell --cmd cd | save -f $zoxide_path
}
# Atuin is too slow, sadly.
# let atuin_path = $autoload_dir | path join atuin.nu
# if not ($atuin_path | path exists) {
# ${getExe pkgs.atuin} init nu | save -f $atuin_path
# }
let carapace_path = $autoload_dir | path join carapace.nu
if not ($carapace_path | path exists) {
${getExe pkgs.carapace} _carapace nushell | save -f $carapace_path
}
'';
let zoxide_path = $autoload_dir | path join zoxide.nu
if not ($zoxide_path | path exists) {
${getExe pkgs.zoxide} init nushell --cmd cd | save -f $zoxide_path
}
# Atuin is too slow, sadly.
# let atuin_path = $autoload_dir | path join atuin.nu
# if not ($atuin_path | path exists) {
# ${getExe pkgs.atuin} init nu | save -f $atuin_path
# }
let carapace_path = $autoload_dir | path join carapace.nu
if not ($carapace_path | path exists) {
${getExe pkgs.carapace} _carapace nushell | save -f $carapace_path
}
'';
packages = import ./packages.nix pkgs;
in
(pkgs.symlinkJoin {
name = "nushell";
paths = [pkgs.nushell] ++ packages;
nativeBuildInputs = [pkgs.makeWrapper];
postBuild = ''
wrapProgram $out/bin/nu --add-flags "\
--config ${nu-config}"
'';
})
.overrideAttrs (_: {
(pkgs.symlinkJoin {
name = "nushell";
paths = [ pkgs.nushell ] ++ packages;
nativeBuildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/nu --add-flags "\
--config ${nu-config}"
'';
}).overrideAttrs
(_: {
passthru = {
shellPath = "/bin/nu";
};

View file

@ -1,7 +1,6 @@
pkgs:
builtins.attrValues {
inherit
(pkgs)
inherit (pkgs)
# better cd
zoxide
# pipe viewer