mirror of
https://github.com/youwen5/nixos.git
synced 2025-02-28 14:31:10 -08:00
feat: add musnix for realtime audio
This commit is contained in:
parent
af59cdd252
commit
ccf58bcf15
5 changed files with 68 additions and 11 deletions
21
flake.lock
21
flake.lock
|
@ -625,6 +625,26 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"musnix": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1735772949,
|
||||
"narHash": "sha256-lvee0rhKTpJEDl1SC4F3Kvz88snOU8OMTJBsPH1pVBo=",
|
||||
"owner": "musnix",
|
||||
"repo": "musnix",
|
||||
"rev": "86ef22cbdd7551ef325bce88143be9f37da64c26",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "musnix",
|
||||
"repo": "musnix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nix-darwin": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
|
@ -887,6 +907,7 @@
|
|||
"homebrew-cask": "homebrew-cask",
|
||||
"homebrew-core": "homebrew-core",
|
||||
"lanzaboote": "lanzaboote",
|
||||
"musnix": "musnix",
|
||||
"nix-darwin": "nix-darwin",
|
||||
"nix-flatpak": "nix-flatpak",
|
||||
"nix-homebrew": "nix-homebrew",
|
||||
|
|
|
@ -102,6 +102,11 @@
|
|||
};
|
||||
|
||||
zenTyp.url = "github:youwen5/zen.typ";
|
||||
|
||||
musnix = {
|
||||
url = "github:musnix/musnix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs =
|
||||
|
@ -171,6 +176,7 @@
|
|||
inputs.nixos-wsl.nixosModules.default
|
||||
inputs.stylix.nixosModules.stylix
|
||||
inputs.agenix.nixosModules.age
|
||||
inputs.musnix.nixosModules.musnix
|
||||
./modules/default.nix
|
||||
./overlays
|
||||
(
|
||||
|
|
|
@ -6,25 +6,53 @@
|
|||
}:
|
||||
let
|
||||
cfg = config.liminalOS.system.audio.prod;
|
||||
forAllUsers = lib.genAttrs cfg.realtimeAudioUsers;
|
||||
in
|
||||
{
|
||||
options.liminalOS.system.audio.prod.enable = lib.mkEnableOption "audio production";
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
liminalOS = {
|
||||
programs.wine.enable = true;
|
||||
system.audio.enable = true;
|
||||
options.liminalOS.system.audio.prod = {
|
||||
enable = lib.mkEnableOption "audio production";
|
||||
realtimeAudioUsers = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
description = ''
|
||||
List of users to add to the audio group for realtime capabilities.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
reaper
|
||||
yabridge
|
||||
yabridgectl
|
||||
alsa-scarlett-gui
|
||||
];
|
||||
|
||||
liminalOS.config.extraUnfreePackages = lib.mkIf config.liminalOS.config.allowUnfree [
|
||||
config = {
|
||||
liminalOS = lib.mkIf cfg.enable {
|
||||
programs.wine.enable = true;
|
||||
system.audio.enable = true;
|
||||
config.extraUnfreePackages = lib.mkIf config.liminalOS.config.allowUnfree [
|
||||
"reaper"
|
||||
];
|
||||
};
|
||||
|
||||
environment.systemPackages = lib.mkIf cfg.enable (
|
||||
(with pkgs; [
|
||||
yabridge
|
||||
yabridgectl
|
||||
alsa-scarlett-gui
|
||||
])
|
||||
++ (lib.optionals config.liminalOS.config.allowUnfree [
|
||||
pkgs.reaper
|
||||
])
|
||||
);
|
||||
|
||||
musnix.enable = cfg.enable;
|
||||
# PREEMPT_RT is merged into master
|
||||
musnix.kernel.realtime = false;
|
||||
|
||||
musnix.das_watchdog.enable = cfg.enable;
|
||||
musnix.alsaSeq.enable = cfg.enable;
|
||||
musnix.rtcqs.enable = cfg.enable;
|
||||
users.users = forAllUsers (_: {
|
||||
extraGroups = [ "audio" ];
|
||||
});
|
||||
|
||||
boot.kernelParams = lib.mkIf cfg.enable [
|
||||
"threadirqs"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
formFactor = "desktop";
|
||||
system = {
|
||||
audio.prod.enable = true;
|
||||
audio.prod.realtimeAudioUsers = [ "youwen" ];
|
||||
networking = {
|
||||
firewallPresets.vite = true;
|
||||
cloudflareNameservers.enable = true;
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
formFactor = "desktop";
|
||||
system = {
|
||||
audio.prod.enable = true;
|
||||
audio.prod.realtimeAudioUsers = [ "youwen" ];
|
||||
networking = {
|
||||
firewallPresets.vite = true;
|
||||
cloudflareNameservers.enable = true;
|
||||
|
|
Loading…
Reference in a new issue