nixos-config/euhadra.nix

127 lines
2.8 KiB
Nix
Raw Normal View History

2015-06-04 14:12:51 +02:00
{ config, pkgs, ... }:
2020-06-13 16:51:38 +02:00
let mpdStreamingPort = 8080; in
2015-06-04 14:12:51 +02:00
{
imports =
[
/etc/nixos/hardware-configuration.nix
2020-07-14 16:47:09 +02:00
./common-headless.nix
2022-11-26 04:55:17 +01:00
./sway.nix
2015-06-04 14:12:51 +02:00
./uefi.nix
2015-12-06 10:03:22 +01:00
./fstrim.nix
2022-11-24 02:28:44 +01:00
# ./nebula.nix
2022-11-24 02:01:25 +01:00
./tailscale.nix
2015-06-04 14:12:51 +02:00
];
2015-12-06 10:05:04 +01:00
environment.etc."lvm/lvm.conf".text = ''
devices {
issue_discards = 1
}
'';
2022-11-19 07:24:16 +01:00
boot.initrd.luks.devices = {
euhadra_crypt = {
2015-12-06 10:05:04 +01:00
device = "/dev/disk/by-uuid/328a9ede-0958-490b-8e82-62b06b839e21";
preLVM = true;
allowDiscards = true;
2022-11-19 07:24:16 +01:00
};
};
2015-06-04 14:12:51 +02:00
networking.hostName = "euhadra";
networking.hostId = "ddb5f0fd";
2020-11-21 11:28:14 +01:00
hardware.cpu.intel.updateMicrocode = true;
2015-06-04 14:12:51 +02:00
services.mpd = {
enable = true;
2022-11-19 07:24:16 +01:00
# network.listenAddress = "127.0.0.1";
2020-06-13 16:14:42 +02:00
musicDirectory = "/mnt/aplysia/music";
2015-06-04 14:12:51 +02:00
extraConfig = ''
2022-11-19 07:24:16 +01:00
bind_to_address "10.59.0.6"
2022-11-26 04:55:17 +01:00
bind_to_address "100.97.134.100"
2022-11-19 07:24:16 +01:00
2017-10-26 22:05:58 +02:00
# audio_output {
# type "alsa"
# name "dac"
# device "sysdefault:CARD=QAMP"
# }
2015-06-04 14:12:51 +02:00
audio_output {
2017-10-26 22:05:58 +02:00
type "pulse"
name "pulse"
2022-11-19 07:24:16 +01:00
server "127.0.0.1"
2015-06-04 14:12:51 +02:00
}
2015-06-05 16:36:50 +02:00
2020-06-13 16:51:38 +02:00
audio_output {
type "httpd"
name "http"
encoder "flac"
port "${toString mpdStreamingPort}"
}
2015-06-05 16:36:50 +02:00
replaygain "auto"
restore_paused "yes"
2015-06-04 14:12:51 +02:00
'';
};
2017-09-23 14:34:29 +02:00
2022-11-19 07:24:16 +01:00
services.pipewire = {
config.pipewire-pulse = {
"pulse.properties"."server.address" = [
"unix:native"
"tcp:127.0.0.1:4713"
2022-11-26 04:55:17 +01:00
"tcp:100.97.134.100:4713"
2022-11-19 07:24:16 +01:00
];
};
};
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 14:34:29 +02:00
networking.firewall.allowedTCPPorts = [
config.services.mpd.network.port
2022-11-26 04:55:17 +01:00
4713 # pulseaudio
2020-06-13 16:51:38 +02:00
mpdStreamingPort # mpd streaming
2017-09-23 14:34:29 +02:00
];
2015-06-04 14:12:51 +02:00
environment.systemPackages = with pkgs; [ mpc_cli ];
2017-09-23 14:34:29 +02:00
hardware.opengl.extraPackages = [ pkgs.vaapiIntel ];
2015-06-04 14:12:51 +02:00
2015-09-01 14:16:20 +02:00
nixpkgs.config.mpv.vaapiSupport = true;
2022-11-19 07:24:16 +01: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 14:34:29 +02:00
2022-11-26 04:55:17 +01:00
system.stateVersion = "22.05";
time.timeZone = pkgs.lib.mkOverride 10 "US/Pacific";
2015-06-04 14:12:51 +02:00
}