Formatting with nixfmt-rfc-style and setup nixd language server

This commit is contained in:
Daniel Flanagan 2025-02-14 13:20:17 -06:00
parent 7915f78ee3
commit 8e8a483e97
7 changed files with 1903 additions and 1796 deletions

9
.helix/languages.toml Normal file
View file

@ -0,0 +1,9 @@
[[language]]
auto-format = true
file-types = ["nix"]
name = "nix"
scope = "source.nix"
[language.formatter]
args = ["-"]
command = "nixfmt"

View file

@ -1,9 +1,12 @@
{ {
outputs = inputs: let outputs =
inputs:
let
lib = import ./lib inputs; lib = import ./lib inputs;
uGenPkgs = lib.genPkgs inputs.nixpkgs-unstable;
in in
{ {
packages = lib.genPkgs inputs.nixpkgs-unstable (import ./packages); packages = uGenPkgs (import ./packages);
nixosConfigurations = import ./packages/hosts inputs; nixosConfigurations = import ./packages/hosts inputs;
# homeConfigurations = import ./packages/users; # homeConfigurations = import ./packages/users;
@ -11,15 +14,15 @@
templates = import ./lib/templates; templates = import ./lib/templates;
diskoConfigurations = import ./lib/disko inputs; diskoConfigurations = import ./lib/disko inputs;
checks = import ./packages/checks; checks = uGenPkgs (import ./packages/checks inputs);
devShells = import ./packages/shells; devShells = uGenPkgs (import ./packages/shells inputs);
nixosModules = import ./lib/modules/nixos inputs; nixosModules = import ./lib/modules/nixos inputs;
homeManagerModules = import ./lib/modules/home inputs; homeManagerModules = import ./lib/modules/home inputs;
# overlays = import ./lib/overlays inputs; # overlays = import ./lib/overlays inputs;
formatter = lib.genPkgs inputs.nixpkgs-unstable (p: p.nixfmt-rfc-style); formatter = uGenPkgs (p: p.nixfmt-rfc-style);
/* /*
TODO: nix-on-droid for phone terminal usage? mobile-nixos? TODO: nix-on-droid for phone terminal usage? mobile-nixos?
@ -27,7 +30,10 @@
TODO: nixos ISO? TODO: nixos ISO?
*/ */
} }
// (import ./nix/constants.nix inputs); // (import ./nix/constants.nix inputs)
// {
flakeLib = lib;
};
inputs = { inputs = {
# stable inputs # stable inputs
@ -75,7 +81,10 @@
}; };
nixConfig = { nixConfig = {
extra-experimental-features = ["nix-command" "flakes"]; extra-experimental-features = [
"nix-command"
"flakes"
];
extra-substituters = [ extra-substituters = [
"https://cache.nixos.org/" "https://cache.nixos.org/"

View file

@ -1,8 +1,10 @@
{self, ...}: let { self, ... }:
let
inherit (self) outputs; inherit (self) outputs;
inherit (outputs) homeManagerModules constants; inherit (outputs) homeManagerModules constants;
inherit (constants) style; inherit (constants) style;
in { in
{
bat = { bat = {
programs.bat = { programs.bat = {
enable = true; enable = true;
@ -28,19 +30,24 @@ in {
}; };
}; };
eww = {config, ...}: { eww =
{ config, ... }:
{
# programs.eww = { # programs.eww = {
# enable = true; # enable = true;
# }; # };
home.file.".config/eww".source = config.lib.file.mkOutOfStoreSymlink /etc/nixos/flake/modules/home-manager/eww; home.file.".config/eww".source =
config.lib.file.mkOutOfStoreSymlink /etc/nixos/flake/modules/home-manager/eww;
}; };
mako = { mako =
{
config, config,
pkgs, pkgs,
... ...
}: { }:
{
services.mako = { services.mako = {
enable = true; enable = true;
extraConfig = with style.colors.withHashPrefix; '' extraConfig = with style.colors.withHashPrefix; ''
@ -73,11 +80,13 @@ in {
}; };
}; };
tofi = { tofi =
{
config, config,
pkgs, pkgs,
... ...
}: { }:
{
programs.tofi = { programs.tofi = {
enable = true; enable = true;
settings = { settings = {
@ -98,16 +107,20 @@ in {
}; };
}; };
broot = {}; broot = { };
emacs = {pkgs, ...}: { emacs =
{ pkgs, ... }:
{
programs.emacs = { programs.emacs = {
enable = false; enable = false;
/* /*
extraConfig = '' extraConfig = ''
''; '';
*/ */
extraPackages = epkgs: (with epkgs; [ extraPackages =
epkgs:
(with epkgs; [
magit magit
]); ]);
}; };
@ -119,7 +132,9 @@ in {
}; };
}; };
cargo = {config, ...}: { cargo =
{ config, ... }:
{
home.file."${config.home.homeDirectory}/.cargo/config.toml" = { home.file."${config.home.homeDirectory}/.cargo/config.toml" = {
enable = true; enable = true;
text = '' text = ''
@ -135,12 +150,14 @@ in {
*/ */
}; };
common = { common =
{
pkgs, pkgs,
lib, lib,
config, config,
... ...
}: { }:
{
imports = with homeManagerModules; [ imports = with homeManagerModules; [
# nix-colors.homeManagerModules.default # nix-colors.homeManagerModules.default
fish fish
@ -179,12 +196,11 @@ in {
packages = with pkgs; [ packages = with pkgs; [
# tools I use when editing nix code # tools I use when editing nix code
# kanidm # kanidm
nil
alejandra alejandra
gnupg gnupg
(pkgs.buildEnv { (pkgs.buildEnv {
name = "my-common-scripts"; name = "my-common-scripts";
paths = [./scripts/common]; paths = [ ./scripts/common ];
}) })
]; ];
}; };
@ -198,7 +214,11 @@ in {
# https://github.com/lotabout/skim/issues/494 # https://github.com/lotabout/skim/issues/494
enable = false; enable = false;
enableFishIntegration = true; enableFishIntegration = true;
defaultOptions = ["--no-clear-start" "--color=16" "--height=20"]; defaultOptions = [
"--no-clear-start"
"--color=16"
"--height=20"
];
}; };
programs.atuin = { programs.atuin = {
@ -260,7 +280,9 @@ in {
# ewwbar = {}; # ewwbar = {};
firefox = {pkgs, ...}: { firefox =
{ pkgs, ... }:
{
programs.firefox = { programs.firefox = {
/* /*
TODO: this should be able to work on macos, no? TODO: this should be able to work on macos, no?
@ -325,7 +347,9 @@ in {
}; };
}; };
fish = {pkgs, ...}: { fish =
{ pkgs, ... }:
{
home = { home = {
packages = [ packages = [
pkgs.gawk # used in prompt pkgs.gawk # used in prompt
@ -376,7 +400,7 @@ in {
has_command = "command --quiet --search $argv[1]"; has_command = "command --quiet --search $argv[1]";
}; };
shellAbbrs = {}; shellAbbrs = { };
shellAliases = { shellAliases = {
# TODO: an alias that wraps `rm` such that if we run it without git committing first (when in a git repo) # TODO: an alias that wraps `rm` such that if we run it without git committing first (when in a git repo)
ls = "eza --group-directories-first --classify"; ls = "eza --group-directories-first --classify";
@ -416,7 +440,9 @@ in {
}; };
}; };
jujutsu = {...}: { jujutsu =
{ ... }:
{
programs.jujutsu = { programs.jujutsu = {
enable = true; enable = true;
settings = { settings = {
@ -428,9 +454,12 @@ in {
}; };
}; };
git = {lib, ...}: let git =
{ lib, ... }:
let
email = lib.mkDefault "daniel@lyte.dev"; email = lib.mkDefault "daniel@lyte.dev";
in { in
{
programs.git = { programs.git = {
enable = true; enable = true;
@ -439,7 +468,7 @@ in {
delta = { delta = {
enable = true; enable = true;
options = {}; options = { };
}; };
lfs = { lfs = {
@ -548,13 +577,15 @@ in {
}; };
}; };
gnome = {pkgs, ...}: { gnome =
{ pkgs, ... }:
{
dconf = { dconf = {
enable = true; enable = true;
settings = { settings = {
"org/gnome/settings-daemon/plugins/media-keys" = { "org/gnome/settings-daemon/plugins/media-keys" = {
screensaver = ["<Shift><Control><Super>l"]; # lock screen screensaver = [ "<Shift><Control><Super>l" ]; # lock screen
mic-mute = ["<Shift><Super>v"]; mic-mute = [ "<Shift><Super>v" ];
}; };
"org/gnome/desktop/peripherals/keyboard" = { "org/gnome/desktop/peripherals/keyboard" = {
@ -567,12 +598,12 @@ in {
# mouse-button-modifier = '<Super>'; # default # mouse-button-modifier = '<Super>'; # default
}; };
"org/gnome/desktop/wm/keybindings" = { "org/gnome/desktop/wm/keybindings" = {
minimize = ["<Shift><Control><Super>h"]; minimize = [ "<Shift><Control><Super>h" ];
show-desktop = ["<Super>d"]; show-desktop = [ "<Super>d" ];
move-to-workspace-left = ["<Super><Shift>h"]; move-to-workspace-left = [ "<Super><Shift>h" ];
move-to-workspace-right = ["<Super><Shift>l"]; move-to-workspace-right = [ "<Super><Shift>l" ];
switch-to-workspace-left = ["<Super><Control>h"]; switch-to-workspace-left = [ "<Super><Control>h" ];
switch-to-workspace-right = ["<Super><Control>l"]; switch-to-workspace-right = [ "<Super><Control>l" ];
# mouse-button-modifier = '<Super>'; # default # mouse-button-modifier = '<Super>'; # default
}; };
"org/gnome/desktop/interface" = { "org/gnome/desktop/interface" = {
@ -584,7 +615,7 @@ in {
# scaling-factor = 1.75; # scaling-factor = 1.75;
}; };
"org/gnome/mutter" = { "org/gnome/mutter" = {
experimental-features = ["variable-refresh-rate"]; experimental-features = [ "variable-refresh-rate" ];
}; };
"org/gnome/shell" = { "org/gnome/shell" = {
@ -601,10 +632,10 @@ in {
outer-gaps = 8; outer-gaps = 8;
window-border-width = 2; window-border-width = 2;
window-border-color = "rgba(116,199,236,0.47)"; window-border-color = "rgba(116,199,236,0.47)";
focus-window-right = ["<Super>l"]; focus-window-right = [ "<Super>l" ];
focus-window-left = ["<Super>h"]; focus-window-left = [ "<Super>h" ];
focus-window-up = ["<Super>k"]; focus-window-up = [ "<Super>k" ];
focus-window-down = ["<Super>j"]; focus-window-down = [ "<Super>j" ];
}; };
}; };
}; };
@ -617,19 +648,21 @@ in {
programs.gnome-shell = { programs.gnome-shell = {
enable = true; enable = true;
extensions = [{package = pkgs.gnomeExtensions.gsconnect;}]; extensions = [ { package = pkgs.gnomeExtensions.gsconnect; } ];
}; };
programs.firefox.package = pkgs.firefox.override { programs.firefox.package = pkgs.firefox.override {
nativeMessagingHosts = with pkgs; [bitwarden]; nativeMessagingHosts = with pkgs; [ bitwarden ];
}; };
}; };
helix = { helix =
{
config, config,
pkgs, pkgs,
... ...
}: { }:
{
# helix rust debugger stuff # helix rust debugger stuff
# https://github.com/helix-editor/helix/wiki/Debugger-Configurations # https://github.com/helix-editor/helix/wiki/Debugger-Configurations
home.file."${config.xdg.configHome}/lldb_vscode_rustc_primer.py" = { home.file."${config.xdg.configHome}/lldb_vscode_rustc_primer.py" = {
@ -663,7 +696,7 @@ in {
language-server = { language-server = {
lexical = { lexical = {
command = "lexical"; command = "lexical";
args = ["start"]; args = [ "start" ];
}; };
/* /*
@ -724,7 +757,7 @@ in {
]; ];
args = { args = {
program = "{0}"; program = "{0}";
initCommands = ["command script import ${config.xdg.configHome}/lldb_vscode_rustc_primer.py"]; initCommands = [ "command script import ${config.xdg.configHome}/lldb_vscode_rustc_primer.py" ];
}; };
} }
]; ];
@ -732,23 +765,23 @@ in {
} }
{ {
name = "html"; name = "html";
file-types = ["html"]; file-types = [ "html" ];
scope = "source.html"; scope = "source.html";
auto-format = false; auto-format = false;
} }
{ {
name = "nix"; name = "nix";
file-types = ["nix"]; file-types = [ "nix" ];
scope = "source.nix"; scope = "source.nix";
auto-format = true; auto-format = true;
formatter = { formatter = {
command = "alejandra"; command = "alejandra";
args = ["-"]; args = [ "-" ];
}; };
} }
{ {
name = "fish"; name = "fish";
file-types = ["fish"]; file-types = [ "fish" ];
scope = "source.fish"; scope = "source.fish";
auto-format = true; auto-format = true;
indent = { indent = {
@ -758,7 +791,7 @@ in {
} }
{ {
name = "toml"; name = "toml";
file-types = ["toml"]; file-types = [ "toml" ];
scope = "source.toml"; scope = "source.toml";
auto-format = true; auto-format = true;
} }
@ -834,7 +867,10 @@ in {
soft-wrap.enable = true; soft-wrap.enable = true;
auto-pairs = false; auto-pairs = false;
bufferline = "multiple"; bufferline = "multiple";
rulers = [81 121]; rulers = [
81
121
];
cursorline = true; cursorline = true;
/* /*
@ -944,13 +980,13 @@ in {
"comment" = { "comment" = {
fg = fgdim; fg = fgdim;
modifiers = ["italic"]; modifiers = [ "italic" ];
}; };
"variable" = text; "variable" = text;
"variable.parameter" = { "variable.parameter" = {
fg = red; fg = red;
modifiers = ["italic"]; modifiers = [ "italic" ];
}; };
"variable.builtin" = red; "variable.builtin" = red;
"variable.other.member" = text; "variable.other.member" = text;
@ -964,7 +1000,7 @@ in {
"keyword.storage.modifier.ref" = yellow; "keyword.storage.modifier.ref" = yellow;
"keyword.control.conditional" = { "keyword.control.conditional" = {
fg = purple; fg = purple;
modifiers = ["italic"]; modifiers = [ "italic" ];
}; };
"operator" = blue; "operator" = blue;
@ -977,14 +1013,14 @@ in {
"namespace" = { "namespace" = {
fg = blue; fg = blue;
modifiers = ["italic"]; modifiers = [ "italic" ];
}; };
"special" = blue; "special" = blue;
"markup.heading.marker" = { "markup.heading.marker" = {
fg = orange; fg = orange;
modifiers = ["bold"]; modifiers = [ "bold" ];
}; };
"markup.heading.1" = blue; "markup.heading.1" = blue;
"markup.heading.2" = yellow; "markup.heading.2" = yellow;
@ -993,12 +1029,18 @@ in {
"markup.heading.5" = red; "markup.heading.5" = red;
"markup.heading.6" = fg3; "markup.heading.6" = fg3;
"markup.list" = purple; "markup.list" = purple;
"markup.bold" = {modifiers = ["bold"];}; "markup.bold" = {
"markup.italic" = {modifiers = ["italic"];}; modifiers = [ "bold" ];
"markup.strikethrough" = {modifiers = ["crossed_out"];}; };
"markup.italic" = {
modifiers = [ "italic" ];
};
"markup.strikethrough" = {
modifiers = [ "crossed_out" ];
};
"markup.link.url" = { "markup.link.url" = {
fg = red; fg = red;
modifiers = ["underlined"]; modifiers = [ "underlined" ];
}; };
"markup.link.text" = blue; "markup.link.text" = blue;
"markup.raw" = red; "markup.raw" = red;
@ -1007,8 +1049,12 @@ in {
"diff.minus" = red; "diff.minus" = red;
"diff.delta" = blue; "diff.delta" = blue;
"ui.linenr" = {fg = fgdim;}; "ui.linenr" = {
"ui.linenr.selected" = {fg = fg2;}; fg = fgdim;
};
"ui.linenr.selected" = {
fg = fg2;
};
"ui.statusline" = { "ui.statusline" = {
fg = fgdim; fg = fgdim;
@ -1021,24 +1067,26 @@ in {
"ui.statusline.normal" = { "ui.statusline.normal" = {
fg = bg; fg = bg;
bg = purple; bg = purple;
modifiers = ["bold"]; modifiers = [ "bold" ];
}; };
"ui.statusline.insert" = { "ui.statusline.insert" = {
fg = bg; fg = bg;
bg = green; bg = green;
modifiers = ["bold"]; modifiers = [ "bold" ];
}; };
"ui.statusline.select" = { "ui.statusline.select" = {
fg = bg; fg = bg;
bg = red; bg = red;
modifiers = ["bold"]; modifiers = [ "bold" ];
}; };
"ui.popup" = { "ui.popup" = {
fg = text; fg = text;
bg = bg2; bg = bg2;
}; };
"ui.window" = {fg = fgdim;}; "ui.window" = {
fg = fgdim;
};
"ui.help" = { "ui.help" = {
fg = fg2; fg = fg2;
bg = bg2; bg = bg2;
@ -1048,25 +1096,33 @@ in {
fg = fgdim; fg = fgdim;
bg = bg2; bg = bg2;
}; };
"ui.bufferline.background" = {bg = bg2;}; "ui.bufferline.background" = {
bg = bg2;
};
"ui.text" = text; "ui.text" = text;
"ui.text.focus" = { "ui.text.focus" = {
fg = text; fg = text;
bg = bg3; bg = bg3;
modifiers = ["bold"]; modifiers = [ "bold" ];
};
"ui.text.inactive" = {
fg = fg2;
}; };
"ui.text.inactive" = {fg = fg2;};
"ui.virtual" = fg2; "ui.virtual" = fg2;
"ui.virtual.ruler" = {bg = bg3;}; "ui.virtual.ruler" = {
bg = bg3;
};
"ui.virtual.indent-guide" = bg3; "ui.virtual.indent-guide" = bg3;
"ui.virtual.inlay-hint" = { "ui.virtual.inlay-hint" = {
fg = bg3; fg = bg3;
bg = bg; bg = bg;
}; };
"ui.selection" = {bg = bg5;}; "ui.selection" = {
bg = bg5;
};
"ui.cursor" = { "ui.cursor" = {
fg = bg; fg = bg;
@ -1078,7 +1134,7 @@ in {
}; };
"ui.cursor.match" = { "ui.cursor.match" = {
fg = orange; fg = orange;
modifiers = ["bold"]; modifiers = [ "bold" ];
}; };
"ui.cursor.primary.normal" = { "ui.cursor.primary.normal" = {
@ -1107,12 +1163,14 @@ in {
bg = fg; bg = fg;
}; };
"ui.cursorline.primary" = {bg = bg3;}; "ui.cursorline.primary" = {
bg = bg3;
};
"ui.highlight" = { "ui.highlight" = {
bg = bg3; bg = bg3;
fg = bg; fg = bg;
modifiers = ["bold"]; modifiers = [ "bold" ];
}; };
"ui.menu" = { "ui.menu" = {
@ -1122,7 +1180,7 @@ in {
"ui.menu.selected" = { "ui.menu.selected" = {
fg = text; fg = text;
bg = bg3; bg = bg3;
modifiers = ["bold"]; modifiers = [ "bold" ];
}; };
"diagnostic.error" = { "diagnostic.error" = {
@ -1163,8 +1221,12 @@ in {
"ui.cursorline.primary" = { bg = "default" } "ui.cursorline.primary" = { bg = "default" }
"ui.cursorline.secondary" = { bg = "default" } "ui.cursorline.secondary" = { bg = "default" }
*/ */
"ui.cursorcolumn.primary" = {bg = bg3;}; "ui.cursorcolumn.primary" = {
"ui.cursorcolumn.secondary" = {bg = bg3;}; bg = bg3;
};
"ui.cursorcolumn.secondary" = {
bg = bg3;
};
"ui.bufferline.active" = { "ui.bufferline.active" = {
fg = primary; fg = primary;
@ -1269,11 +1331,13 @@ in {
]; ];
}; };
niri = { niri =
{
pkgs, pkgs,
config, config,
... ...
}: { }:
{
home.packages = with pkgs; [ home.packages = with pkgs; [
niri niri
fuzzel fuzzel
@ -1342,7 +1406,9 @@ in {
# kitty = {}; # kitty = {};
linux = {pkgs, ...}: { linux =
{ pkgs, ... }:
{
home = { home = {
sessionVariables = { sessionVariables = {
MOZ_ENABLE_WAYLAND = "1"; MOZ_ENABLE_WAYLAND = "1";
@ -1372,16 +1438,18 @@ in {
home.packages = [ home.packages = [
(pkgs.buildEnv { (pkgs.buildEnv {
name = "my-linux-scripts"; name = "my-linux-scripts";
paths = [./scripts/linux]; paths = [ ./scripts/linux ];
}) })
]; ];
}; };
linux-desktop-environment-config = { linux-desktop-environment-config =
{
pkgs, pkgs,
# font, # font,
... ...
}: { }:
{
imports = with homeManagerModules; [ imports = with homeManagerModules; [
linux linux
desktop desktop
@ -1401,10 +1469,9 @@ in {
}; };
postUnpack = ""; postUnpack = "";
}) }).override
.override
{ {
accents = ["sapphire"]; accents = [ "sapphire" ];
variant = "mocha"; variant = "mocha";
size = "compact"; size = "compact";
}; };
@ -1428,7 +1495,9 @@ in {
# nnn = {}; # nnn = {};
password-manager = {pkgs, ...}: { password-manager =
{ pkgs, ... }:
{
imports = with homeManagerModules; [ imports = with homeManagerModules; [
pass pass
]; ];
@ -1443,20 +1512,27 @@ in {
]; ];
}; };
pass = {pkgs, ...}: { pass =
{ pkgs, ... }:
{
programs.password-store = { programs.password-store = {
enable = true; enable = true;
package = pkgs.pass.withExtensions (exts: [exts.pass-otp]); package = pkgs.pass.withExtensions (exts: [ exts.pass-otp ]);
}; };
}; };
senpai = {config, ...}: { senpai =
{ config, ... }:
{
programs.senpai = { programs.senpai = {
enable = true; enable = true;
config = { config = {
address = "irc+insecure://beefcake.hare-cod.ts.net:6667"; address = "irc+insecure://beefcake.hare-cod.ts.net:6667";
nickname = "lytedev"; nickname = "lytedev";
password-cmd = ["pass" "soju"]; password-cmd = [
"pass"
"soju"
];
}; };
}; };
@ -1491,11 +1567,13 @@ in {
waybar = {}; waybar = {};
*/ */
wezterm = { wezterm =
{
pkgs, pkgs,
config, config,
... ...
}: { }:
{
home.packages = with pkgs; [ home.packages = with pkgs; [
wezterm wezterm
]; ];
@ -1505,11 +1583,13 @@ in {
}; };
}; };
ghostty = { ghostty =
{
pkgs, pkgs,
config, config,
... ...
}: { }:
{
home.packages = with pkgs; [ home.packages = with pkgs; [
ghostty ghostty
]; ];
@ -1519,7 +1599,9 @@ in {
}; };
}; };
zellij = {lib, ...}: { zellij =
{ lib, ... }:
{
# zellij does not support modern terminal keyboard input: # zellij does not support modern terminal keyboard input:
# https://github.com/zellij-org/zellij/issues/735 # https://github.com/zellij-org/zellij/issues/735
programs.zellij = { programs.zellij = {

View file

@ -6,4 +6,4 @@ scope = "source.nix"
[language.formatter] [language.formatter]
args = ["-"] args = ["-"]
command = "alejandra" command = "nixfmt"

View file

@ -4,31 +4,42 @@
inputs.pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; inputs.pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
inputs.pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs"; inputs.pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs";
outputs = { outputs =
{
self, self,
nixpkgs, nixpkgs,
pre-commit-hooks, pre-commit-hooks,
... ...
}: let }:
systems = ["aarch64-linux" "aarch64-darwin" "x86_64-darwin" "x86_64-linux"]; let
systems = [
"aarch64-linux"
"aarch64-darwin"
"x86_64-darwin"
"x86_64-linux"
];
forSystems = nixpkgs.lib.genAttrs systems; forSystems = nixpkgs.lib.genAttrs systems;
pkgsFor = system: (import nixpkgs {inherit system;}); pkgsFor = system: (import nixpkgs { inherit system; });
genPkgs = func: (forSystems (system: func (pkgsFor system))); genPkgs = func: (forSystems (system: func (pkgsFor system)));
in { in
formatter = genPkgs (pkgs: pkgs.alejandra); {
formatter = genPkgs (pkgs: pkgs.nixfmt-rfc-style);
checks = genPkgs (pkgs: { checks = genPkgs (pkgs: {
pre-commit-check = pre-commit-hooks.lib.${pkgs.system}.run { pre-commit-check = pre-commit-hooks.lib.${pkgs.system}.run {
src = ./.; src = ./.;
hooks = { hooks = {
alejandra.enable = true; nixfmt-rfc-style.enable = true;
}; };
}; };
}); });
devShells = genPkgs (pkgs: { devShells = genPkgs (pkgs: {
nix = pkgs.mkShell { nix = pkgs.mkShell {
packages = with pkgs; [nil alejandra]; packages = with pkgs; [
nixd
nixfmt-rfc-style
];
inherit (self.outputs.checks.${pkgs.system}.pre-commit-check) shellHook; inherit (self.outputs.checks.${pkgs.system}.pre-commit-check) shellHook;
}; };

View file

@ -1,12 +1,10 @@
{ git-hooks, ... }:
{ pkgs, ... }:
{ {
pkgs,
git-hooks,
...
}: {
git-hooks = git-hooks.lib.${pkgs.system}.run { git-hooks = git-hooks.lib.${pkgs.system}.run {
src = ./.; src = ./.;
hooks = { hooks = {
alejandra.enable = true; nixfmt-rfc-style.enable = true;
}; };
}; };
} }

View file

@ -1,8 +1,6 @@
{ self, ... }:
{ pkgs, ... }:
{ {
self,
pkgs,
...
}: {
default = pkgs.mkShell { default = pkgs.mkShell {
inherit (self.outputs.checks.${pkgs.system}.git-hooks) shellHook; inherit (self.outputs.checks.${pkgs.system}.git-hooks) shellHook;
packages = with pkgs; [ packages = with pkgs; [