diff --git a/flake.lock b/flake.lock index 74974a2..4ede975 100644 --- a/flake.lock +++ b/flake.lock @@ -133,11 +133,11 @@ "qmd": "qmd" }, "locked": { - "lastModified": 1779970580, - "narHash": "sha256-BbKrwdXnlY62bGxWsNKoHWywbewA09Do+ws7wTSte1c=", + "lastModified": 1781072789, + "narHash": "sha256-/F/4Kg7t7accuaAzc8khMyK+xXReXjpU9Tn4L0LrnyI=", "owner": "openclaw", "repo": "nix-openclaw", - "rev": "ed00b170386eca78d4ed380e15de618b983c70e1", + "rev": "a60fb12d461edfdadb6dca65a3b72230e35014ad", "type": "github" }, "original": { @@ -182,11 +182,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1779560665, - "narHash": "sha256-tpyBcxPpcQb8ukyNF7DoCwfSY3VPsxHoYwj00Cayv5o=", + "lastModified": 1780749050, + "narHash": "sha256-3av0pIjlOWQ6rDbNOmpUSvbNnJkGORQKKjb4LtCZsIY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "64c08a7ca051951c8eae34e3e3cb1e202fe36786", + "rev": "a799d3e3886da994fa307f817a6bc705ae538eeb", "type": "github" }, "original": { @@ -230,11 +230,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1779796641, - "narHash": "sha256-ZsIrKmhp4vbBXoXXmR/tBXA/UCsAQiJL9vsgZEduhVY=", + "lastModified": 1780952837, + "narHash": "sha256-Fwd1+spDtQ0hDyBwme6ufG3n4mY0UrjjFdYHv+G/Hds=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "25f538306313eae3927264466c70d7001dcea1df", + "rev": "e820eb4a444b46a19b2e03e8dfd2359439ff30fe", "type": "github" }, "original": { @@ -317,11 +317,11 @@ ] }, "locked": { - "lastModified": 1779946062, - "narHash": "sha256-M/2bCPYjiBTkDNV29J/00z10RM3yYnL9X74RqAHDme0=", + "lastModified": 1780637620, + "narHash": "sha256-ngPdHinPyF0AMxRr32qt+TZCv0sagmooBW14u6DfjSU=", "owner": "youwen5", "repo": "zen-browser-flake", - "rev": "2e2c38ba20a3d614d0196e0aa44851547306e861", + "rev": "8c62bc6a72ac5a5b8d1b41b2b88dfed9d9932c48", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 027fa72..35f811b 100644 --- a/flake.nix +++ b/flake.nix @@ -67,6 +67,16 @@ inherit system; modules = [ ./hosts/NixOracle/configuration.nix + { + nixpkgs.overlays = [ + (final: prev: { + unstable = import nixpkgs-unstable { + inherit system; + config = prev.config; + }; + }) + ]; + } ]; }; }; diff --git a/home/ltadeu6.nix b/home/ltadeu6.nix index fbb294d..9d539c4 100644 --- a/home/ltadeu6.nix +++ b/home/ltadeu6.nix @@ -1,6 +1,32 @@ { config, pkgs, lib, ... }: let + fluidsynthStart = pkgs.writeShellScript "fluidsynth-start" '' + ${pkgs.fluidsynth}/bin/fluidsynth \ + -a pulseaudio -m alsa_seq -g 1.0 -q \ + ${pkgs.soundfont-fluid}/share/soundfonts/FluidR3_GM2-2.sf2 >/dev/null & + FLUID_PID=$! + + # Loop indefinitely: connect Minilab3 when it appears, reconnect if unplugged + while kill -0 "$FLUID_PID" 2>/dev/null; do + MINI=$(${pkgs.gawk}/bin/awk '/"Minilab3"/{print $2}' /proc/asound/seq/clients 2>/dev/null) + FLUID=$(${pkgs.gawk}/bin/awk '/FLUID Synth/{print $2}' /proc/asound/seq/clients 2>/dev/null) + if [ -n "$MINI" ] && [ -n "$FLUID" ]; then + if ${pkgs.alsa-utils}/bin/aconnect -l 2>/dev/null | grep -q "Connected From:.*$MINI"; then + : # already connected + else + echo "Connecting Minilab3 ($MINI) -> FluidSynth ($FLUID)" >&2 + ${pkgs.alsa-utils}/bin/aconnect "$MINI:0" "$FLUID:0" >&2 + fi + else + echo "Waiting: MINI='$MINI' FLUID='$FLUID'" >&2 + fi + ${pkgs.coreutils}/bin/sleep 2 + done + + wait $FLUID_PID + ''; + gameSaveBackupRoot = "${config.home.homeDirectory}/Backups/game-saves"; gameSaveLudusaviPath = "${gameSaveBackupRoot}/ludusavi"; gameSaveLutrisWinePrefix = "${config.home.homeDirectory}/Games/none"; @@ -346,6 +372,10 @@ in sageWithDoc evince poppler-utils + fluidsynth + soundfont-fluid + alsa-utils + spotify-player ]; home.file = { @@ -427,6 +457,20 @@ in ".config/wofi/menu.css".source = ../configs/wofi/menu.css; }; + systemd.user.services.fluidsynth = { + Unit = { + Description = "FluidSynth software MIDI synthesizer"; + After = [ "pipewire-pulse.service" ]; + }; + Service = { + Type = "simple"; + ExecStart = "${fluidsynthStart}"; + Restart = "on-failure"; + RestartSec = "5s"; + }; + Install.WantedBy = [ "default.target" ]; + }; + systemd.user.services.game-save-ludusavi-backup = { Unit.Description = "Back up game saves with Ludusavi"; Service = { diff --git a/hosts/NixOracle/configuration.nix b/hosts/NixOracle/configuration.nix index 57938a3..599d6e3 100644 --- a/hosts/NixOracle/configuration.nix +++ b/hosts/NixOracle/configuration.nix @@ -1,4 +1,4 @@ -{ pkgs, config, ... }: +{ pkgs, config, lib, ... }: let username = "ltadeu6"; sshAuthorizedKeys = [ @@ -36,7 +36,13 @@ in { ./hardware-configuration.nix ]; + nixpkgs.config.allowUnfreePredicate = pkg: + builtins.elem (lib.getName pkg) [ + "claude-code" + ]; + environment.systemPackages = with pkgs; [ + claude-code curl fd git @@ -47,6 +53,7 @@ in { ripgrep starship tmux + unstable.codex wget ];