🎨 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,28 +9,24 @@
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, nixpkgs,
home-manager, home-manager,
... ...
} @ inputs: { }@inputs:
homeConfigurations."marley" = let {
homeConfigurations."marley" =
let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
in in
home-manager.lib.homeManagerConfiguration { home-manager.lib.homeManagerConfiguration {
inherit pkgs; inherit pkgs;
extraSpecialArgs = {inherit system inputs;};
modules = [ modules = [
./home ./home
inputs.rose-pine.homeManagerModules.rose-pine 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

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,13 +2,15 @@
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_host 'on'
set -g @rose_pine_directory 'on' set -g @rose_pine_directory 'on'
''; '';
@ -33,21 +35,24 @@
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. # Don't enforce the layout.
set -g @tilish-enforce 'none' set -g @tilish-enforce 'none'
@ -64,27 +69,31 @@
{ {
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 repeat timeout so keys can be repeated without the prefix.
set -g repeat-time 1000 set -g repeat-time 1000

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,9 +1,12 @@
{config, ...}: { { config, ... }:
{
home.preferXdgDirectories = true; home.preferXdgDirectories = true;
xdg = let xdg =
let
homeDir = config.home.homeDirectory; homeDir = config.home.homeDirectory;
in { in
{
enable = true; enable = true;
cacheHome = "${homeDir}/.cache"; cacheHome = "${homeDir}/.cache";

View file

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

View file

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

View file

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