🎨 style(fmt): Switch to nixfmt; add treesitter hints

Switch to nixfmt as when I was adding treesitter injected lang hints,
Alejandra was not formatting those comments in a way I liked. Turns out
I like the nixfmt style in general better.
This commit is contained in:
punkfairie 2024-11-02 15:35:48 -07:00
parent 2b9fdf0629
commit 5bffc52df8
22 changed files with 183 additions and 148 deletions

View file

@ -9,32 +9,28 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
alejandra = {
url = "github:kamadorueda/alejandra/3.0.0";
inputs.nixpkgs.follows = "nixpkgs";
};
rose-pine.url = "git+https://git.punkfairie.net/punkfairie/rose-pine-nix"; rose-pine.url = "git+https://git.punkfairie.net/punkfairie/rose-pine-nix";
}; };
outputs = { outputs =
nixpkgs, {
home-manager, nixpkgs,
... home-manager,
} @ inputs: { ...
homeConfigurations."marley" = let }@inputs:
system = "x86_64-linux"; {
pkgs = nixpkgs.legacyPackages.${system}; homeConfigurations."marley" =
in let
home-manager.lib.homeManagerConfiguration { system = "x86_64-linux";
inherit pkgs; pkgs = nixpkgs.legacyPackages.${system};
in
home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {inherit system inputs;}; modules = [
./home
modules = [ inputs.rose-pine.homeManagerModules.rose-pine
./home ];
inputs.rose-pine.homeManagerModules.rose-pine };
]; };
};
};
} }

View file

@ -3,7 +3,8 @@
config, config,
lib, lib,
... ...
}: { }:
{
programs.bat = { programs.bat = {
enable = true; enable = true;
@ -27,12 +28,14 @@
functions = { functions = {
cat = { cat = {
wraps = "bat"; wraps = "bat";
body = "bat $argv"; body = # fish
"bat $argv";
}; };
cath = { cath = {
wraps = "bat"; wraps = "bat";
body = "bat --plain --language=help $argv"; body = # fish
"bat --plain --language=help $argv";
}; };
}; };
@ -40,22 +43,26 @@
B = { B = {
position = "anywhere"; position = "anywhere";
setCursor = true; setCursor = true;
expansion = "% | bat"; expansion = # fish
"% | bat";
}; };
"-h" = { "-h" = {
position = "anywhere"; position = "anywhere";
expansion = "-h | cath"; expansion = # fish
"-h | cath";
}; };
"--help" = { "--help" = {
position = "anywhere"; position = "anywhere";
expansion = "--help | cath"; expansion = # fish
"--help | cath";
}; };
help = { help = {
position = "anywhere"; position = "anywhere";
expansion = "help | cath"; expansion = # fish
"help | cath";
}; };
}; };
}; };

View file

@ -1,4 +1,5 @@
{...}: { { ... }:
{
programs.btop = { programs.btop = {
enable = true; enable = true;

View file

@ -1,4 +1,5 @@
{...}: { { ... }:
{
programs.cava = { programs.cava = {
enable = true; enable = true;

View file

@ -1,4 +1,5 @@
{pkgs, ...}: { { pkgs, ... }:
{
home.packages = with pkgs; [ home.packages = with pkgs; [
curl curl
]; ];

View file

@ -1,9 +1,8 @@
{ {
system,
pkgs, pkgs,
inputs,
... ...
}: { }:
{
home.username = "marley"; home.username = "marley";
home.homeDirectory = "/home/marley"; home.homeDirectory = "/home/marley";
@ -13,7 +12,10 @@
nix.package = pkgs.nix; nix.package = pkgs.nix;
# Enable flakes. # Enable flakes.
nix.settings.experimental-features = ["nix-command" "flakes"]; nix.settings.experimental-features = [
"nix-command"
"flakes"
];
targets.genericLinux.enable = true; targets.genericLinux.enable = true;
@ -21,7 +23,7 @@
systemd.user.startServices = true; systemd.user.startServices = true;
home.packages = with pkgs; [ home.packages = with pkgs; [
inputs.alejandra.defaultPackage.${system} nixfmt-rfc-style
nil nil
just just
maple-mono-NF maple-mono-NF

View file

@ -1,4 +1,5 @@
{...}: { { ... }:
{
programs.eza = { programs.eza = {
enable = true; enable = true;

View file

@ -1,4 +1,5 @@
{pkgs, ...}: { { pkgs, ... }:
{
home.packages = with pkgs; [ home.packages = with pkgs; [
babelfish babelfish
]; ];

View file

@ -1,4 +1,5 @@
{...}: { { ... }:
{
programs.gh = { programs.gh = {
enable = true; enable = true;
gitCredentialHelper.enable = true; gitCredentialHelper.enable = true;

View file

@ -1,4 +1,5 @@
{pkgs, ...}: { { pkgs, ... }:
{
# TODO: Switch to fastfetch # TODO: Switch to fastfetch
home.packages = with pkgs; [ home.packages = with pkgs; [
neofetch neofetch
@ -19,13 +20,13 @@
lightness = 0.7; lightness = 0.7;
color_align = { color_align = {
mode = "horizontal"; mode = "horizontal";
custom_colors = []; custom_colors = [ ];
fore_back = null; fore_back = null;
}; };
backend = "neofetch"; backend = "neofetch";
args = null; args = null;
distro = null; distro = null;
pride_month_shown = []; pride_month_shown = [ ];
pride_month_disable = false; pride_month_disable = false;
}; };
}; };

View file

@ -1,4 +1,5 @@
{...}: { { ... }:
{
programs.lazygit = { programs.lazygit = {
enable = true; enable = true;

View file

@ -1,4 +1,5 @@
{...}: { { ... }:
{
programs.less.enable = true; programs.less.enable = true;
home.sessionVariables = { home.sessionVariables = {

View file

@ -1,4 +1,5 @@
{...}: { { ... }:
{
programs.man.enable = true; programs.man.enable = true;
home.sessionVariables = { home.sessionVariables = {

View file

@ -1,4 +1,5 @@
{...}: { { ... }:
{
nixpkgs.overlays = [ nixpkgs.overlays = [
(final: prev: { (final: prev: {
ncmpcpp = prev.ncmpcpp.override { ncmpcpp = prev.ncmpcpp.override {

View file

@ -1,4 +1,5 @@
{pkgs, ...}: { { pkgs, ... }:
{
services.syncthing = { services.syncthing = {
enable = true; enable = true;

View file

@ -2,16 +2,18 @@
pkgs, pkgs,
config, config,
... ...
}: { }:
{
programs.tmux = { programs.tmux = {
enable = true; enable = true;
rose-pine = { rose-pine = {
enable = true; enable = true;
extraConfig = '' extraConfig = # tmux
set -g @rose_pine_host 'on' ''
set -g @rose_pine_directory 'on' set -g @rose_pine_host 'on'
''; set -g @rose_pine_directory 'on'
'';
}; };
escapeTime = 0; escapeTime = 0;
@ -33,27 +35,30 @@
plugins = with pkgs.tmuxPlugins; [ plugins = with pkgs.tmuxPlugins; [
{ {
plugin = resurrect; plugin = resurrect;
extraConfig = '' extraConfig = # tmux
set -g @resurrect-capture-pane-contents 'on' ''
''; set -g @resurrect-capture-pane-contents 'on'
'';
} }
{ {
plugin = continuum; plugin = continuum;
extraConfig = '' extraConfig = # tmux
set -g @continuum-restore 'on' ''
''; set -g @continuum-restore 'on'
'';
} }
{ {
plugin = tilish; plugin = tilish;
extraConfig = '' extraConfig = # tmux
# Don't enforce the layout. ''
set -g @tilish-enforce 'none' # Don't enforce the layout.
set -g @tilish-enforce 'none'
set -g @tilish-project "$HOME/hackin" set -g @tilish-project "$HOME/hackin"
set -g @tilish-navigator 'on' set -g @tilish-navigator 'on'
''; '';
} }
{ {
@ -64,74 +69,78 @@
{ {
plugin = jump; plugin = jump;
extraConfig = '' extraConfig = # tmux
set -g @jump-key 's' ''
''; set -g @jump-key 's'
'';
} }
{ {
plugin = fingers; plugin = fingers;
extraConfig = '' extraConfig = # tmux
set -g @fingers-jump-key 's' ''
''; set -g @fingers-jump-key 's'
'';
} }
{ {
plugin = tmux-floax; plugin = tmux-floax;
extraConfig = '' extraConfig = # tmux
set -g @floax-bind 'i' ''
''; set -g @floax-bind 'i'
'';
} }
]; ];
extraConfig = '' extraConfig = # tmux
# Set repeat timeout so keys can be repeated without the prefix. ''
set -g repeat-time 1000 # Set repeat timeout so keys can be repeated without the prefix.
set -g repeat-time 1000
# Auto-renumber windows when one is deleted. # Auto-renumber windows when one is deleted.
set -g renumber-windows 'on' set -g renumber-windows 'on'
set -ag terminal-overrides ",*:RGB" set -ag terminal-overrides ",*:RGB"
set -g status-position 'top' set -g status-position 'top'
### Keybindings ### ### Keybindings ###
# Easy reload config. # Easy reload config.
bind r source-file ${config.xdg.configHome}/tmux/tmux.conf \; display-message "Reloaded config" bind r source-file ${config.xdg.configHome}/tmux/tmux.conf \; display-message "Reloaded config"
# Better split commands. # Better split commands.
bind -N 'vsplit' | split-window -h -c "#{pane_current_path}" bind -N 'vsplit' | split-window -h -c "#{pane_current_path}"
bind -N 'vsplit' \\ split-window -h -c "#{pane_current_path}" bind -N 'vsplit' \\ split-window -h -c "#{pane_current_path}"
bind -N 'hsplit' - split-window -v -c "#{pane_current_path}" bind -N 'hsplit' - split-window -v -c "#{pane_current_path}"
unbind '"' unbind '"'
unbind % unbind %
# Vi-like resizing. # Vi-like resizing.
bind -r -N 'Resize pane (left)' M-h resize-pane -L 5 bind -r -N 'Resize pane (left)' M-h resize-pane -L 5
bind -r -N 'Resize pane (down)' M-j resize-pane -D 5 bind -r -N 'Resize pane (down)' M-j resize-pane -D 5
bind -r -N 'Resize pane (up)' M-k resize-pane -U 5 bind -r -N 'Resize pane (up)' M-k resize-pane -U 5
bind -r -N 'Resize pane (right)' M-l resize-pane -R 5 bind -r -N 'Resize pane (right)' M-l resize-pane -R 5
# Even out panes. # Even out panes.
bind -N 'Evenly distribute panes' = select-layout -E bind -N 'Evenly distribute panes' = select-layout -E
# Swap panes. # Swap panes.
bind -r -N 'Swap current pane with the next' H swap-pane -U bind -r -N 'Swap current pane with the next' H swap-pane -U
bind -r -N 'Swap current pane with the previous' L swap-pane -D bind -r -N 'Swap current pane with the previous' L swap-pane -D
# Window switching. # Window switching.
bind -N 'Previous window' Left previous-window bind -N 'Previous window' Left previous-window
bind -N 'Next window' Right next-window bind -N 'Next window' Right next-window
# Vi copy mode. # Vi copy mode.
unbind [ unbind [
bind -N 'Enter normal (copy) mode' Escape copy-mode bind -N 'Enter normal (copy) mode' Escape copy-mode
bind -T copy-mode-vi ? command-prompt -p '?' 'send -X search-backward %1' bind -T copy-mode-vi ? command-prompt -p '?' 'send -X search-backward %1'
bind -T copy-mode-vi / command-prompt -p '/' 'send -X search-forward %1' bind -T copy-mode-vi / command-prompt -p '/' 'send -X search-forward %1'
bind -T copy-mode-vi q send -X cancel bind -T copy-mode-vi q send -X cancel
bind -T copy-mode-vi Escape if-shell -F '#{selection_present}' 'send -X clear-selection' 'send -X cancel' bind -T copy-mode-vi Escape if-shell -F '#{selection_present}' 'send -X clear-selection' 'send -X cancel'
''; '';
}; };
} }

View file

@ -1,4 +1,5 @@
{...}: { { ... }:
{
programs.topgrade = { programs.topgrade = {
enable = true; enable = true;

View file

@ -3,7 +3,8 @@
lib, lib,
config, config,
... ...
}: { }:
{
home.packages = with pkgs; [ home.packages = with pkgs; [
wget wget
]; ];

View file

@ -1,27 +1,30 @@
{config, ...}: { { config, ... }:
{
home.preferXdgDirectories = true; home.preferXdgDirectories = true;
xdg = let xdg =
homeDir = config.home.homeDirectory; let
in { homeDir = config.home.homeDirectory;
enable = true; in
{
cacheHome = "${homeDir}/.cache";
configHome = "${homeDir}/.config";
dataHome = "${homeDir}/.local/share";
stateHome = "${homeDir}/.local/state";
userDirs = {
enable = true; enable = true;
createDirectories = true;
desktop = "${homeDir}/desktop"; cacheHome = "${homeDir}/.cache";
documents = null; configHome = "${homeDir}/.config";
download = "${homeDir}/downloads"; dataHome = "${homeDir}/.local/share";
music = null; stateHome = "${homeDir}/.local/state";
pictures = "${homeDir}/pictures";
templates = null; userDirs = {
videos = "${homeDir}/videos"; enable = true;
createDirectories = true;
desktop = "${homeDir}/desktop";
documents = null;
download = "${homeDir}/downloads";
music = null;
pictures = "${homeDir}/pictures";
templates = null;
videos = "${homeDir}/videos";
};
}; };
};
} }

View file

@ -1,17 +1,19 @@
{...}: { { ... }:
home.keyboard.options = ["apple:alupckeys"]; {
home.keyboard.options = [ "apple:alupckeys" ];
xsession = { xsession = {
enable = true; enable = true;
numlock.enable = true; numlock.enable = true;
# TODO: Switch to autorandr # TODO: Switch to autorandr
profileExtra = '' profileExtra = # sh
sudo mount -a ''
"$HOME/.config/xrandr/desktop.sh" sudo mount -a
copyq & "$HOME/.config/xrandr/desktop.sh"
mpd & copyq &
pidgin & mpd &
''; pidgin &
'';
}; };
} }

View file

@ -1,4 +1,5 @@
{...}: { { ... }:
{
programs.zathura = { programs.zathura = {
enable = true; enable = true;

View file

@ -1,7 +1,8 @@
{...}: { { ... }:
{
programs.zoxide = { programs.zoxide = {
enable = true; enable = true;
options = ["--cmd cd"]; options = [ "--cmd cd" ];
}; };
} }