2015-06-04 12:12:51 +00:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
2020-06-13 14:51:38 +00:00
|
|
|
let mpdStreamingPort = 8080; in
|
2015-06-04 12:12:51 +00:00
|
|
|
{
|
|
|
|
imports =
|
|
|
|
[
|
2021-05-22 16:17:29 +00:00
|
|
|
/etc/nixos/hardware-configuration.nix
|
2020-07-14 14:47:09 +00:00
|
|
|
./common-headless.nix
|
|
|
|
./i3.nix
|
2015-06-04 12:12:51 +00:00
|
|
|
./uefi.nix
|
2015-12-06 09:03:22 +00:00
|
|
|
./fstrim.nix
|
2022-11-24 01:28:44 +00:00
|
|
|
# ./nebula.nix
|
2022-11-24 01:01:25 +00:00
|
|
|
./tailscale.nix
|
2015-06-04 12:12:51 +00:00
|
|
|
];
|
|
|
|
|
2015-12-06 09:05:04 +00:00
|
|
|
environment.etc."lvm/lvm.conf".text = ''
|
|
|
|
devices {
|
|
|
|
issue_discards = 1
|
|
|
|
}
|
|
|
|
'';
|
2022-11-19 06:24:16 +00:00
|
|
|
boot.initrd.luks.devices = {
|
|
|
|
euhadra_crypt = {
|
2015-12-06 09:05:04 +00:00
|
|
|
device = "/dev/disk/by-uuid/328a9ede-0958-490b-8e82-62b06b839e21";
|
|
|
|
preLVM = true;
|
|
|
|
allowDiscards = true;
|
2022-11-19 06:24:16 +00:00
|
|
|
};
|
|
|
|
};
|
2015-06-04 12:12:51 +00:00
|
|
|
|
|
|
|
networking.hostName = "euhadra";
|
|
|
|
networking.hostId = "ddb5f0fd";
|
|
|
|
|
2020-11-21 10:28:14 +00:00
|
|
|
hardware.cpu.intel.updateMicrocode = true;
|
|
|
|
|
2015-06-04 12:12:51 +00:00
|
|
|
services.mpd = {
|
|
|
|
enable = true;
|
2022-11-19 06:24:16 +00:00
|
|
|
# network.listenAddress = "127.0.0.1";
|
2020-06-13 14:14:42 +00:00
|
|
|
musicDirectory = "/mnt/aplysia/music";
|
2015-06-04 12:12:51 +00:00
|
|
|
extraConfig = ''
|
2022-11-19 06:24:16 +00:00
|
|
|
bind_to_address "10.59.0.6"
|
|
|
|
|
2017-10-26 20:05:58 +00:00
|
|
|
# audio_output {
|
|
|
|
# type "alsa"
|
|
|
|
# name "dac"
|
|
|
|
# device "sysdefault:CARD=QAMP"
|
|
|
|
# }
|
|
|
|
|
2015-06-04 12:12:51 +00:00
|
|
|
audio_output {
|
2017-10-26 20:05:58 +00:00
|
|
|
type "pulse"
|
|
|
|
name "pulse"
|
2022-11-19 06:24:16 +00:00
|
|
|
server "127.0.0.1"
|
2015-06-04 12:12:51 +00:00
|
|
|
}
|
2015-06-05 14:36:50 +00:00
|
|
|
|
2020-06-13 14:51:38 +00:00
|
|
|
audio_output {
|
|
|
|
type "httpd"
|
|
|
|
name "http"
|
|
|
|
encoder "flac"
|
|
|
|
port "${toString mpdStreamingPort}"
|
|
|
|
}
|
|
|
|
|
2015-06-05 14:36:50 +00:00
|
|
|
replaygain "auto"
|
|
|
|
restore_paused "yes"
|
2015-06-04 12:12:51 +00:00
|
|
|
'';
|
|
|
|
};
|
2017-09-23 12:34:29 +00:00
|
|
|
|
2022-11-19 06:24:16 +00:00
|
|
|
services.pipewire = {
|
|
|
|
config.pipewire-pulse = {
|
|
|
|
"pulse.properties"."server.address" = [
|
|
|
|
"unix:native"
|
|
|
|
"tcp:127.0.0.1:4713"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
networking.wireguard.interfaces.wg0 = {
|
|
|
|
ips = ["10.59.0.6/16"];
|
|
|
|
privateKeyFile = "/etc/wgkeys/euhadra";
|
|
|
|
allowedIPsAsRoutes = true;
|
|
|
|
postSetup = ''
|
|
|
|
${pkgs.systemd}/bin/resolvectl domain wg0 '~htdf.gebner.org' '~mtlaa.gebner.org' '~ams.gebner.org'
|
|
|
|
${pkgs.systemd}/bin/resolvectl dns wg0 10.58.0.1
|
|
|
|
'';
|
|
|
|
peers = [{
|
|
|
|
publicKey = "ByLlJbevlTBooAo2RIZGGJvBHKqA9qiOpHBvR5yuJX4=";
|
|
|
|
allowedIPs = ["10.56.0.0/14" "10.60.1.1"];
|
|
|
|
endpoint = "htdf-gw.gebner.org:35869";
|
|
|
|
# endpoint = "80.109.29.104:35869";
|
|
|
|
# endpoint = "127.0.0.1:35869";
|
|
|
|
}];
|
|
|
|
};
|
|
|
|
# systemd.services.wireguard-wg0.wantedBy = pkgs.lib.mkOverride 10 [];
|
|
|
|
|
|
|
|
services.resolved = {
|
|
|
|
domains = [];
|
|
|
|
enable = true;
|
|
|
|
};
|
|
|
|
|
2017-09-23 12:34:29 +00:00
|
|
|
networking.firewall.allowedTCPPorts = [
|
|
|
|
config.services.mpd.network.port
|
2022-11-19 06:24:16 +00:00
|
|
|
# 4713 # pulseaudio
|
2020-06-13 14:51:38 +00:00
|
|
|
mpdStreamingPort # mpd streaming
|
2017-09-23 12:34:29 +00:00
|
|
|
];
|
2015-06-04 12:12:51 +00:00
|
|
|
|
|
|
|
environment.systemPackages = with pkgs; [ mpc_cli ];
|
|
|
|
|
2017-09-23 12:34:29 +00:00
|
|
|
hardware.opengl.extraPackages = [ pkgs.vaapiIntel ];
|
2015-06-04 12:12:51 +00:00
|
|
|
|
2015-09-01 12:16:20 +00:00
|
|
|
nixpkgs.config.mpv.vaapiSupport = true;
|
|
|
|
|
2022-11-19 06:24:16 +00:00
|
|
|
# hardware.pulseaudio = {
|
|
|
|
# systemWide = true;
|
|
|
|
# zeroconf.publish.enable = true;
|
|
|
|
# tcp = {
|
|
|
|
# enable = true;
|
|
|
|
# anonymousClients.allowedIpRanges = [
|
|
|
|
# "127.0.0.1"
|
|
|
|
# "10.57.0.0/16"
|
|
|
|
# ];
|
|
|
|
# };
|
|
|
|
# };
|
2017-09-23 12:34:29 +00:00
|
|
|
|
2022-11-19 06:24:16 +00:00
|
|
|
system.stateVersion = "19.03";
|
2015-06-04 12:12:51 +00:00
|
|
|
}
|