1
0
Fork 0

Introduce pre-commit-hooks.nix

This commit is contained in:
Daniel Kempkens 2023-07-17 00:17:50 +02:00
parent 1302a7bfdf
commit f1224473a9
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM
46 changed files with 218 additions and 82 deletions

1
.pre-commit-config.yaml Symbolic link
View file

@ -0,0 +1 @@
/nix/store/rkdyfyp0x0nwvdq80b7vss4n599davvd-pre-commit-config.json

View file

@ -1,4 +1,4 @@
{ config, lib, ... }:
{ config, ... }:
{
virtualisation.oci-containers.containers = {

View file

@ -1,4 +1,4 @@
{ config, lib, ... }:
{ config, ... }:
{
virtualisation.oci-containers.containers = {

View file

@ -1,4 +1,4 @@
{ config, lib, ... }:
{ config, ... }:
let
secret = import ../../secret/container/weewx;

View file

@ -177,6 +177,22 @@
"type": "github"
}
},
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
@ -261,6 +277,24 @@
"type": "github"
}
},
"flake-utils_3": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1685518550,
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
@ -283,6 +317,27 @@
"type": "github"
}
},
"gitignore_2": {
"inputs": {
"nixpkgs": [
"pre-commit-hooks-nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1660459072,
"narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@ -379,11 +434,11 @@
]
},
"locked": {
"lastModified": 1689281837,
"narHash": "sha256-msgwgot2/hxXzlpYltIZ7boAqBkN8XejNOhBJ07q3FY=",
"lastModified": 1689516967,
"narHash": "sha256-sFAa33wkQHanmij/uhfGduIDK8z4dJAita/rK6u9pvE=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "c806a73609e77f0c446fdad5d3ea6ca3b7ae6e5f",
"rev": "61662a63bfe1726588c1da6b412df86d8ca94d63",
"type": "github"
},
"original": {
@ -476,6 +531,46 @@
"type": "github"
}
},
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1685801374,
"narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c37ca420157f4abc31e26f436c1145f8951ff373",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.05",
"repo": "nixpkgs",
"type": "github"
}
},
"pre-commit-hooks-nix": {
"inputs": {
"flake-compat": "flake-compat_3",
"flake-utils": "flake-utils_3",
"gitignore": "gitignore_2",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable_2"
},
"locked": {
"lastModified": 1689328505,
"narHash": "sha256-9B3+OeUn1a/CvzE3GW6nWNwS5J7PDHTyHGlpL3wV5oA=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "5e28316db471d1ac234beb70031b635437421dd6",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"agenix": "agenix",
@ -489,6 +584,7 @@
"nix-darwin": "nix-darwin",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs",
"pre-commit-hooks-nix": "pre-commit-hooks-nix",
"treefmt-nix": "treefmt-nix"
}
},
@ -534,6 +630,21 @@
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [

View file

@ -15,6 +15,11 @@
inputs.nixpkgs.follows = "nixpkgs";
};
pre-commit-hooks-nix = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
# Overlays
disko = {
@ -115,6 +120,7 @@
imports = [
inputs.flake-root.flakeModule
inputs.treefmt-nix.flakeModule
inputs.pre-commit-hooks-nix.flakeModule
];
systems = [
@ -135,12 +141,29 @@
};
};
pre-commit = {
settings = {
excludes = [ "\\.direnv\\/" ];
hooks = {
deadnix.enable = true;
statix.enable = true;
treefmt.enable = true;
};
settings = {
statix.ignore = [ ".direnv/**/*.nix" ];
};
};
};
devShells.default = pkgs.mkShell {
name = "dotfiles";
inputsFrom = [
config.flake-root.devShell
config.treefmt.build.devShell
config.pre-commit.devShell
];
};
};

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, modulesPath, ... }:
{ lib, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, modulesPath, ... }:
{ lib, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, modulesPath, ... }:
{ lib, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];

View file

@ -27,14 +27,13 @@
(highlight :IlluminatedWordText {:bg mod.colors.selection})
(highlight :IlluminatedWordRead {:bg mod.colors.selection})
(highlight :IlluminatedWordWrite {:bg mod.colors.selection :underline true})
;; nvim-ts-rainbow2
(highlight :TSRainbowRed {:fg mod.colors.red})
(highlight :TSRainbowYellow {:fg mod.colors.yellow})
(highlight :TSRainbowBlue {:fg mod.colors.purple})
(highlight :TSRainbowOrange {:fg mod.colors.orange})
(highlight :TSRainbowGreen {:fg mod.colors.green})
(highlight :TSRainbowViolet {:fg mod.colors.pink})
(highlight :TSRainbowCyan {:fg mod.colors.cyan}))
;; rainbow-delimiters
(highlight :RainbowDelimiterRed {:fg mod.colors.red})
(highlight :RainbowDelimiterYellow {:fg mod.colors.yellow})
(highlight :RainbowDelimiterBlue {:fg mod.colors.purple})
(highlight :RainbowDelimiterOrange {:fg mod.colors.orange})
(highlight :RainbowDelimiterGreen {:fg mod.colors.green})
(highlight :RainbowDelimiterViolet {:fg mod.colors.pink})
(highlight :RainbowDelimiterCyan {:fg mod.colors.cyan}))
mod)

View file

@ -0,0 +1,12 @@
(let [rainbow-delimiters (require :rainbow-delimiters)]
(set vim.g.rainbow_delimiters
{:strategy {"" (. rainbow-delimiters :strategy :global)
:vim (. rainbow-delimiters :strategy :local)}
:query {"" :rainbow-delimiters :lua :rainbow-blocks}
:highlight [:RainbowDelimite
:RainbowDelimiterYellow
:RainbowDelimiterBlue
:RainbowDelimiterOrange
:RainbowDelimiterGreen
:RainbowDelimiterViolet
:RainbowDelimiterCyan]}))

View file

@ -48,17 +48,9 @@
:if "@function.inner"
:ac "@conditional.outer"
:ic "@conditional.inner"}}}
:rainbow {:enable true
:disable (vim.tbl_filter (fn [parser]
(not (vim.tbl_contains rainbow-parsers
parser)))
install-parsers)
:query :rainbow-parens
:strategy (require :ts-rainbow.strategy.global)}
:matchup {:enable true :disable disable-parsers}
:autopairs {:enable true :disable disable-parsers}
:autotag {:enable true :disable disable-parsers}
:playground {:enable true}
:nifoc_hooks {:enable true
:disable disable-parsers}}))

View file

@ -1,4 +1,4 @@
args@{ pkgs, config, lib, ... }:
{ pkgs, ... }:
{
imports = [

View file

@ -1,4 +1,4 @@
args@{ pkgs, ... }:
{ pkgs, ... }:
{
imports = [

View file

@ -1,4 +1,4 @@
args@{ pkgs, ... }:
{ pkgs, ... }:
{
imports = [

View file

@ -1,4 +1,4 @@
args@{ pkgs, ... }:
{ pkgs, ... }:
{
imports = [

View file

@ -1,4 +1,4 @@
args@{ pkgs, ... }:
{ pkgs, ... }:
{
imports = [

View file

@ -1,4 +1,4 @@
args@{ pkgs, ... }:
{ pkgs, ... }:
{
imports = [

View file

@ -1,5 +1,3 @@
{ pkgs, lib, ... }:
{
programs.atuin = {
enable = true;

View file

@ -1,4 +1,4 @@
{ pkgs, config, lib, ... }:
{ pkgs, lib, ... }:
let
inherit (pkgs) fetchFromGitHub;

View file

@ -1,5 +1,3 @@
{ pkgs, ... }:
{
programs.fzf = {
enable = true;

View file

@ -1,5 +1,3 @@
{ pkgs, ... }:
{
programs.gpg = {
enable = true;

View file

@ -106,7 +106,7 @@ in
let
customPlugins = import ./plugins.nix { inherit pkgs; };
in
(with customPlugins; [
with customPlugins; [
# Utils
popup-nvim
plenary-nvim
@ -162,7 +162,12 @@ in
type = "fennel";
}
nvim-ts-rainbow2
{
plugin = rainbow-delimiters-nvim;
config = builtins.readFile ../../config/nvim/plugins/rainbow-delimiters.fnl;
type = "fennel";
}
playground
# Telescope
@ -338,7 +343,7 @@ in
config = builtins.readFile ../../config/nvim/plugins/noice.fnl;
type = "fennel";
}
]);
];
};
xdg.configFile."nvim" = {

View file

@ -107,12 +107,12 @@ in
};
dracula-nvim = buildVimPluginFrom2Nix {
pname = "dracula.nvim";
version = "2023-07-13";
version = "2023-07-16";
src = fetchFromGitHub {
owner = "Mofiqul";
repo = "dracula.nvim";
rev = "9db13329e205aaee089e25be8113bd1faeca674e";
sha256 = "1f79jazw5kp0ica4hdxpjry79qii8q6a0shg2rqkhpd0a8ydb8rg";
rev = "948d237241b91389c8c2f109885b91cd2574b8bb";
sha256 = "09cgyskfmqnp0gl1qbwfij8a6r6c0frgbj39zjx15frbhraygpdb";
fetchSubmodules = false;
};
};
@ -127,14 +127,14 @@ in
fetchSubmodules = false;
};
};
nvim-ts-rainbow2 = buildVimPluginFrom2Nix {
pname = "nvim-ts-rainbow2";
version = "2023-07-12";
rainbow-delimiters-nvim = buildVimPluginFrom2Nix {
pname = "rainbow-delimiters.nvim";
version = "2023-07-16";
src = fetchFromGitHub {
owner = "HiPhish";
repo = "nvim-ts-rainbow2";
rev = "b3120cd5ae9ca524af9cb602f41e12e301fa985f";
sha256 = "0mjg0pkd8wv8cfar30lkyywdrd3g5lz36bbsfb7lrqi7kbksyzxv";
repo = "rainbow-delimiters.nvim";
rev = "a9f2bb9777a4b2a5178df09fcb7c30e5664949bc";
sha256 = "0l542mlncq6c3p8d866zlzx12g3wil39xy4bq99nxlsjsmyhin7g";
fetchSubmodules = false;
};
};
@ -286,12 +286,12 @@ in
};
nvim-lint = buildVimPluginFrom2Nix {
pname = "nvim-lint";
version = "2023-07-13";
version = "2023-07-16";
src = fetchFromGitHub {
owner = "mfussenegger";
repo = "nvim-lint";
rev = "808e8fdbee02ed2c6efc17e70c7453fccf5d5a1d";
sha256 = "1q0ryrsmiil2l2dfhlxnkgahxw5jnfbiv1b48ly2iscqldrsm9sb";
rev = "a9d46f7f8173250567854d81ef2ead1256789b0e";
sha256 = "1z53rlm4p8s90clr4biqaxnpfsr87889lxwp4wnazl4137hi4b9c";
fetchSubmodules = false;
};
};
@ -583,12 +583,12 @@ in
};
noice-nvim = buildVimPluginFrom2Nix {
pname = "noice.nvim";
version = "2023-07-01";
version = "2023-07-16";
src = fetchFromGitHub {
owner = "folke";
repo = "noice.nvim";
rev = "6c87c1d11c38180fb72bf8f45518a0a3e081afc1";
sha256 = "0y0fwll3a421r0px9x2d8mq2nj00w6ahilwmrvmhvnazjgqd074j";
rev = "26394ed09d47160a493d4e9e754f5f78d4556a6b";
sha256 = "08b2yn27ljy3jf88qj3gi86rvy4ijrip3hha2dbnzhdsziq897k4";
fetchSubmodules = false;
};
};

View file

@ -13,7 +13,7 @@
- src: Mofiqul/dracula.nvim
# Syntax
- src: nvim-treesitter/nvim-treesitter
- src: HiPhish/nvim-ts-rainbow2
- src: HiPhish/rainbow-delimiters.nvim
- src: nvim-treesitter/playground
# Telescope
- src: nvim-telescope/telescope.nvim

View file

@ -1,5 +1,3 @@
{ pkgs, ... }:
{
programs.texlive = {
enable = true;

View file

@ -1,4 +1,4 @@
args@{ pkgs, lib, ... }:
{ pkgs, ... }:
let
secret = import ../../secret/hosts/adsb-antenna.nix;
@ -93,7 +93,7 @@ in
};
daniel = {
hashedPassword = secret.users.daniel.hashedPassword;
inherit (secret.users.daniel) hashedPassword;
isNormalUser = true;
home = "/home/daniel";
description = "Daniel";

View file

@ -1,4 +1,4 @@
args@{ pkgs, config, lib, ... }:
args@{ pkgs, config, ... }:
let
secret = import ../../secret/hosts/mediaserver.nix;
@ -133,6 +133,9 @@ in
doc.enable = false;
};
fonts.fontconfig.enable = false;
sound.enable = false;
programs.fish.enable = true;
programs.htop.enable = true;

View file

@ -1,4 +1,4 @@
args@{ pkgs, config, lib, ... }:
{ pkgs, config, ... }:
let
ssh-keys = import ../shared/ssh-keys.nix;

View file

@ -18,7 +18,7 @@
debug_pprof = false;
dns = {
bind_hosts = secret.adguardhome.bind_hosts;
inherit (secret.adguardhome) bind_hosts;
port = 53;
bootstrap_dns = [
@ -40,7 +40,7 @@
networking.firewall.interfaces =
let
interfaces = lib.mapAttrsToList (_: value: lib.attrsets.attrByPath [ "matchConfig" "Name" ] null value) config.systemd.network.networks;
interfaces = lib.mapAttrsToList (_: lib.attrsets.attrByPath [ "matchConfig" "Name" ] null) config.systemd.network.networks;
in
builtins.listToAttrs
(builtins.map

View file

@ -1,4 +1,4 @@
{ pkgs, lib, config, ... }:
{ pkgs, config, ... }:
let
ariaDir = "/mnt/downloads/Aria2";

View file

@ -1,4 +1,4 @@
{ pkgs, config, lib, secret, ... }:
{ pkgs, config, secret, ... }:
let
fqdn = "attic.cache.daniel.sx";

View file

@ -1,4 +1,4 @@
{ pkgs, lib, ... }:
{ lib, ... }:
{
systemd.tmpfiles.rules = [

View file

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

View file

@ -1,4 +1,4 @@
{ pkgs, lib, ... }:
{ lib, ... }:
{
virtualisation.oci-containers.containers.flaresolverr = {

View file

@ -1,4 +1,4 @@
{ pkgs, config, secret, ... }:
{ secret, ... }:
{
services.nginx.streamConfig = ''

View file

@ -1,4 +1,4 @@
{ pkgs, lib, ... }:
{ lib, ... }:
{
services.jellyfin = {

View file

@ -1,4 +1,4 @@
{ config, secret, ... }:
{ secret, ... }:
{
services.libreddit = {

View file

@ -28,7 +28,7 @@
networking.firewall.interfaces =
let
interfaces = lib.mapAttrsToList (_: value: lib.attrsets.attrByPath [ "matchConfig" "Name" ] null value) config.systemd.network.networks ++ [ "tailscale0" ];
interfaces = lib.mapAttrsToList (_: lib.attrsets.attrByPath [ "matchConfig" "Name" ] null) config.systemd.network.networks ++ [ "tailscale0" ];
in
builtins.listToAttrs
(builtins.map

View file

@ -1,4 +1,4 @@
{ pkgs, lib, ... }:
{ lib, ... }:
{
virtualisation.oci-containers.containers.prowlarr = {

View file

@ -1,4 +1,4 @@
{ pkgs, lib, ... }:
{ lib, ... }:
{
virtualisation.oci-containers.containers.radarr = {

View file

@ -1,4 +1,4 @@
{ pkgs, config, ... }:
{ pkgs, ... }:
let
rimgo-pkg = pkgs.rimgo;

View file

@ -1,4 +1,4 @@
{ pkgs, lib, ... }:
{ lib, ... }:
{
systemd.tmpfiles.rules = [

View file

@ -1,4 +1,4 @@
{ pkgs, lib, ... }:
{ lib, ... }:
{
virtualisation.oci-containers.containers.sonarr = {

View file

@ -1,4 +1,4 @@
{ pkgs, lib, config, secret, ... }:
{ pkgs, config, secret, ... }:
{
environment.systemPackages = with pkgs; [ ldns tcpdump wireguard-tools ];