diff --git a/flake.lock b/flake.lock index a0e5d53..38fc0dd 100644 --- a/flake.lock +++ b/flake.lock @@ -418,6 +418,26 @@ "type": "github" } }, + "musnix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1719810225, + "narHash": "sha256-/2loMwYYMrBYSOWjNJ253xlwYhnQZ+PVmyE7NDI/xJA=", + "owner": "musnix", + "repo": "musnix", + "rev": "2197ffe9fa4c2b62e33d656ee443b086dbb4f151", + "type": "github" + }, + "original": { + "owner": "musnix", + "repo": "musnix", + "type": "github" + } + }, "neovim-nightly-overlay": { "inputs": { "flake-compat": "flake-compat", @@ -572,6 +592,7 @@ "home-manager": "home-manager", "hosts": "hosts", "ide": "ide", + "musnix": "musnix", "nid": "nid", "nixpkgs": "nixpkgs", "parts": "parts", diff --git a/flake.nix b/flake.nix index a7083bd..05e5688 100644 --- a/flake.nix +++ b/flake.nix @@ -25,6 +25,10 @@ url = "github:nix-community/nix-index-database"; inputs.nixpkgs.follows = "nixpkgs"; }; + musnix = { + url = "github:musnix/musnix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; catppuccin.url = "github:catppuccin/nix"; }; outputs = inputs: inputs.parts.lib.mkFlake { inherit inputs; } { imports = [ ./. ]; }; diff --git a/nixos/configs/default.nix b/nixos/configs/default.nix index 0177a7b..c69b70d 100644 --- a/nixos/configs/default.nix +++ b/nixos/configs/default.nix @@ -14,7 +14,8 @@ in ./nova-hardware.nix inputs.hosts.nixosModule inputs.catppuccin.nixosModules.catppuccin - ] ++ (with toplevel.config.flake.nixosModules; [ grub base sound wayland security ivand wireless wireguard style ]); + inputs.musnix.nixosModules.musnix + ] ++ (with toplevel.config.flake.nixosModules; [ grub base sound music wayland security ivand wireless wireguard style ]); }); vm = withSystem system (ctx@{ config, inputs', ... }: inputs.nixpkgs.lib.nixosSystem { diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix index e5a9f61..df665ff 100644 --- a/nixos/modules/default.nix +++ b/nixos/modules/default.nix @@ -70,6 +70,34 @@ }; }; }); + music = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }: { + environment.systemPackages = with pkgs; [ + (writeScriptBin "guitar" '' + ${jack2}/bin/jackd -dalsa -r96000 -p512 -n3 -D -Chw:U192k -Phw:U192k & + sleep 1 + ${guitarix}/bin/guitarix + '') + ]; + musnix = { + enable = true; + rtcqs.enable = true; + soundcardPciId = "00:1f.3"; + + kernel = { + realtime = true; + packages = pkgs.linuxPackages_6_8_rt; + }; + + # magic to me + rtirq = { + # highList = "snd_hrtimer"; + resetAll = 1; + prioLow = 0; + enable = true; + nameList = "rtc0 snd"; + }; + }; + }); wayland = moduleWithSystem (toplevel@{ ... }: perSystem@{ ... }: { hardware.graphics.enable = true; security.pam.services.swaylock = { };