From 4328853a92f417aa942defba121f3ddd03d0f506 Mon Sep 17 00:00:00 2001 From: Malte Brandy Date: Tue, 18 May 2021 15:56:39 +0200 Subject: [PATCH] Install cachix --- cachix.nix | 14 ++++++++++++++ cachix/pre-commit-hooks.nix | 12 ++++++++++++ nixos/roles/default.nix | 2 +- overlays/pkgSets.nix | 2 +- 4 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 cachix.nix create mode 100644 cachix/pre-commit-hooks.nix diff --git a/cachix.nix b/cachix.nix new file mode 100644 index 00000000..cce90a32 --- /dev/null +++ b/cachix.nix @@ -0,0 +1,14 @@ + +# WARN: this file will get overwritten by $ cachix use +{ pkgs, lib, ... }: + +let + folder = ./cachix; + toImport = name: value: folder + ("/" + name); + filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key; + imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder)); +in { + inherit imports; + nix.binaryCaches = ["https://cache.nixos.org/"]; +} + \ No newline at end of file diff --git a/cachix/pre-commit-hooks.nix b/cachix/pre-commit-hooks.nix new file mode 100644 index 00000000..9506b4f5 --- /dev/null +++ b/cachix/pre-commit-hooks.nix @@ -0,0 +1,12 @@ + +{ + nix = { + binaryCaches = [ + "https://pre-commit-hooks.cachix.org" + ]; + binaryCachePublicKeys = [ + "pre-commit-hooks.cachix.org-1:Pkk3Panw5AW24TOv6kz3PvLhlH8puAsJTBbOPmBo7Rc=" + ]; + }; +} + \ No newline at end of file diff --git a/nixos/roles/default.nix b/nixos/roles/default.nix index c58fa113..a9c9cc27 100644 --- a/nixos/roles/default.nix +++ b/nixos/roles/default.nix @@ -1,5 +1,5 @@ { pkgs, config, lib, ... }: { - imports = [ ../../common ./admin.nix ]; + imports = [ ../../common ./admin.nix ../../cachix.nix ]; i18n.defaultLocale = "en_US.UTF-8"; diff --git a/overlays/pkgSets.nix b/overlays/pkgSets.nix index 9e267630..aed51504 100644 --- a/overlays/pkgSets.nix +++ b/overlays/pkgSets.nix @@ -12,7 +12,7 @@ self: super: { inherit (self) htop tree pwgen borgbackup inotifyTools direnv socat nmap ncdu tcpdump tmux tig exa fzf ag fd bat ripgrep ranger pass sshuttle vnstat - entr libargon2 mblaze niv compsize mediainfo asciinema gomuks nix-output-monitor fdroidserver jq + entr libargon2 mblaze niv compsize mediainfo asciinema gomuks nix-output-monitor fdroidserver jq cachix ; };