This commit is contained in:
Leon Vita 2022-09-18 15:56:17 +01:00
commit 8b56ed954b
9 changed files with 158 additions and 46 deletions

View File

@ -18,15 +18,17 @@
hardware.pulseaudio = {
enable = true;
systemWide = true;
tcp.enable = true;
tcp.anonymousClients.allowedIpRanges = [
"127.0.0.0/8"
"::1/128"
"fd23:42:c3d2:500::/56"
"172.22.99.0/24"
"172.20.72.0/21"
"2a00:8180:2c00:200::/56"
];
tcp = {
enable = true;
anonymousClients.allowedIpRanges = [
"127.0.0.0/8"
"::1/128"
"fd23:42:c3d2:500::/56"
"172.22.99.0/24"
"172.20.72.0/21"
"2a00:8180:2c00:200::/56"
];
};
zeroconf.publish.enable = true;
package = (pkgs.pulseaudio.override {
bluetoothSupport = true;
@ -38,13 +40,14 @@
});
};
# TODO: configure system wide service
#services.pipewire = {
# enable = true;
# alsa.enable = true;
# config.pipewire-pulse = lib.importJSON ./pipewire-pulse.conf.json;
# pulse.enable = true;
#};
# pipewire has no systemwide pipewire-pulse
# services.pipewire = {
# enable = true;
# config.pipewire-pulse = lib.importJSON ./pipewire-pulse.conf.json;
# pulse.enable = true;
# socketActivation = false;
# systemWide = true;
# };
security.rtkit.enable = true;
@ -70,5 +73,15 @@
RestartSec = 60;
};
};
users = {
groups = {
pulse-access = { };
};
users.k-ot.extraGroups = [
"pipewire"
"pulse-access" # required for system wide pulseaudio
];
};
};
}

View File

@ -4,6 +4,6 @@
# shellcheck shell=bash
dir=$(dirname "$(readlink -f "$0")")
default_pipewire_pulse=$(nix-instantiate --eval -E '(import <nixos> { }).pkgs.path')/nixos/modules/services/desktops/pipewire/pipewire-pulse.conf.json
default_pipewire_pulse=$(nix-instantiate --eval -E '(import <nixos> { }).pkgs.path')/nixos/modules/services/desktops/pipewire/daemon/pipewire-pulse.conf.json
jq -s '.[0] * .[1] * .[2]' "$dir/pipewire-pulse.conf.in.json" "$default_pipewire_pulse" > "$dir/pipewire-pulse.conf.json" <(jq -cnS '{ "context.modules": [ inputs."context.modules" ] | add}' "$default_pipewire_pulse" "$dir/pipewire-pulse.conf.in.json")

View File

@ -6,10 +6,25 @@
{
"name": "libpipewire-module-protocol-pulse",
"args": {
"auth-ip-acl": [
"127.0.0.0/8",
"::1/128",
"fd23:42:c3d2:500::/56",
"172.22.99.0/24",
"172.20.72.0/21",
"2a00:8180:2c00:200::/56"
],
"server.address": [
"unix:native",
"tcp:4713"
]
],
"pulse.min.req": "256/48000",
"pulse.default.req": "960/48000",
"pulse.min.frag": "256/48000",
"pulse.default.frag": "96000/48000",
"pulse.default.tlength": "96000/48000",
"pulse.min.quantum": "256/48000",
"pulse.default.format": "F32"
}
}
]

View File

@ -1,12 +1,14 @@
{
"context.modules": [
{
"args": {},
"args": {
"nice.level": -11
},
"flags": [
"ifexists",
"nofail"
],
"name": "libpipewire-module-rtkit"
"name": "libpipewire-module-rt"
},
{
"name": "libpipewire-module-protocol-native"
@ -21,19 +23,35 @@
"name": "libpipewire-module-metadata"
},
{
"args": {
"server.address": [
"unix:native",
"tcp:4713"
],
"vm.overrides": {
"pulse.min.quantum": "1024/48000"
}
},
"args": {},
"name": "libpipewire-module-protocol-pulse"
},
{
"name": "libpipewire-module-zeroconf-publish"
},
{
"args": {
"auth-ip-acl": [
"127.0.0.0/8",
"::1/128",
"fd23:42:c3d2:500::/56",
"172.22.99.0/24",
"172.20.72.0/21",
"2a00:8180:2c00:200::/56"
],
"pulse.default.format": "F32",
"pulse.default.frag": "96000/48000",
"pulse.default.req": "960/48000",
"pulse.default.tlength": "96000/48000",
"pulse.min.frag": "256/48000",
"pulse.min.quantum": "256/48000",
"pulse.min.req": "256/48000",
"server.address": [
"unix:native",
"tcp:4713"
]
},
"name": "libpipewire-module-protocol-pulse"
}
],
"context.properties": {},
@ -41,6 +59,72 @@
"audio.convert.*": "audioconvert/libspa-audioconvert",
"support.*": "support/libspa-support"
},
"context.exec": [],
"stream.properties": {}
"context.exec": [
{
"path": "pactl",
"args": "load-module module-always-sink"
}
],
"stream.properties": {},
"pulse.properties": {
"server.address": [
"unix:native"
],
"vm.overrides": {
"pulse.min.quantum": "1024/48000"
}
},
"pulse.rules": [
{
"matches": [
{}
],
"actions": {
"update-props": {}
}
},
{
"matches": [
{
"application.process.binary": "teams"
},
{
"application.process.binary": "teams-insiders"
},
{
"application.process.binary": "skypeforlinux"
}
],
"actions": {
"quirks": [
"force-s16-info"
]
}
},
{
"matches": [
{
"application.process.binary": "firefox"
}
],
"actions": {
"quirks": [
"remove-capture-dont-move"
]
}
},
{
"matches": [
{
"application.name": "~speech-dispatcher*"
}
],
"actions": {
"update-props": {
"pulse.min.req": "1024/48000",
"pulse.min.quantum": "1024/48000"
}
}
}
]
}

View File

@ -34,17 +34,18 @@
]
},
"locked": {
"lastModified": 1663370480,
"narHash": "sha256-fCC/ukecfQZx8M3gNgQ2LCJAXWFIW3uXF7X19oSAVJc=",
"owner": "matelab",
"repo": "bevy_julia",
"rev": "6ced0d32cd785d206acdf97f0bde7fb50583b4e5",
"type": "github"
"lastModified": 1663441942,
"narHash": "sha256-KNKnxcD8mHfjCqI0FluGOY1gfDfOMo8K9upGnCGksGo=",
"ref": "main",
"rev": "7feee1b6c436230f2adea774aab14a74d862e355",
"revCount": 3,
"type": "git",
"url": "https://gitea.c3d2.de/astro/bevy-julia.git"
},
"original": {
"owner": "matelab",
"repo": "bevy_julia",
"type": "github"
"ref": "main",
"type": "git",
"url": "https://gitea.c3d2.de/astro/bevy-julia.git"
}
},
"bevy-mandelbrot": {

View File

@ -24,7 +24,8 @@
};
};
bevy-julia = {
url = "github:matelab/bevy_julia";
# url = "github:matelab/bevy_julia";
url = "git+https://gitea.c3d2.de/astro/bevy-julia.git?ref=main";
inputs = {
nixpkgs.follows = "nixos";
# breaks the build:
@ -344,7 +345,7 @@
"${name}-nixos-rebuild-local" = pkgs.writeScriptBin "${name}-nixos-rebuild" ''
#!${pkgs.runtimeShell} -ex
[[ $(ssh ${target} cat /etc/hostname) == ${name} ]]
[[ $1 == build || $(ssh ${target} cat /etc/hostname) == ${name} ]]
${pkgs.nixos-rebuild}/bin/nixos-rebuild ${rebuildArg} --target-host ${target} --use-remote-sudo "$@"
'';

View File

@ -66,6 +66,7 @@
firefox
pavucontrol
glxinfo
projectm
tracer-game
bevy_julia
bevy_mandelbrot

View File

@ -182,9 +182,6 @@ in
users.motd = lib.mkIf cfg.enableMotd (builtins.readFile ./motd);
users = {
groups = {
pulse-access = { };
};
users = {
k-ot = lib.mkIf cfg.k-ot.enable {
packages = with pkgs; [ screen tmux ];
@ -193,7 +190,6 @@ in
uid = 1000;
extraGroups = [
"audio"
"pulse-access" # required for system wide pulseaudio
"video"
"wheel"
];

View File

@ -4,6 +4,7 @@ let
serv = "serv-gw";
c3d2 = "c3d2-gw3";
pub = "pub-gw";
flpk = "flpk-gw";
};
inherit (config.networking) hostName;