mirror of
https://github.com/willemml/dotfiles.nix.git
synced 2025-04-12 03:07:17 +00:00
add precommit checks for formatting
This commit is contained in:
parent
b2ad6233e7
commit
b2cc028bac
2 changed files with 28 additions and 14 deletions
24
flake.nix
24
flake.nix
|
@ -13,11 +13,12 @@
|
|||
nixos-apple-silicon.url = "github:tpwrules/nixos-apple-silicon";
|
||||
nixos-apple-silicon.inputs.nixpkgs.follows = "nixpkgs";
|
||||
rycee-firefox-addons.url = "git+https://git.sr.ht/~rycee/nur-expressions?dir=pkgs/firefox-addons";
|
||||
pre-commit-hooks-nix.url = "github:cachix/pre-commit-hooks.nix";
|
||||
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
|
||||
pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs = inputs:
|
||||
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
inputs.flake-parts.lib.mkFlake {inherit inputs;} {
|
||||
imports = [
|
||||
./flake-parts
|
||||
];
|
||||
|
@ -28,6 +29,23 @@
|
|||
"aarch64-darwin"
|
||||
# "aarch64-linux"
|
||||
];
|
||||
|
||||
perSystem = {
|
||||
system,
|
||||
self',
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
checks.pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
|
||||
src = ./.;
|
||||
hooks = {
|
||||
alejandra.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
inherit (self'.checks.pre-commit-check) shellHook;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.pathsToLink = [ "/share/zsh" ];
|
||||
environment.shells = [ pkgs.bashInteractive pkgs.zsh ];
|
||||
environment.systemPackages = [ pkgs.coreutils-full ];
|
||||
{pkgs, ...}: {
|
||||
environment.pathsToLink = ["/share/zsh"];
|
||||
environment.shells = [pkgs.bashInteractive pkgs.zsh];
|
||||
environment.systemPackages = [pkgs.coreutils-full];
|
||||
environment.variables.LANG = "en_US.UTF-8";
|
||||
environment.variables.LANGUAGE = "en_US.UTF-8";
|
||||
environment.variables.LC_ALL = "en_US.UTF-8";
|
||||
|
@ -15,20 +13,18 @@
|
|||
generateRegistryFromInputs = true;
|
||||
linkInputs = true;
|
||||
package = pkgs.nix;
|
||||
settings.experimental-features = [ "nix-command" "flakes" "repl-flake" ];
|
||||
settings.trusted-users = [ "root" "willem" ];
|
||||
settings.experimental-features = ["nix-command" "flakes" "repl-flake"];
|
||||
settings.trusted-users = ["root" "willem"];
|
||||
};
|
||||
|
||||
|
||||
programs.nix-index.enable = false;
|
||||
|
||||
programs.bash.enable = true;
|
||||
programs.bash.enableCompletion = true;
|
||||
programs.bash.interactiveShellInit = ''
|
||||
export PS1=$'\n'"\e[0mbash: \e[34;1m\w"$'\n'"\e[32m\\$\e[0m "
|
||||
'';
|
||||
|
||||
programs.man.enable = true;
|
||||
documentation.man.enable = true;
|
||||
|
||||
programs.zsh.enable = true;
|
||||
programs.zsh.enableBashCompletion = true;
|
||||
|
|
Loading…
Add table
Reference in a new issue