Skip to content

boffbowsh/nix-lancache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LanCache.net nix flake

Packages LanCache.net as a NixOS module flake.

Usage

In your NixOS flake.nix, include the modules:

{
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11";
  inputs.lancache.url = "github:boffbowsh/nix-lancache";

  outputs = { self, nixpkgs, lancache }: {

    nixosConfigurations.pc = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules =
        [
          ./configuration.nix
          lancache.nixosModules.dns
          lancache.nixosModules.cache
        ];
    };
  };
}

Then set the options in your configuration.nix:

{ ... }:
{
  lancache = {
    dns = {
      enable = true;
      forwarders = [ "1.1.1.1" "8.8.8.8" ];
      cacheIp = "192.168.0.99";
    };
    cache = {
      enable = true;
      resolvers = [ "1.1.1.1" "8.8.8.8" ];
    };
  };
}

The cache module maps the LanCache.net environment variables to camelCased Nix options, eg CACHE_INDEX_SIZE becomes cacheIndexSize. The options for controlling the cache-domains repo are replaced by the flake.lock file.

Todo

  • Sniproxy
  • Monitoring
  • Customising cache and log locations

About

A Flake for running LanCache.net on NixOS

Topics

Resources

Stars

Watchers

Forks

Languages