mirror of
https://github.com/davegallant/nix-config
synced 2025-08-06 11:23:40 +00:00
Add nixpkgs-fmt pre-commit hook
This commit is contained in:
@@ -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;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
92
flake.nix
92
flake.nix
@@ -13,54 +13,56 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, darwin, home-manager, nixpkgs, nixos-hardware }: {
|
outputs = { self, darwin, home-manager, nixpkgs, nixos-hardware }: {
|
||||||
nixosConfigurations = let
|
nixosConfigurations =
|
||||||
defaultModules = [
|
let
|
||||||
home-manager.nixosModules.home-manager
|
defaultModules = [
|
||||||
./main/desktop.nix
|
home-manager.nixosModules.home-manager
|
||||||
./main/fonts.nix
|
./main/desktop.nix
|
||||||
./main/general.nix
|
./main/fonts.nix
|
||||||
./main/kernel.nix
|
./main/general.nix
|
||||||
./main/netdata/default.nix
|
./main/kernel.nix
|
||||||
./main/networking.nix
|
./main/netdata/default.nix
|
||||||
./main/packages.nix
|
./main/networking.nix
|
||||||
./main/printing.nix
|
./main/packages.nix
|
||||||
|
./main/printing.nix
|
||||||
|
|
||||||
({ config, lib, lib', ... }: {
|
({ config, lib, lib', ... }: {
|
||||||
config = {
|
config = {
|
||||||
_module.args = {
|
_module.args = {
|
||||||
lib' = lib // import ./lib { inherit config lib; };
|
lib' = lib // import ./lib { inherit config lib; };
|
||||||
|
};
|
||||||
|
|
||||||
|
nix = {
|
||||||
|
autoOptimiseStore = true;
|
||||||
|
binaryCaches = [ "https://davegallant.cachix.org" ];
|
||||||
|
binaryCachePublicKeys = [
|
||||||
|
"davegallant.cachix.org-1:SsUMqL4+tF2R3/G6X903E9laLlY1rES2QKFfePegF08="
|
||||||
|
];
|
||||||
|
useSandbox = false;
|
||||||
|
registry = { nixpkgs.flake = nixpkgs; };
|
||||||
|
trustedUsers = [ "root" "dave" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
nixpkgs.overlays = [ (import ./overlays) ];
|
||||||
|
|
||||||
|
home-manager = {
|
||||||
|
useGlobalPkgs = true;
|
||||||
|
useUserPackages = true;
|
||||||
|
users.dave.imports = [ ./home/default.nix ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
})
|
||||||
nix = {
|
];
|
||||||
autoOptimiseStore = true;
|
in
|
||||||
binaryCaches = [ "https://davegallant.cachix.org" ];
|
{
|
||||||
binaryCachePublicKeys = [
|
hephaestus = nixpkgs.lib.nixosSystem {
|
||||||
"davegallant.cachix.org-1:SsUMqL4+tF2R3/G6X903E9laLlY1rES2QKFfePegF08="
|
system = "x86_64-linux";
|
||||||
];
|
modules = [
|
||||||
useSandbox = false;
|
./machines/hephaestus/configuration.nix
|
||||||
registry = { nixpkgs.flake = nixpkgs; };
|
./machines/hephaestus/hardware.nix
|
||||||
trustedUsers = [ "root" "dave" ];
|
] ++ defaultModules;
|
||||||
};
|
};
|
||||||
|
|
||||||
nixpkgs.overlays = [ (import ./overlays) ];
|
|
||||||
|
|
||||||
home-manager = {
|
|
||||||
useGlobalPkgs = true;
|
|
||||||
useUserPackages = true;
|
|
||||||
users.dave.imports = [ ./home/default.nix ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
})
|
|
||||||
];
|
|
||||||
in {
|
|
||||||
hephaestus = nixpkgs.lib.nixosSystem {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
modules = [
|
|
||||||
./machines/hephaestus/configuration.nix
|
|
||||||
./machines/hephaestus/hardware.nix
|
|
||||||
] ++ defaultModules;
|
|
||||||
};
|
};
|
||||||
};
|
|
||||||
darwinConfigurations = {
|
darwinConfigurations = {
|
||||||
demeter = darwin.lib.darwinSystem {
|
demeter = darwin.lib.darwinSystem {
|
||||||
modules = [
|
modules = [
|
||||||
|
@@ -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)"
|
||||||
@@ -244,7 +244,7 @@ in {
|
|||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
set -g @plugin 'seebi/tmux-colors-solarized'
|
set -g @plugin 'seebi/tmux-colors-solarized'
|
||||||
set -g @colors-solarized 'dark'
|
set -g @colors-solarized 'dark'
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
|
@@ -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.
|
||||||
|
@@ -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";
|
||||||
|
@@ -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;
|
||||||
|
@@ -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";
|
||||||
|
@@ -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";
|
||||||
|
@@ -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";
|
||||||
|
Reference in New Issue
Block a user