Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions audio/dinit/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# A `turnstiled` and `dinit` based pipewire configuration

This example shows what is needed to get a user level service running pipewire
that launches at user log in and exits at user log out.

_**NOTE:**_ This guide assumes that the user already has `hjem` configured.
Initial `hjem` configuration is outside the scope of this example.

[`audio.nix`](./audio.nix) is a module that can be changed to use the correct
username dropped into your configuration and imported however you import
configuration modules, provided you've imported the correct modules however you
do so.

[`flake.nix`](./flake.nix) is an example flake (that can't be a drop in for your
system) which shows the repo's that need to be used as inputs as well as the
modules to import as well as how to import them if you use flakes. If you use
methods other than flakes, feel free to contribute a configuration for your
preferred method.
40 changes: 40 additions & 0 deletions audio/dinit/audio.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
lib,
config,
...
}:
{
services.turnstile = {
enable = true;
settings.manage_rundir = "yes";
};

programs = {
pipewire = {
enable = true;
alsa.enable = true;
};
wireplumber.enable = true;
};

hjem.users.<user>.dinit.services = {
pipewire = {
type = "process";
command = "${lib.getExe' config.programs.pipewire.package "pipewire"}";
restart = true;
depends-ms = [ "login.target" ];
};
pipewire-pulse = {
type = "process";
command = "${lib.getExe' config.programs.pipewire.package "pipewire-pulse"}";
restart = true;
prepared-by = [ "pipewire" ];
};
wireplumber = {
type = "process";
command = "${lib.getExe' config.programs.wireplumber.package "wireplumber"}";
restart = true;
prepared-by = [ "pipewire-pulse" ];
};
};
}
30 changes: 30 additions & 0 deletions audio/dinit/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
description = "A partial flake example for audio configuration. Do not use for system";

inputs = {
finix.url = "github:finix-community/finix";
community.url = "github:xzecora/community-modules/dinit-turnstiled";
};

outputs =
{
self,
finix,
community,
...
}:
{
nixosConfigurations.finix = finix.lib.finixSystem {
modules = [
finix.nixosModules.pipewire
finix.nixosModules.wireplumber
{
hjem.extraModules = [
community.hjemModules.dinit
];
}
community.nixosModules.turnstile
];
};
};
}