Add nixpkgs-fmt pre-commit hook

This commit is contained in:
Dave Gallant
2021-05-30 23:00:39 -04:00
parent 8498968acc
commit 9092b371fe
9 changed files with 81 additions and 60 deletions

View File

@@ -1,12 +1,13 @@
let let
nix-pre-commit-hooks = import (builtins.fetchTarball nix-pre-commit-hooks = import (builtins.fetchTarball
"https://github.com/cachix/pre-commit-hooks.nix/tarball/master"); "https://github.com/cachix/pre-commit-hooks.nix/tarball/master");
in { in
{
pre-commit-check = nix-pre-commit-hooks.run { pre-commit-check = nix-pre-commit-hooks.run {
src = ./.; src = ./.;
hooks = { hooks = {
shellcheck.enable = true; shellcheck.enable = true;
nixfmt.enable = true; nixpkgs-fmt.enable = true;
}; };
}; };
} }

View File

@@ -13,7 +13,8 @@
}; };
outputs = { self, darwin, home-manager, nixpkgs, nixos-hardware }: { outputs = { self, darwin, home-manager, nixpkgs, nixos-hardware }: {
nixosConfigurations = let nixosConfigurations =
let
defaultModules = [ defaultModules = [
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
./main/desktop.nix ./main/desktop.nix
@@ -52,7 +53,8 @@
}; };
}) })
]; ];
in { in
{
hephaestus = nixpkgs.lib.nixosSystem { hephaestus = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [

View File

@@ -11,9 +11,8 @@ let
}; };
}; };
inherit (pkgs) stdenv; inherit (pkgs) stdenv;
in { in
{
home = { sessionVariables = { EDITOR = "vim"; }; };
services = { services = {
gpg-agent = { gpg-agent = {
@@ -115,6 +114,7 @@ in {
export PATH=$PATH:~/.local/bin export PATH=$PATH:~/.local/bin
export PATH=$PATH:~/go/bin export PATH=$PATH:~/go/bin
export PAGER=less export PAGER=less
export EDITOR=vim
eval "$(direnv hook zsh)" eval "$(direnv hook zsh)"
eval "$(_RFD_COMPLETE=source_zsh rfd)" eval "$(_RFD_COMPLETE=source_zsh rfd)"

View File

@@ -15,6 +15,7 @@
address = "192.168.0.1"; address = "192.168.0.1";
interface = "enp34s0"; interface = "enp34s0";
}; };
firewall = { allowedTCPPorts = [ 8001 ]; };
}; };
# Enable the OpenSSH server. # Enable the OpenSSH server.

View File

@@ -3,7 +3,8 @@ let
netdata = pkgs.netdata; netdata = pkgs.netdata;
netdataConf = ./netdata.conf; netdataConf = ./netdata.conf;
netdataDir = "/var/lib/netdata"; netdataDir = "/var/lib/netdata";
in { in
{
users.extraGroups.netdata.gid = 220008; users.extraGroups.netdata.gid = 220008;
users.extraUsers.netdata = { users.extraUsers.netdata = {
description = "Netdata server user"; description = "Netdata server user";

View File

@@ -1,7 +1,8 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let inherit (pkgs) stdenv; let inherit (pkgs) stdenv;
in { in
{
# System-wide packages to install. # System-wide packages to install.
environment.systemPackages = with pkgs; environment.systemPackages = with pkgs;
let let
@@ -58,7 +59,7 @@ in {
netdata netdata
procs procs
# databases # data tools
postgresql postgresql
# password managers # password managers
@@ -100,7 +101,7 @@ in {
nmap nmap
openssl openssl
openvpn openvpn
sshfs sshfs # mac requires https://osxfuse.github.io/
vpngate vpngate
whois whois
wireshark wireshark
@@ -179,6 +180,7 @@ in {
# Unsupported on darwin but likely should be: # Unsupported on darwin but likely should be:
bandwhich bandwhich
brave brave
datasette
deluge deluge
discord discord
firefox firefox
@@ -192,7 +194,8 @@ in {
yuzu yuzu
zoom-us zoom-us
]); ]);
in common; in
common;
# Install GnuPG agent. # Install GnuPG agent.
programs.gnupg.agent.enable = true; programs.gnupg.agent.enable = true;

View File

@@ -22,7 +22,8 @@ let
}; };
}; };
}; };
in with py.pkgs; in
with py.pkgs;
buildPythonApplication rec { buildPythonApplication rec {
pname = "changedetection.io"; pname = "changedetection.io";
version = "0.30"; version = "0.30";

View File

@@ -1,5 +1,16 @@
{ stdenv, lib, fetchFromGitHub, asciidoc, cmake, docbook_xsl, pkgconfig { stdenv
, bash-completion, curl, openssl, libxml2, libxslt }: , lib
, fetchFromGitHub
, asciidoc
, cmake
, docbook_xsl
, pkgconfig
, bash-completion
, curl
, openssl
, libxml2
, libxslt
}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "lpass"; pname = "lpass";

View File

@@ -2,7 +2,8 @@
let py = python3.override { }; let py = python3.override { };
in with py.pkgs; in
with py.pkgs;
buildPythonApplication rec { buildPythonApplication rec {
pname = "rfd"; pname = "rfd";
version = "v0.7.1"; version = "v0.7.1";