[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,17 +1,22 @@
{ device, pkgs, ... }: {
{
device,
pkgs,
...
}: {
programs.firefox = {
enable = device.isLinux;
profiles.default = {
userChrome =
let
csshacks = pkgs.fetchFromGitHub {
owner = "MrOtherGuy";
repo = "firefox-csshacks";
rev = "master";
sha256 = "sha256-XJ+MTEADzOsCIh0I8EAxbtIpDHfMJsN68sKBy7/1l60=";
};
in
/* css */
userChrome = let
csshacks = pkgs.fetchFromGitHub {
owner = "MrOtherGuy";
repo = "firefox-csshacks";
rev = "master";
sha256 = "sha256-XJ+MTEADzOsCIh0I8EAxbtIpDHfMJsN68sKBy7/1l60=";
};
in
/*
css
*/
''
/* @import url(${csshacks}/chrome/toolbars_below_content.css); */
/* @import url(${csshacks}/chrome/scrollable_menupopups.css); */
@@ -23,12 +28,11 @@
tridactyl
];
};
nativeMessagingHosts = [ pkgs.tridactyl-native ];
nativeMessagingHosts = [pkgs.tridactyl-native];
policies = {
ExtensionSettings = {
"uBlock0@raymondhill.net" = {
install_url =
"https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
installation_mode = "force_installed";
};
};

View File

@@ -1,30 +1,31 @@
{ ... }: {
imports = [ ../modules/goread.nix ];
{...}: {
imports = [../modules/goread.nix];
programs.goread = {
enable = true;
config = {
urls = {
categories = [{
name = "Rust";
desc = "Stuff related to the rust programming language";
subscriptions = [
{
name = "r/rust";
desc = "The rust subreddit";
url = "https://old.reddit.com/r/rust/.rss";
}
{
name = "thesquareplanet";
desc = "jonhoo's blog";
url = "https://thesquareplanet.com/feed.xml";
}
{
name = "Jon Gjengset's Youtube";
desc = "jonhoo's youtube channel";
url = "https://www.youtube.com/feeds/videos.xml?channel_id=UC_iD0xppBwwsrM9DegC5cQQ";
}
];
}
categories = [
{
name = "Rust";
desc = "Stuff related to the rust programming language";
subscriptions = [
{
name = "r/rust";
desc = "The rust subreddit";
url = "https://old.reddit.com/r/rust/.rss";
}
{
name = "thesquareplanet";
desc = "jonhoo's blog";
url = "https://thesquareplanet.com/feed.xml";
}
{
name = "Jon Gjengset's Youtube";
desc = "jonhoo's youtube channel";
url = "https://www.youtube.com/feeds/videos.xml?channel_id=UC_iD0xppBwwsrM9DegC5cQQ";
}
];
}
{
name = "Nix";
desc = "Stuff related to the nix / nixos / nixlang";
@@ -35,9 +36,9 @@
url = "https://old.reddit.com/r/nixos/.rss";
}
];
}];
}
];
};
};
};
}

View File

@@ -1,16 +1,26 @@
{ inputs, config, pkgs, lib, device, ... }: {
imports = [
inputs.nix-index-database.hmModules.nix-index
./tmux.nix
./wezterm.nix
./nvim.nix
./goread.nix
./ncmpcpp.nix
# ./neomutt.nix
] ++ lib.optionals device.isLinux [ ../linux ];
{
inputs,
config,
pkgs,
lib,
device,
...
}: {
imports =
[
inputs.nix-index-database.hmModules.nix-index
./tmux.nix
./wezterm.nix
./nvim.nix
./goread.nix
./ncmpcpp.nix
# ./neomutt.nix
]
++ lib.optionals device.isLinux [../linux];
home.packages = with pkgs;
[
sony-headphones-client
sd
go
p7zip
@@ -38,7 +48,7 @@
macchina
ripgrep
fd
nixfmt
alejandra
dust
cachix
rustup
@@ -48,11 +58,12 @@
nil
pkg-config
lua-language-server
(nerdfonts.override { fonts = [ "Hasklig" ]; })
(nerdfonts.override {fonts = ["Hasklig"];})
pfetch-rs
psst
abaddon
] ++ lib.optionals device.isLinux [
]
++ lib.optionals device.isLinux [
mpv
catppuccinThemes.gtk
catppuccinThemes.papirus-folders
@@ -74,7 +85,8 @@
lsof
wl-clipboard
ncpamixer
] ++ lib.optionals device.isMac [ ];
]
++ lib.optionals device.isMac [];
xdg.enable = true;
xdg.userDirs = {
@@ -102,7 +114,7 @@
space.space = "file_picker";
space.w = ":w";
space.q = ":q";
esc = [ "collapse_selection" "keep_primary_selection" ];
esc = ["collapse_selection" "keep_primary_selection"];
};
};
};
@@ -133,7 +145,7 @@
cat = "bat";
t = "tmux";
};
shellAliases = { g = "git"; };
shellAliases = {g = "git";};
shellInit = ''
set fish_greeting
yes | fish_config theme save "Catppuccin Mocha"
@@ -171,9 +183,10 @@
enable = true;
enableFishIntegration = true;
enableNushellIntegration = true;
settings =
let flavour = "mocha"; # Replace with your preferred palette
in {
settings = let
flavour = "mocha"; # Replace with your preferred palette
in
{
# Check https://starship.rs/config/#prompt
format = "$all$character";
palette = "catppuccin_${flavour}";
@@ -186,7 +199,8 @@
truncation_length = 4;
style = "bold lavender";
};
} // builtins.fromTOML (builtins.readFile
}
// builtins.fromTOML (builtins.readFile
(pkgs.catppuccinThemes.starship + /palettes/${flavour}.toml));
};
eza = {
@@ -213,14 +227,14 @@
};
bat = {
enable = true;
config = { theme = "catppuccin"; };
config = {theme = "catppuccin";};
themes = {
catppuccin = {
src = "${pkgs.catppuccinThemes.bat}/themes";
file = "Catppuccin Mocha.tmTheme";
};
};
extraPackages = with pkgs.bat-extras; [ batdiff batman batgrep batwatch ];
extraPackages = with pkgs.bat-extras; [batdiff batman batgrep batwatch];
};
rbw = {
@@ -229,7 +243,9 @@
email = "uttarayan21@gmail.com";
base_url = "https://pass.uttarayan.me";
pinentry =
if device.isMac then pkgs.pinentry_mac else pkgs.pinentry-gnome3;
if device.isMac
then pkgs.pinentry_mac
else pkgs.pinentry-gnome3;
};
};
@@ -243,7 +259,7 @@
];
};
home-manager = { enable = true; };
home-manager = {enable = true;};
};
fonts.fontconfig.enable = true;
@@ -251,10 +267,9 @@
home = {
username = device.user;
homeDirectory =
if device.isMac then
lib.mkForce "/Users/${device.user}"
else
lib.mkForce "/home/${device.user}";
if device.isMac
then lib.mkForce "/Users/${device.user}"
else lib.mkForce "/home/${device.user}";
stateVersion = "23.11";
@@ -266,9 +281,11 @@
EDITOR = "nvim";
SHELL = "${pkgs.nushellFull}/bin/nu";
CARGO_TARGET_DIR = "${config.xdg.cacheHome}/cargo/target";
BROWSER = if device.isMac then "open" else "xdg-open";
BROWSER =
if device.isMac
then "open"
else "xdg-open";
};
sessionPath = [ "${config.home.homeDirectory}/.cargo/bin" ];
sessionPath = ["${config.home.homeDirectory}/.cargo/bin"];
};
}

View File

@@ -1,15 +1,16 @@
{ pkgs, ... }: {
{pkgs, ...}: {
programs.ncmpcpp = {
enable = true;
bindings = pkgs.lib.attrsets.mapAttrsToList (key: value: {
key = key;
command = value;
}) {
j = "scroll_down";
k = "scroll_up";
J = [ "select_item" "scroll_down" ];
K = [ "select_item" "scroll_up" ];
};
bindings =
pkgs.lib.attrsets.mapAttrsToList (key: value: {
key = key;
command = value;
}) {
j = "scroll_down";
k = "scroll_up";
J = ["select_item" "scroll_down"];
K = ["select_item" "scroll_up"];
};
package = pkgs.ncmpcpp;
};
}

View File

@@ -1,4 +1,4 @@
{ pkgs, ... }: {
{pkgs, ...}: {
programs.neomutt = {
enable = true;
vimKeys = true;

View File

@@ -1,48 +1,45 @@
{ pkgs, ... }: {
{pkgs, ...}: {
programs.newsboat = {
enable = false;
urls = [
{
title = "r/rust";
url = "https://www.reddit.com/r/rust/.rss";
tags = [ "rust" ];
tags = ["rust"];
}
{
title = "the square planet";
url = "https://thesquareplanet.com/feed.xml";
tags = [ "rust" ];
tags = ["rust"];
}
{
title = "Jon Gjengset's YouTube";
url =
"https://www.youtube.com/feeds/videos.xml?channel_id=UC_iD0xppBwwsrM9DegC5cQQ";
tags = [ "rust" "youtube" ];
url = "https://www.youtube.com/feeds/videos.xml?channel_id=UC_iD0xppBwwsrM9DegC5cQQ";
tags = ["rust" "youtube"];
}
];
extraConfig =
let
dracula = builtins.fetchurl {
url = "https://raw.githubusercontent.com/dracula/newsboat/main/newsboat";
sha256 = "sha256:08b00ilc5zk5fkzqqd6aghcpya3d00s9kvv65b8c50rg7ikm88xr";
};
in
''
include ${dracula}
unbind-key g
bind-key g home
unbind-key G
bind-key G end
extraConfig = let
dracula = builtins.fetchurl {
url = "https://raw.githubusercontent.com/dracula/newsboat/main/newsboat";
sha256 = "sha256:08b00ilc5zk5fkzqqd6aghcpya3d00s9kvv65b8c50rg7ikm88xr";
};
in ''
include ${dracula}
unbind-key g
bind-key g home
unbind-key G
bind-key G end
unbind-key h
unbind-key j
unbind-key k
unbind-key l
unbind-key h
unbind-key j
unbind-key k
unbind-key l
bind-key h quit
bind-key j down
bind-key k up
bind-key l open
'';
bind-key h quit
bind-key j down
bind-key k up
bind-key l open
'';
browser = "${pkgs.handlr-xdg}/bin/xdg-open";
maxItems = 50;
autoReload = true;

View File

@@ -1,5 +1,11 @@
{ pkgs, config, inputs, device, ... }: {
imports = [ inputs.nixneovim.nixosModules.default ];
{
pkgs,
config,
inputs,
device,
...
}: {
imports = [inputs.nixneovim.nixosModules.default];
programs.nixneovim = {
enable = true;
extraPlugins = with pkgs.vimPlugins; [
@@ -80,7 +86,9 @@
undofile = true;
};
globals = { mapleader = " "; };
globals = {
mapleader = " ";
};
plugins = {
lspconfig = {
enable = true;
@@ -89,12 +97,14 @@
nil = {
enable = true;
extraConfig =
/* lua */
# lua
''
settings = {
['nil'] = {
formatting = {
command = { "${pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt" },
-- command = { "$\{pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt" },
-- command = { "$\{pkgs.nixfmt}/bin/nixfmt" },
command = { "${pkgs.alejandra}/bin/alejandra" },
},
nix = {
flake = {
@@ -113,7 +123,7 @@
sqls = {
enable = true;
onAttachExtra =
/* lua */
# lua
''
require('sqls').on_attach(client, bufnr)
'';
@@ -121,7 +131,7 @@
# rust-analyzer.enable = true;
};
extraLua.pre =
/* lua */
# lua
''
local lsp_zero = require'lsp-zero'
local lspconfig = require 'lspconfig'
@@ -163,7 +173,10 @@
enable = true;
};
};
grammars = with pkgs.tree-sitter-grammars; [ tree-sitter-just tree-sitter-norg-meta ];
grammars = with pkgs.tree-sitter-grammars; [
tree-sitter-just
tree-sitter-norg-meta
];
installAllGrammars = true;
};
@@ -174,7 +187,6 @@
# cursorword.enable = true;
starter.enable = true;
};
};
colorschemes = {
catppuccin = {
@@ -221,18 +233,21 @@
};
};
extraConfigLua =
let
codelldb = if device.isLinux then pkgs.vscode-extensions.vadimcn.vscode-lldb.adapter else null;
liblldb =
if device.isLinux then
"${codelldb}/lldb/lib/liblldb.so"
# else if device.isMac then
# "${codelldb}/lldb/lib/liblldb.dylib"
else null
;
in
/* lua */
extraConfigLua = let
codelldb =
if device.isLinux
then pkgs.vscode-extensions.vadimcn.vscode-lldb.adapter
else null;
liblldb =
if device.isLinux
then "${codelldb}/lldb/lib/liblldb.so"
# else if device.isMac then
# "${codelldb}/lldb/lib/liblldb.dylib"
else null;
in
/*
lua
*/
''
require'neotest'.setup({
adapters = {
@@ -276,7 +291,7 @@
vim.lsp.inlay_hint.enable(bufnr, true)
end
end,
settings = function(project_root)
settings = function(project_root)
local ra = require('rustaceanvim.config.server')
return ra.load_rust_analyzer_settings(project_root, {
settings_file_pattern = 'rust-analyzer.json'
@@ -286,9 +301,8 @@
dap = {
autoload_configurations = false,
${pkgs.lib.optionalString device.isLinux ''
adapter = require'rustaceanvim.config'.get_codelldb_adapter("${codelldb}/bin/codelldb", "${liblldb}")
''
}
adapter = require'rustaceanvim.config'.get_codelldb_adapter("${codelldb}/bin/codelldb", "${liblldb}")
''}
},
}
@@ -441,4 +455,3 @@
package = pkgs.neovim-nightly;
};
}

View File

@@ -1,5 +1,4 @@
{ pkgs, ... }:
let
{pkgs, ...}: let
scratchpad = pkgs.writeShellScript "scratchpad" ''
width=''${2:-95%}
height=''${2:-95%}

View File

@@ -1,5 +1,5 @@
{ ... }: {
imports = [ ../modules/tuifeed.nix ];
{...}: {
imports = [../modules/tuifeed.nix];
programs.tuifeed = {
enable = false;
config = {
@@ -10,5 +10,4 @@
};
};
};
}

View File

@@ -1,8 +1,10 @@
{ pkgs, ... }: {
{pkgs, ...}: {
programs.wezterm = {
enable = true;
extraConfig =
/* lua */
/*
lua
*/
''
local wezterm = require 'wezterm';
return {