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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -2,16 +2,18 @@
pkgs,
config,
...
}: {
}:
{
programs.tmux = {
enable = true;
rose-pine = {
enable = true;
extraConfig = ''
set -g @rose_pine_host 'on'
set -g @rose_pine_directory 'on'
'';
extraConfig = # tmux
''
set -g @rose_pine_host 'on'
set -g @rose_pine_directory 'on'
'';
};
escapeTime = 0;
@ -33,27 +35,30 @@
plugins = with pkgs.tmuxPlugins; [
{
plugin = resurrect;
extraConfig = ''
set -g @resurrect-capture-pane-contents 'on'
'';
extraConfig = # tmux
''
set -g @resurrect-capture-pane-contents 'on'
'';
}
{
plugin = continuum;
extraConfig = ''
set -g @continuum-restore 'on'
'';
extraConfig = # tmux
''
set -g @continuum-restore 'on'
'';
}
{
plugin = tilish;
extraConfig = ''
# Don't enforce the layout.
set -g @tilish-enforce 'none'
extraConfig = # tmux
''
# Don't enforce the layout.
set -g @tilish-enforce 'none'
set -g @tilish-project "$HOME/hackin"
set -g @tilish-navigator 'on'
'';
set -g @tilish-project "$HOME/hackin"
set -g @tilish-navigator 'on'
'';
}
{
@ -64,74 +69,78 @@
{
plugin = jump;
extraConfig = ''
set -g @jump-key 's'
'';
extraConfig = # tmux
''
set -g @jump-key 's'
'';
}
{
plugin = fingers;
extraConfig = ''
set -g @fingers-jump-key 's'
'';
extraConfig = # tmux
''
set -g @fingers-jump-key 's'
'';
}
{
plugin = tmux-floax;
extraConfig = ''
set -g @floax-bind 'i'
'';
extraConfig = # tmux
''
set -g @floax-bind 'i'
'';
}
];
extraConfig = ''
# Set repeat timeout so keys can be repeated without the prefix.
set -g repeat-time 1000
extraConfig = # tmux
''
# Set repeat timeout so keys can be repeated without the prefix.
set -g repeat-time 1000
# Auto-renumber windows when one is deleted.
set -g renumber-windows 'on'
# Auto-renumber windows when one is deleted.
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.
bind r source-file ${config.xdg.configHome}/tmux/tmux.conf \; display-message "Reloaded config"
# Easy reload config.
bind r source-file ${config.xdg.configHome}/tmux/tmux.conf \; display-message "Reloaded config"
# 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 'hsplit' - split-window -v -c "#{pane_current_path}"
unbind '"'
unbind %
# 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 'hsplit' - split-window -v -c "#{pane_current_path}"
unbind '"'
unbind %
# Vi-like resizing.
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 (up)' M-k resize-pane -U 5
bind -r -N 'Resize pane (right)' M-l resize-pane -R 5
# Vi-like resizing.
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 (up)' M-k resize-pane -U 5
bind -r -N 'Resize pane (right)' M-l resize-pane -R 5
# Even out panes.
bind -N 'Evenly distribute panes' = select-layout -E
# Even out panes.
bind -N 'Evenly distribute panes' = select-layout -E
# Swap panes.
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
# Swap panes.
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
# Window switching.
bind -N 'Previous window' Left previous-window
bind -N 'Next window' Right next-window
# Window switching.
bind -N 'Previous window' Left previous-window
bind -N 'Next window' Right next-window
# Vi copy mode.
unbind [
bind -N 'Enter normal (copy) mode' Escape copy-mode
# Vi copy mode.
unbind [
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-forward %1'
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 ? 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 q 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 = {
enable = true;

View file

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

View file

@ -1,27 +1,30 @@
{config, ...}: {
{ config, ... }:
{
home.preferXdgDirectories = true;
xdg = let
homeDir = config.home.homeDirectory;
in {
enable = true;
cacheHome = "${homeDir}/.cache";
configHome = "${homeDir}/.config";
dataHome = "${homeDir}/.local/share";
stateHome = "${homeDir}/.local/state";
userDirs = {
xdg =
let
homeDir = config.home.homeDirectory;
in
{
enable = true;
createDirectories = true;
desktop = "${homeDir}/desktop";
documents = null;
download = "${homeDir}/downloads";
music = null;
pictures = "${homeDir}/pictures";
templates = null;
videos = "${homeDir}/videos";
cacheHome = "${homeDir}/.cache";
configHome = "${homeDir}/.config";
dataHome = "${homeDir}/.local/share";
stateHome = "${homeDir}/.local/state";
userDirs = {
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 = {
enable = true;
numlock.enable = true;
# TODO: Switch to autorandr
profileExtra = ''
sudo mount -a
"$HOME/.config/xrandr/desktop.sh"
copyq &
mpd &
pidgin &
'';
profileExtra = # sh
''
sudo mount -a
"$HOME/.config/xrandr/desktop.sh"
copyq &
mpd &
pidgin &
'';
};
}

View file

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

View file

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