Skip to content

Hyffer/fippf-nix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FIPPF package for nix

This repo contains

An overlay that builds fippf package.

A NixOS module runs fippf as systemd service.

$ nix flake show
├───nixosModules
│   └───fippfService: NixOS module
└───overlays
    └───fippf: Nixpkgs overlay

And a docker image.

Use with flake

flake.nix

{
  description = "NixOS flake";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
+   fippf.url = "github:Hyffer/fippf-nix";
  };

  outputs = { self, nixpkgs, ... } @ inputs:
+ let
+   pkgsOverlay = {
+     nixpkgs.overlays = [
+       inputs.fippf.overlays.fippf
+     ];
+   };
+ in
  {
    nixosConfigurations.<host> = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      specialArgs = { inherit inputs; };

      modules = [
+       pkgsOverlay
+       inputs.fippf.nixosModules.fippfService
        ./configuration.nix
      ];
    };
  };
}

configuration.nix

{ config, lib, pkgs, ... }:

{
  environment.systemPackages = with pkgs; [
+   # cli for inspection purpose
+   fippf
  ];

+ # systemd service
+ # refer to module.nix for available options
+ services.fippf.enable = true;
}

Use inside container

Build image with nix and load it into docker

nix build -f docker.nix
docker load < result

You can explore the image using dive

dive --source docker-archive <(gunzip -c result)

Here is an example docker-compose.yml

services:
  fippf:
    image: fippf:1.0.0
    container_name: fippf
    restart: unless-stopped
    volumes:
      - /path/to/fippf/config:/etc/fippf
    environment:
      - TZ=Asia/Shanghai
    network_mode: host
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun

Acknowledgement

fippf package is generated by nix-init.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors