1
0
Fork 0
mirror of https://github.com/mdlayher/homelab.git synced 2024-12-14 11:47:32 +00:00

nixos/lib: clean up unused modules and packages

Signed-off-by: Matt Layher <mdlayher@gmail.com>
This commit is contained in:
Matt Layher 2022-01-31 09:47:38 -05:00
parent cf9cb93cc1
commit 3a742b5e39
No known key found for this signature in database
GPG key ID: 77BFE531397EDE94
5 changed files with 0 additions and 179 deletions

View file

@ -1,65 +0,0 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.conprof;
configFile = pkgs.writeText "conprof.yaml" cfg.config;
cmdlineArgs = [
"sampler"
"--config.file ${configFile}"
"--log.level debug"
"--http-address :10902"
"--store=grpc.polarsignals.com:443"
"--bearer-token=TODO"
];
in {
options.services.conprof = {
enable = mkEnableOption "conprof continuous profiler";
config = mkOption {
default = "";
type = types.lines;
description = ''
Verbatim conprof YAML configuration. See <link xlink:href="https://github.com/conprof/conprof/blob/master/examples/conprof.yaml"/> for details.'';
};
package = mkOption {
default = pkgs.conprof;
defaultText = "pkgs.conprof";
type = types.package;
description = "conprof package to use.";
};
};
config = mkIf cfg.enable {
users = {
groups.conprof = { };
users.conprof = {
description = "conprof daemon user";
group = "conprof";
createHome = true;
home = "/var/lib/conprof";
};
};
systemd.services.conprof = {
description = "conprof continuous profiler";
after = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
PermissionsStartOnly = true;
LimitNPROC = 512;
LimitNOFILE = 1048576;
NoNewPrivileges = true;
ExecStart = "${cfg.package}/bin/conprof"
+ optionalString (length cmdlineArgs != 0)
(" \\\n " + concatStringsSep " \\\n " cmdlineArgs);
Restart = "on-failure";
User = "conprof";
};
};
};
}

View file

@ -1,51 +0,0 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.wgipamd;
configFile = pkgs.writeText "wgipamd.toml" cfg.config;
in {
options.services.wgipamd = {
enable = mkEnableOption "wgipamd WireGuard wg-dynamic server";
config = mkOption {
default = "";
example = ''
[storage]
file = "/var/lib/wgipamd"
[[interfaces]]
name = "wg0"
'';
type = types.lines;
description = ''
Verbatim wgipamd TOML configuration. See <link xlink:href="https://github.com/mdlayher/wgipam/blob/master/internal/config/default.toml"/> for details.'';
};
package = mkOption {
default = pkgs.wgipamd;
defaultText = "pkgs.wgipamd";
type = types.package;
description = "wgipamd package to use.";
};
};
config = mkIf cfg.enable {
systemd.services.wgipamd = {
description = "wgipamd WireGuard wg-dynamic server";
after = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
PermissionsStartOnly = true;
LimitNPROC = 512;
LimitNOFILE = 1048576;
CapabilityBoundingSet = "cap_net_bind_service";
AmbientCapabilities = "cap_net_bind_service";
NoNewPrivileges = true;
DynamicUser = true;
ExecStart = "${getBin cfg.package}/bin/wgipamd -c=${configFile}";
Restart = "on-failure";
};
};
};
}

View file

@ -1,30 +0,0 @@
{ stdenv, buildGoModule, fetchFromGitHub, pkgs }:
buildGoModule rec {
pname = "conprof";
version = "3457edb30fc42eede8bc273537a4bfc94d766b8a";
# Tests require graphviz, docker, and potentially a specific Go/Linux install?
doCheck = false;
# dot is required for rendering SVGs.
nativeBuildInputs = [ pkgs.graphviz ];
goPackagePath = "github.com/conprof/conprof";
src = fetchFromGitHub {
owner = "conprof";
repo = "conprof";
rev = "3457edb30fc42eede8bc273537a4bfc94d766b8a";
sha256 = "1w60c88gzg92xpck6p23i9dndh8m05l316xafzv9g2wg7wd3jnhw";
};
vendorSha256 = "08il74ywi6llxsjbj5d036hs8ivjzx4x1mhlpv3a7x9fxsj67pxm";
meta = with stdenv.lib; {
homepage = "https://github.com/conprof/conprof";
description = "Continuous profiling for pprof compatible profiles.";
license = licenses.asl20;
maintainers = with maintainers; [ mdlayher ];
};
}

View file

@ -1,25 +0,0 @@
{ stdenv, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
pname = "wgipamd";
version = "0.1.0";
goPackagePath = "github.com/mdlayher/wgipam";
src = fetchFromGitHub {
owner = "mdlayher";
repo = "wgipam";
rev = "v${version}";
sha256 = "1kc4ynqxyg1qvwbs9lcwqmv9hczzjw195axfxi2mbvqy54z25za1";
};
modSha256 = "099mdpfy7sd1cwdfzcgp6yl03liw3kzfwl5ivfavm23w0v9pg16p";
meta = with stdenv.lib; {
homepage = "https://github.com/mdlayher/wgipam";
description =
"IPAM daemon for dynamic IP address assignment to WireGuard peers, using the wg-dynamic protocol.";
license = licenses.asl20;
maintainers = with maintainers; [ mdlayher ];
};
}

View file

@ -15,16 +15,8 @@ in {
# Service configuration.
./containers.nix
./prometheus.nix
# Unstable or out-of-tree modules.
# ./lib/modules/conprof.nix
];
# Overlays for unstable and out-of-tree packages.
# nixpkgs.overlays = [
# (_self: super: { conprof = super.callPackage ./lib/pkgs/conprof.nix { }; })
# ];
networking = {
# Host name and ID.
hostName = "servnerr-3";