Compare commits
5 commits
576f10a6d0
...
a5e18095c1
Author | SHA1 | Date | |
---|---|---|---|
a5e18095c1 | |||
44bcfcd42d | |||
8f8a97933d | |||
85e3f362c0 | |||
cb7a2cd4bc |
8 changed files with 104 additions and 21 deletions
|
@ -270,6 +270,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
packages = {
|
packages = {
|
||||||
|
coredns = pkgs.callPackage ./pkgs/coredns { };
|
||||||
git-repo-go = pkgs.callPackage ./pkgs/git-repo-go { };
|
git-repo-go = pkgs.callPackage ./pkgs/git-repo-go { };
|
||||||
gitu = pkgs.callPackage ./pkgs/gitu { };
|
gitu = pkgs.callPackage ./pkgs/gitu { };
|
||||||
headscale-ui = pkgs.callPackage ./pkgs/headscale-ui { };
|
headscale-ui = pkgs.callPackage ./pkgs/headscale-ui { };
|
||||||
|
|
|
@ -19,15 +19,7 @@ in
|
||||||
programs.anyrun = {
|
programs.anyrun = {
|
||||||
enable = true;
|
enable = true;
|
||||||
config = {
|
config = {
|
||||||
plugins = with anyrunPkgs; [
|
plugins = with anyrunPkgs; [ applications ];
|
||||||
applications
|
|
||||||
dictionary
|
|
||||||
rink
|
|
||||||
stdin
|
|
||||||
shell
|
|
||||||
symbols
|
|
||||||
translate
|
|
||||||
];
|
|
||||||
width = {
|
width = {
|
||||||
fraction = 0.3;
|
fraction = 0.3;
|
||||||
};
|
};
|
||||||
|
|
|
@ -33,7 +33,6 @@ let
|
||||||
"media.ffmpeg.vaapi.enabled" = true;
|
"media.ffmpeg.vaapi.enabled" = true;
|
||||||
"media.rdd-ffmpeg.enabled" = true;
|
"media.rdd-ffmpeg.enabled" = true;
|
||||||
"network.allow-experimens" = false;
|
"network.allow-experimens" = false;
|
||||||
"network.http.referer.spoofSource" = true;
|
|
||||||
"privacy.query_stripping" = true;
|
"privacy.query_stripping" = true;
|
||||||
"privacy.webrtc.allowSilencingNotifications" = true;
|
"privacy.webrtc.allowSilencingNotifications" = true;
|
||||||
"privacy.webrtc.legacyGlobalIndicator" = false;
|
"privacy.webrtc.legacyGlobalIndicator" = false;
|
||||||
|
|
|
@ -102,6 +102,8 @@ in
|
||||||
"${mod} ${directions.right}" = "focus-view right";
|
"${mod} ${directions.right}" = "focus-view right";
|
||||||
"${mod} ${directions.up}" = "focus-view up";
|
"${mod} ${directions.up}" = "focus-view up";
|
||||||
"${mod} ${directions.down}" = "focus-view down";
|
"${mod} ${directions.down}" = "focus-view down";
|
||||||
|
"${mod} h" = "focus-view previous";
|
||||||
|
"${mod} apostrophe" = "focus-view next";
|
||||||
|
|
||||||
"${mod}+Shift ${directions.left}" = "move left";
|
"${mod}+Shift ${directions.left}" = "move left";
|
||||||
"${mod}+Shift ${directions.right}" = "move right";
|
"${mod}+Shift ${directions.right}" = "move right";
|
||||||
|
|
|
@ -282,6 +282,7 @@
|
||||||
|
|
||||||
networkConfig = {
|
networkConfig = {
|
||||||
DHCP = "yes";
|
DHCP = "yes";
|
||||||
|
IPv6AcceptRA = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
"40-wghorus" = {
|
"40-wghorus" = {
|
||||||
|
|
|
@ -1,24 +1,16 @@
|
||||||
{ pkgs, config, ... }:
|
{ config, ... }:
|
||||||
{
|
{
|
||||||
services.coredns = {
|
services.coredns = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.coredns.override {
|
|
||||||
externalPlugins = [
|
|
||||||
{
|
|
||||||
name = "tailscale";
|
|
||||||
repo = "github.com/damomurf/coredns-tailscale";
|
|
||||||
version = "750df081a3cc63f325ecfde6c30a974dc0e4bf56";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
vendorHash = "sha256-tuHr5oYmx3HNmsO6ZOO14vORArk8YHZBsodCiydf6k8=";
|
|
||||||
};
|
|
||||||
|
|
||||||
config = ''
|
config = ''
|
||||||
datarift.nl:5454 {
|
datarift.nl:5454 {
|
||||||
bind 127.0.0.1 ::1
|
bind 127.0.0.1 ::1
|
||||||
tailscale datarift.nl {
|
tailscale datarift.nl {
|
||||||
authkey {$TS_AUTHKEY}
|
authkey {$TS_AUTHKEY}
|
||||||
|
fallthrough
|
||||||
}
|
}
|
||||||
|
forward . 127.0.0.1:5335
|
||||||
log
|
log
|
||||||
errors
|
errors
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,4 +47,5 @@ _final: prev: {
|
||||||
gitu = prev.pkgs.callPackage ../pkgs/gitu { };
|
gitu = prev.pkgs.callPackage ../pkgs/gitu { };
|
||||||
zed = prev.pkgs.callPackage ../pkgs/zed { };
|
zed = prev.pkgs.callPackage ../pkgs/zed { };
|
||||||
git-repo-go = prev.pkgs.callPackage ../pkgs/git-repo-go { };
|
git-repo-go = prev.pkgs.callPackage ../pkgs/git-repo-go { };
|
||||||
|
coredns = prev.pkgs.callPackage ../pkgs/coredns { };
|
||||||
}
|
}
|
||||||
|
|
95
pkgs/coredns/default.nix
Normal file
95
pkgs/coredns/default.nix
Normal file
|
@ -0,0 +1,95 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
gnused,
|
||||||
|
stdenv,
|
||||||
|
buildGoModule,
|
||||||
|
fetchFromGitHub,
|
||||||
|
installShellFiles,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
version = "1.11.1";
|
||||||
|
|
||||||
|
externalPlugins = [
|
||||||
|
{
|
||||||
|
name = "tailscale";
|
||||||
|
repo = "github.com/damomurf/coredns-tailscale";
|
||||||
|
version = "750df081a3cc63f325ecfde6c30a974dc0e4bf56";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
attrsToPlugins = attrs: builtins.map ({ name, repo, ... }: "${name}:${repo}") attrs;
|
||||||
|
attrsToSources = attrs: builtins.map ({ repo, version, ... }: "${repo}@${version}") attrs;
|
||||||
|
in
|
||||||
|
buildGoModule {
|
||||||
|
pname = "coredns";
|
||||||
|
inherit version;
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "coredns";
|
||||||
|
repo = "coredns";
|
||||||
|
rev = "v${version}";
|
||||||
|
sha256 = "sha256-Mn8hOsODTlnl6PJaevMcyIKkIx/1Lk2HGA7fSSizR20=";
|
||||||
|
};
|
||||||
|
|
||||||
|
# vendorHash = lib.fakeHash;
|
||||||
|
vendorHash = "sha256-ba8Krc8FVrylsV0n/3JNRTrL3bP8UJRdKF2fy8SYU3o=";
|
||||||
|
|
||||||
|
nativeBuildInputs = [ installShellFiles ];
|
||||||
|
|
||||||
|
outputs = [
|
||||||
|
"out"
|
||||||
|
"man"
|
||||||
|
];
|
||||||
|
|
||||||
|
# Override the go-modules fetcher derivation to fetch plugins
|
||||||
|
modBuildPhase = ''
|
||||||
|
for plugin in ${builtins.toString (attrsToPlugins externalPlugins)}; do
|
||||||
|
echo "Adding plugin $plugin"
|
||||||
|
${gnused}/bin/sed -i "/forward:forward/i$plugin" plugin.cfg
|
||||||
|
done
|
||||||
|
|
||||||
|
for src in ${builtins.toString (attrsToSources externalPlugins)}; do
|
||||||
|
echo "Retrieving $src"
|
||||||
|
go get $src
|
||||||
|
done
|
||||||
|
|
||||||
|
go generate
|
||||||
|
go mod tidy
|
||||||
|
go mod vendor
|
||||||
|
'';
|
||||||
|
|
||||||
|
modInstallPhase = ''
|
||||||
|
mv -t vendor go.mod go.sum plugin.cfg
|
||||||
|
cp -r --reflink=auto vendor "$out"
|
||||||
|
'';
|
||||||
|
|
||||||
|
preBuild = ''
|
||||||
|
chmod -R u+w vendor
|
||||||
|
mv -t . vendor/go.{mod,sum} vendor/plugin.cfg
|
||||||
|
|
||||||
|
go generate
|
||||||
|
'';
|
||||||
|
|
||||||
|
postPatch =
|
||||||
|
''
|
||||||
|
substituteInPlace test/file_cname_proxy_test.go \
|
||||||
|
--replace "TestZoneExternalCNAMELookupWithProxy" \
|
||||||
|
"SkipZoneExternalCNAMELookupWithProxy"
|
||||||
|
|
||||||
|
substituteInPlace test/readme_test.go \
|
||||||
|
--replace "TestReadme" "SkipReadme"
|
||||||
|
|
||||||
|
# this test fails if any external plugins were imported.
|
||||||
|
# it's a lint rather than a test of functionality, so it's safe to disable.
|
||||||
|
substituteInPlace test/presubmit_test.go \
|
||||||
|
--replace "TestImportOrdering" "SkipImportOrdering"
|
||||||
|
''
|
||||||
|
+ lib.optionalString stdenv.isDarwin ''
|
||||||
|
# loopback interface is lo0 on macos
|
||||||
|
sed -E -i 's/\blo\b/lo0/' plugin/bind/setup_test.go
|
||||||
|
'';
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
installManPage man/*
|
||||||
|
'';
|
||||||
|
}
|
Loading…
Reference in a new issue