whole flake: cleanup

This commit is contained in:
Charlie Root 2024-11-02 17:45:34 +01:00
commit 57831df0d5
Signed by: faukah
SSH key fingerprint: SHA256:jpYIt4Vkz1NBTQcks/N9OPTfTFxE6KF2W/rV7hrfrIw
22 changed files with 330 additions and 437 deletions

View file

@ -1,15 +0,0 @@
{
config,
lib,
pkgs,
...
}: let
inherit (config.meta.mainUser) username;
in {
home-manager.users.${username}.programs.atuin = {
enable = true;
package = pkgs.atuin;
enableFishIntegration = true;
enableBashIntegration = true;
};
}

View file

@ -1,25 +0,0 @@
{
config,
lib,
pkgs,
...
}: let
inherit (config.modules.other.system) username;
inherit (lib) mkIf;
cfg = config.modules.system.programs.eza;
in {
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.eza = {
enable = true;
package = pkgs.eza;
git = true;
icons = "auto";
enableNushellIntegration = true;
enableBashIntegration = true;
enableFishIntegration = true;
enableZshIntegration = true;
};
};
};
}

View file

@ -1,69 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.modules.programs.fish;
inherit (config.modules.other.system) username;
in {
options.modules.programs.fish = {
enable = mkEnableOption "fish";
extraAliases = mkOption {
type = types.attrs;
description = "extra shell aliases";
default = {};
};
};
config = mkIf cfg.enable {
programs.fish.enable = false;
# homix.".config/fish/config.fish".source = fishinit;
# users.users.${username}.shell = pkgs.fish;
environment = {
# shells = [pkgs.fish];
# pathsToLink = ["/share/fish"];
};
home-manager.users.${username} = {
programs = {
fish = {
enable = true;
interactiveShellInit = "set fish_greeting";
plugins = [
{
name = "sponge";
inherit (pkgs.fishPlugins.sponge) src;
}
{
name = "done";
inherit (pkgs.fishPlugins.done) src;
}
{
name = "puffer";
inherit (pkgs.fishPlugins.puffer) src;
}
];
shellAbbrs = {
c = "clear";
cc = "cd ~ && clear";
mv = "mv -iv";
rm = "trash -v";
ls = "eza ";
l = "eza -a ";
la = "eza -lha --git";
lg = "lazygit";
cd = "z";
v = "nvim";
h = "hx";
k = "kak";
e = "emacs";
};
};
};
};
};
}

View file

@ -1,13 +1,7 @@
_: {
imports = [
./fish.nix
./nh.nix
./starship.nix
./thefuck.nix
./zoxide.nix
./beets.nix
./atuin.nix
./zellij
./eza.nix
];
}

View file

@ -1,101 +0,0 @@
# Credits to raf, his flake is in the README.md
{
config,
lib,
...
}: let
inherit (builtins) map;
inherit (config.meta.mainUser) username;
hmCfg = config.home-manager.users.${username};
inherit (lib.strings) concatStrings;
in {
home-manager.users.${username} = let
elemsConcatted = concatStrings (
map (s: "\$${s}") [
"hostname"
"username"
"directory"
"shell"
"nix_shell"
"git_branch"
"git_commit"
"git_state"
"git_status"
"jobs"
"cmd_duration"
]
);
in {
home.sessionVariables = {
STARSHIP_CACHE = "${hmCfg.home.homeDirectory}/.cache/starship";
};
programs.starship = {
enable = true;
enableFishIntegration = true;
enableTransience = true;
settings = {
scan_timeout = 2;
command_timeout = 2000; # nixpkgs makes starship implode with lower values
add_newline = false;
line_break.disabled = false;
format = "${elemsConcatted}\n$character";
hostname = {
ssh_only = true;
disabled = false;
format = "@[$hostname](bold blue) "; # the whitespace at the end is actually important
};
# configure specific elements
character = {
error_symbol = "[](bold red)";
success_symbol = "[](bold green)";
vicmd_symbol = "[](bold yellow)";
format = "$symbol [|](bold bright-black) ";
};
username = {
format = "[$user]($style) in ";
};
directory = {
truncation_length = 2;
# removes the read_only symbol from the format, it doesn't play nicely with my folder icon
format = "[ ](bold green) [$path]($style) ";
};
# git
git_commit.commit_hash_length = 7;
git_branch.style = "bold purple";
git_status = {
style = "red";
ahead = " ";
behind = " ";
conflicted = " ";
renamed = "»";
deleted = " ";
diverged = " ";
modified = "!";
stashed = "";
staged = "+";
untracked = "?";
};
# language configurations
# the whitespaces at the end *are* necessary for proper formatting
lua.symbol = "[ ](blue) ";
python.symbol = "[ ](blue) ";
rust.symbol = "[ ](red) ";
nix_shell.symbol = "[󱄅 ](blue) ";
golang.symbol = "[󰟓 ](blue)";
c.symbol = "[ ](black)";
nodejs.symbol = "[󰎙 ](yellow)";
package.symbol = "📦 ";
};
};
};
}

View file

@ -1,24 +0,0 @@
{
config,
lib,
pkgs,
...
}: let
inherit (config.modules.other.system) username;
inherit (lib) mkIf;
cfg = config.modules.system.programs.oh-my-posh;
in {
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.thefuck = {
enable = true;
package = pkgs.thefuck;
enableInstantMode = true;
enableNushellIntegration = true;
enableBashIntegration = true;
enableFishIntegration = true;
enableZshIntegration = true;
};
};
};
}

View file

@ -1,24 +0,0 @@
{
config,
lib,
pkgs,
...
}: let
inherit (config.modules.other.system) username;
inherit (lib) mkIf;
cfg = config.modules.system.programs.eza;
in {
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.zoxide = {
enable = true;
package = pkgs.zoxide;
enableNushellIntegration = true;
enableBashIntegration = true;
enableFishIntegration = true;
enableZshIntegration = true;
};
};
};
}

View file

@ -39,58 +39,5 @@ in {
environment.systemPackages = [
custom-kakoune
];
home-manager.users.${username}.programs.kakoune = mkIf false {
enable = true;
package = custom-kakoune;
config = {
autoComplete = ["insert"];
autoReload = "yes";
indentWidth = 4;
tabStop = 4;
incrementalSearch = false;
numberLines = {
enable = true;
relative = true;
highlightCursor = true;
separator = " ";
};
scrollOff = {
lines = 4;
columns = 4;
};
wrapLines = {
enable = true;
indent = true;
word = true;
};
ui = {
enableMouse = true;
assistant = "none";
statusLine = "bottom";
};
};
plugins = with pkgs.kakounePlugins; [
active-window-kak
auto-pairs-kak
byline-kak # ope
prelude-kak # dependency of byline
kak-ls
kakboard
kakoune-buffer-switcher
kakoune-buffers
kakoune-lsp
kakoune-rainbow
kakoune-registers
kakoune-vertical-selection
powerline-kak
quickscope-kak
smarttab-kak
zig-kak
];
# extraConfig = ./kakrc;
};
};
}

View file

@ -3,8 +3,6 @@ _: {
./vesktop.nix
./foot.nix
./spicetify.nix
./mpv.nix
./zathura.nix
./steam.nix
./waybar.nix
./schizofox.nix

View file

@ -1,26 +0,0 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.modules.usrEnv.programs.media.mpv;
inherit (config.modules.other.system) username;
inherit (lib) mkIf;
in {
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.mpv = {
enable = true;
config = {
hwdec = "auto";
volume = 50;
osc = "no";
osd-bar = "no";
border = "no";
};
scripts = with pkgs.mpvScripts; [mpris thumbfast sponsorblock uosc];
};
};
};
}

View file

@ -1,46 +0,0 @@
{pkgs, ...}: let
vivado-desktop-symbol = pkgs.makeDesktopItem {
name = "vivado2019.2";
desktopName = "Vivado";
exec = "${pkgs.nur.repos.Nick1296.vivado-2019-2}/bin/vivado";
};
in {
environment.systemPackages = [
# this propietary software is huge, but I need it for
# university
pkgs.nur.repos.Nick1296.vivado-2019-2
vivado-desktop-symbol
];
# Create udev rules. Reference: https://blog.kotatsu.dev/posts/2021-09-14-vivado-on-nixos/
services.udev.packages = [
(pkgs.writeTextFile {
name = "xilinx-dilligent-usb-udev";
destination = "/etc/udev/rules.d/52-xilinx-digilent-usb.rules";
text = ''
ATTR{idVendor}=="1443", MODE:="666"
ACTION=="add", ATTR{idVendor}=="0403", ATTR{manufacturer}=="Digilent", MODE:="666"
'';
})
(pkgs.writeTextFile {
name = "xilinx-pcusb-udev";
destination = "/etc/udev/rules.d/52-xilinx-pcusb.rules";
text = ''
ATTR{idVendor}=="03fd", ATTR{idProduct}=="0008", MODE="666"
ATTR{idVendor}=="03fd", ATTR{idProduct}=="0007", MODE="666"
ATTR{idVendor}=="03fd", ATTR{idProduct}=="0009", MODE="666"
ATTR{idVendor}=="03fd", ATTR{idProduct}=="000d", MODE="666"
ATTR{idVendor}=="03fd", ATTR{idProduct}=="000f", MODE="666"
ATTR{idVendor}=="03fd", ATTR{idProduct}=="0013", MODE="666"
ATTR{idVendor}=="03fd", ATTR{idProduct}=="0015", MODE="666"
'';
})
(pkgs.writeTextFile {
name = "xilinx-ftdi-usb-udev";
destination = "/etc/udev/rules.d/52-xilinx-ftdi-usb.rules";
text = ''
ACTION=="add", ATTR{idVendor}=="0403", ATTR{manufacturer}=="Xilinx", MODE:="666"
'';
})
];
}

View file

@ -1,28 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.modules.system.programs.zathura;
inherit (config.modules.other.system) username;
in {
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.zathura = {
enable = true;
options = {
selection-clipboard = "clipboard";
adjust-open = "best-fit";
pages-per-row = "1";
scroll-page-aware = "true";
scroll-full-overlap = "0.01";
scroll-step = "100";
zoom-min = "10";
guioptions = "none";
};
};
};
};
}

View file

@ -37,19 +37,5 @@ in {
}
'';
};
home-manager.users.${username} = {
# services = {
# mpd-mpris = {
# enable = true;
# mpd = {
# host = "127.0.0.1";
# network = "unix";
# port = 6600;
# useLocal = true;
# };
# };
# };
};
};
}

View file

@ -1,6 +1,11 @@
{pkgs, ...}: rec {
{
inputs,
pkgs,
...
}: rec {
packages = {
fish = pkgs.callPackage ./shell {};
helix = pkgs.callPackge ./helix {};
};
shell = pkgs.mkShell {
name = "bloxx-shell";

View file

@ -1,6 +1,6 @@
# This shell setup was inspired by sioodmy. Check out his setup!
{
lib,
inputs,
pkgs,
...
}: let

View file

@ -0,0 +1,36 @@
{
inputs,
pkgs,
...
}: let
toml = pkgs.formats.toml {};
inherit (inputs.helix.packages.${pkgs.stdenv.system}) helix;
packages = with pkgs; [
# C/C++
clang-tools
# Markdown
marksman
# Nix
nil
lldb_19
# Bash
bash-language-server
# Shell
shellcheck
];
helix-config = import ./config.nix;
helix-wrapped = pkgs.symlinkJoin {
name = "fish-wrapped";
paths = [helix] ++ packages;
buildInputs = [pkgs.makeWrapper];
postBuild = ''
wrapProgram $out/bin/fish --set XDG_CONFIG_HOME "${toml.generate "config.toml" helix-config}"
'';
};
in
helix-wrapped

View file

@ -0,0 +1,203 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.modules.system.programs.editors.helix;
inherit (config.modules.other.system) username;
inherit (lib) mkIf getExe;
in {
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.helix.languages = {
language = let
extraFormatter = lang: {
command = getExe pkgs.deno;
args = ["fmt" "-" "--ext" lang];
};
in [
{
name = "bash";
auto-format = true;
formatter = {
command = getExe pkgs.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 pkgs.cmake-format;
args = ["-"];
};
}
{
name = "javascript";
auto-format = true;
language-servers = ["dprint" "typescript-language-server"];
}
{
name = "json";
formatter = extraFormatter "json";
}
{
name = "markdown";
auto-format = true;
formatter = extraFormatter "md";
}
{
name = "python";
language-servers = ["pyright"];
formatter = {
command = getExe pkgs.black;
args = ["-" "--quiet" "--line-length 100"];
};
}
{
name = "typescript";
auto-format = true;
language-servers = ["dprint" "typescript-language-server"];
}
{
name = "rust";
debugger = {
command = "${pkgs.lldb_19}/bin/lldb-dap";
name = "lldb";
transport = "stdio";
templates = [
{
name = "binary";
request = "launch";
completion = [
{
name = "binary";
completion = "filename";
}
];
args = {
program = "{0}";
runInTerminal = true;
};
}
];
};
}
{
name = "c";
debugger = {
name = "gdb";
command = "${pkgs.gdb}/bin/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 pkgs.bash-language-server;
args = ["start"];
};
clangd = {
command = "${pkgs.clang-tools}/bin/clangd";
clangd.fallbackFlags = ["-std=c++2b"];
};
cmake-language-server = {
command = getExe pkgs.cmake-language-server;
};
dprint = {
command = getExe pkgs.dprint;
args = ["lsp"];
};
nil = {
command = getExe pkgs.nil;
# alejandro
config.nil.formatting.command = ["${getExe pkgs.alejandra}" "-q"];
};
qmlls = {
command = "${pkgs.kdePackages.full}/bin/qmlls";
};
pyright = {
command = "${pkgs.pyright}/bin/pyright-langserver";
args = ["--stdio"];
config = {
reportMissingTypeStubs = false;
analysis = {
typeCheckingMode = "basic";
autoImportCompletions = true;
};
};
};
typescript-language-server = {
command = getExe pkgs.typescript-language-server;
args = ["--stdio"];
config = let
inlayHints = {
includeInlayEnumMemberValueHints = true;
includeInlayFunctionLikeReturnTypeHints = true;
includeInlayFunctionParameterTypeHints = true;
includeInlayParameterNameHints = "all";
includeInlayParameterNameHintsWhenArgumentMatchesName = true;
includeInlayPropertyDeclarationTypeHints = true;
includeInlayVariableTypeHints = true;
};
in {
typescript-language-server.source = {
addMissingImports.ts = true;
fixAll.ts = true;
organizeImports.ts = true;
removeUnusedImports.ts = true;
sortImports.ts = true;
};
typescript = {inherit inlayHints;};
javascript = {inherit inlayHints;};
hostInfo = "helix";
};
};
# vscode-css-language-server = {
# command = "${pkgs.nodePackages.vscode-langservers-extracted}/bin/vscode-css-languageserver";
# args = ["--stdio"];
# config = {
# provideFormatter = true;
# css.validate.enable = true;
# scss.validate.enable = true;
# };
# };
};
};
};
};
}

View file

@ -0,0 +1,81 @@
{
config,
inputs,
lib,
pkgs,
...
}: let
cfg = config.modules.system.programs.editors.helix;
inherit (config.modules.other.system) username;
inherit (lib) mkIf getExe;
inherit (inputs.helix.packages.${pkgs.stdenv.system}) helix;
wrapped-helix = pkgs.symlinkJoin {
name = "helix-wrapped";
paths = with pkgs; [
helix
# C/C++
clang-tools
# Markdown
marksman
# Nix
nil
lldb_19
# Bash
bash-language-server
# Shell
shellcheck
];
};
in {
imports = [./languages.nix];
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.helix = {
enable = true;
package = wrapped-helix;
settings = {
theme = "catppuccin_mocha";
editor = {
cursorline = false;
color-modes = true;
indent-guides.render = true;
lsp = {
display-inlay-hints = true;
display-messages = true;
};
line-number = "relative";
true-color = true;
auto-format = true;
completion-timeout = 5;
mouse = true;
bufferline = "multiple";
soft-wrap.enable = true;
cursor-shape = {insert = "bar";};
statusline = {
left = ["spinner" "version-control" "diagnostics" "file-name"];
right = ["file-base-name" "file-type" "selections" "position" "file-encoding"];
};
gutters.layout = ["diff" "diagnostics" "line-numbers" "spacer"];
inline-diagnostics = {
cursor-line = "hint";
other-lines = "error";
};
};
keys.normal = {
space.g = [":new" ":insert-output ${getExe pkgs.lazygit}" ":buffer-close!" ":redraw"];
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";
};
};
};
};
};
}

View file

@ -3,6 +3,7 @@ pkgs: (with pkgs; [
zoxide
#better ls
eza
atuin
# better cat
bat