added cachix

This commit is contained in:
Moritz Böhme 2021-10-23 11:42:14 +02:00
parent b2b9fa66e4
commit c90d0d71dc
4 changed files with 27 additions and 2 deletions

View file

@ -89,7 +89,8 @@
with channels.nixpkgs; {
devShell = mkShell {
name = "dotfiles";
packages = [ nixpkgs-fmt agenix.defaultPackage.x86_64-linux ];
packages =
[ nixpkgs-fmt agenix.defaultPackage.x86_64-linux cachix ];
};
};
};

13
modules/cachix.nix Normal file
View file

@ -0,0 +1,13 @@
# WARN: this file will get overwritten by $ cachix use <name>
{ 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/"];
}

View file

@ -0,0 +1,11 @@
{
nix = {
binaryCaches = [
"https://nix-community.cachix.org"
];
binaryCachePublicKeys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
}

View file

@ -1,7 +1,7 @@
{ lib, pkgs, ... }:
{
imports = [ ./apps ./cli ./desktop ./services ];
imports = [ ./apps ./cli ./desktop ./services ./cachix.nix ];
# USERS
users.users.moritz = {