Update flake, fix OBS issues, prune flatpaks, add unstable packages list, add Spotify config:
Some checks are pending
SSH and echo to file / ssh (push) Waiting to run

- Update flake to get most recent versions of librespot, spotify-player
- Add obs-toggle-recording script, wrap OBS with nixGL
- Prune flatpaks: Bottles, Chromium, Gnome Platform, Zoom, Kontact, Neochat
- Add unstable packages: librespot, fzf, deploy-rs
- Create librespot Systemd unit, enable spotify-player.
This commit is contained in:
Joey Hafner 2024-10-23 15:33:37 -07:00
parent 7aa42a7ae8
commit b83b70cb23
No known key found for this signature in database
5 changed files with 156 additions and 41 deletions

View File

@ -194,11 +194,11 @@
]
},
"locked": {
"lastModified": 1727383923,
"narHash": "sha256-4/vacp3CwdGoPf8U4e/N8OsGYtO09WTcQK5FqYfJbKs=",
"lastModified": 1729551526,
"narHash": "sha256-7LAGY32Xl14OVQp3y6M43/0AtHYYvV6pdyBcp3eoz0s=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "ffe2d07e771580a005e675108212597e5b367d2d",
"rev": "5ec753a1fc4454df9285d8b3ec0809234defb975",
"type": "github"
},
"original": {
@ -230,11 +230,11 @@
},
"nix-flatpak": {
"locked": {
"lastModified": 1721549352,
"narHash": "sha256-nlXJa8RSOX0kykrIYW33ukoHYq+FOSNztHLLgqKwOp8=",
"lastModified": 1729453639,
"narHash": "sha256-L19R5CXCfTU9IFs9FAaYhDiteegfhJQMiAHLfls4Pdw=",
"owner": "gmodena",
"repo": "nix-flatpak",
"rev": "dbce39ea8664820ba9037caaf1e2fad365ed6b4b",
"rev": "68bc646058386e2ffbd9d78d79d6558e684f6b8c",
"type": "github"
},
"original": {
@ -280,11 +280,11 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1725762081,
"narHash": "sha256-vNv+aJUW5/YurRy1ocfvs4q/48yVESwlC/yHzjkZSP8=",
"lastModified": 1729357638,
"narHash": "sha256-66RHecx+zohbZwJVEPF7uuwHeqf8rykZTMCTqIrOew4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "dc454045f5b5d814e5862a6d057e7bb5c29edc05",
"rev": "bb8c2cf7ea0dd2e18a52746b2c3a5b0c73b93c22",
"type": "github"
},
"original": {
@ -296,11 +296,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1727348695,
"narHash": "sha256-J+PeFKSDV+pHL7ukkfpVzCOO7mBSrrpJ3svwBFABbhI=",
"lastModified": 1729413321,
"narHash": "sha256-I4tuhRpZFa6Fu6dcH9Dlo5LlH17peT79vx1y1SpeKt0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1925c603f17fc89f4c8f6bf6f631a802ad85d784",
"rev": "1997e4aa514312c1af7e2bda7fad1644e778ff26",
"type": "github"
},
"original": {
@ -327,11 +327,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1727264057,
"narHash": "sha256-KQPI8CTTnB9CrJ7LrmLC4VWbKZfljEPBXOFGZFRpxao=",
"lastModified": 1729449015,
"narHash": "sha256-Gf04dXB0n4q0A9G5nTGH3zuMGr6jtJppqdeljxua1fo=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "759537f06e6999e141588ff1c9be7f3a5c060106",
"rev": "89172919243df199fe237ba0f776c3e3e3d72367",
"type": "github"
},
"original": {
@ -351,11 +351,11 @@
]
},
"locked": {
"lastModified": 1727463368,
"narHash": "sha256-5glMknkwQejUrKy28iy/kCFlSMwHcVyf/whmxqD0ggk=",
"lastModified": 1729372184,
"narHash": "sha256-Tb2/jJ74pt0nmfprkOW1g5zZphJTNbzLnyDENM+c5+I=",
"owner": "nix-community",
"repo": "plasma-manager",
"rev": "29ad64f0ac4ae84710dfeb1d37572d95c94cbfd8",
"rev": "9390dadadc58ffda8e494b31ef66a4ae041f6dd1",
"type": "github"
},
"original": {
@ -385,11 +385,11 @@
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1727734513,
"narHash": "sha256-i47LQwoGCVQq4upV2YHV0OudkauHNuFsv306ualB/Sw=",
"lastModified": 1729587807,
"narHash": "sha256-YOc4033a/j1TbdLfkaSOSX2SrvlmuM+enIFoveNTCz4=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "3198a242e547939c5e659353551b0668ec150268",
"rev": "26642e8f193f547e72d38cd4c0c4e45b49236d27",
"type": "github"
},
"original": {
@ -417,11 +417,11 @@
"tinted-tmux": "tinted-tmux"
},
"locked": {
"lastModified": 1727362643,
"narHash": "sha256-Ceiq/aYjRlRBU677lBaemn8ZU2Jpr08Iso6UlBc9nFc=",
"lastModified": 1729380793,
"narHash": "sha256-TV6NYBUqTHI9t5fqNu4Qyr4BZUD2yGxAn3E+d5/mqaI=",
"owner": "danth",
"repo": "stylix",
"rev": "e3eb7fdf8d129ff3676dfbc84ee1262322ca6fb4",
"rev": "fb9399b7e2c855f42dae76a363bab28d4f24aa8d",
"type": "github"
},
"original": {
@ -479,16 +479,17 @@
"tinted-kitty": {
"flake": false,
"locked": {
"lastModified": 1665001328,
"narHash": "sha256-aRaizTYPpuWEcvoYE9U+YRX+Wsc8+iG0guQJbvxEdJY=",
"lastModified": 1716423189,
"narHash": "sha256-2xF3sH7UIwegn+2gKzMpFi3pk5DlIlM18+vj17Uf82U=",
"owner": "tinted-theming",
"repo": "tinted-kitty",
"rev": "06bb401fa9a0ffb84365905ffbb959ae5bf40805",
"rev": "eb39e141db14baef052893285df9f266df041ff8",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "tinted-kitty",
"rev": "eb39e141db14baef052893285df9f266df041ff8",
"type": "github"
}
},

View File

@ -1,6 +1,10 @@
{ config, pkgs, pkgs-unstable, inputs, ... }:
{
imports = [
./unstable.nix
./python.nix
./scripts.nix
];
sops = {
age.sshKeyPaths = [ "/home/joey/.ssh/main_id_ed25519" ];
defaultSopsFile = ./secrets.yaml;
@ -51,14 +55,11 @@
{ name = "fedora"; location = "oci+https://registry.fedoraproject.org"; }
];
packages = [
"com.usebottles.bottles/x86_64/stable"
"dev.vencord.Vesktop/x86_64/stable"
"io.github.zen_browser.zen/x86_64/stable"
"io.missioncenter.MissionCenter/x86_64/stable"
"md.obsidian.Obsidian/x86_64/stable"
"no.mifi.losslesscut/x86_64/stable"
"org.chromium.Chromium/x86_64/stable"
"org.chromium.Chromium.Codecs/x86_64/stable"
"org.freedesktop.Platform/x86_64/22.08"
"org.freedesktop.Platform/x86_64/23.08"
"org.freedesktop.Platform/x86_64/24.08"
@ -75,8 +76,6 @@
"org.freedesktop.Platform.openh264/x86_64/2.2.0"
"org.freedesktop.Platform.openh264/x86_64/2.4.1"
"org.freedesktop.Sdk/x86_64/23.08"
"org.gnome.Platform/x86_64/45"
"org.gnome.Platform/x86_64/46"
"org.gnome.Platform/x86_64/47"
"org.gnome.Platform.Compat.i386/x86_64/46"
"org.gtk.Gtk3theme.Breeze/x86_64/3.22"
@ -97,12 +96,9 @@
"org.winehq.Wine.DLLs.dxvk/x86_64/stable-23.08"
"org.winehq.Wine.gecko/x86_64/stable-23.08"
"org.winehq.Wine.mono/x86_64/stable-23.08"
"us.zoom.Zoom/x86_64/stable"
"xyz.z3ntu.razergenie/x86_64/stable"
{ appId = "org.fedoraproject.Platform/x86_64/f40"; origin = "fedora"; }
{ appId = "org.gimp.GIMP/x86_64/stable"; origin = "fedora"; }
{ appId = "org.kde.kontact/x86_64/stable"; origin = "fedora"; }
{ appId = "org.kde.neochat/x86_64/stable"; origin = "fedora"; }
{ appId = "org.fedoraproject.KDE6Platform/x86_64/f40"; origin = "fedora"; }
{ appId = "org.fedoraproject.Platform/x86_64/f40"; origin = "fedora"; }
];
@ -112,9 +108,10 @@
package = pkgs.vscodium;
extensions = with pkgs.vscode-extensions; [
jnoortheen.nix-ide
continue.continue
#continue.continue
];
userSettings = {
"editor.fontFamily" = "'DejaVu Sans Mono'";
"nix.serverPath" = "nixd";
"nix.enableLanguageServer" = true;
"explorer.confirmDragAndDrop" = false;
@ -133,7 +130,12 @@
obs-vaapi
obs-vkcapture
input-overlay
wlrobs
];
package = pkgs.writeShellScriptBin "obs" ''
#!/bin/sh
${pkgs-unstable.nixgl.nixVulkanIntel}/bin/nixVulkanIntel ${pkgs-unstable.obs-studio}/bin/obs "$@"
'';
};
programs.git = {
enable = true;
@ -174,7 +176,7 @@
fetch = "fastfetch";
neofetch = "fetch";
find = ''fzf --preview "bat --color=always --style=numbers --line-range=:500 {}"'';
hmu = "home-manager switch ~/.config/home-manager";
hmu = "home-manager switch -b backup --flake ~/Git/Jafner.net/nix/dungeon-master/home-manager/ --impure";
kitty = "nixGL kitty";
fzf-ssh = "ssh $(cat ~/.ssh/profiles | fzf --height 20%)";
fsh = "fzf-ssh";
@ -248,7 +250,23 @@
programs.rofi = {
enable = true;
};
systemd.user.services = {};
programs.spotify-player = {
enable = true;
package = pkgs-unstable.spotify-player;
};
systemd.user.services = {
librespot = {
Unit = {
Description = "Librespot (an open source Spotify client)";
Documentation = [ "https://github.com/librespot-org/librespot" "https://github.com/librespot-org/librespot/wiki/Options" ];
};
Service = {
Restart = "always";
RestartSec = 10;
ExecStart = "${pkgs-unstable.librespot}/bin/librespot --backend pulseaudio --system-cache /home/joey/.spotify -j";
};
};
};
home.enableNixpkgsReleaseCheck = false;
home.preferXdgDirectories = true;
home.username = "joey";
@ -268,8 +286,6 @@
base16-schemes
ollama
protonup-ng
pkgs-unstable.fzf
inputs.deploy-rs.defaultPackage.x86_64-linux
];
home.file = {
"continue-config.json" = {

View File

@ -0,0 +1,64 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
### Python script that uses OBS-Studio's websocket to toggle recording when a hotkey is pressed.
( writers.writePython3Bin "obs-toggle-recording" {
libraries = [
( python311Packages.buildPythonPackage {
pname = "obsws_python";
version = "1.7.0";
src = fetchurl {
url = "https://files.pythonhosted.org/packages/22/29/dcb5286c9301eee8b72aee1e997761fb2cca9bf963fcd373acdfca353af3/obsws_python-1.7.0-py3-none-any.whl";
sha256 = "0jvqfvqgvqjsv0jsddj51m4wrinbrc2gbymmnmv9kfarfj7ly7g7";
};
format = "wheel";
doCheck = false;
buildInputs = [];
checkInputs = [];
nativeBuildInputs = [];
propagatedBuildInputs = [
( python311Packages.buildPythonPackage {
pname = "tomli";
version = "2.0.2";
src = fetchurl {
url = "https://files.pythonhosted.org/packages/cf/db/ce8eda256fa131af12e0a76d481711abe4681b6923c27efb9a255c9e4594/tomli-2.0.2-py3-none-any.whl";
sha256 = "0f5ar8vfq7lkydj19am5ymxg11d00ql0kv5hj3v07lskbi429gif";
};
format = "wheel";
doCheck = false;
buildInputs = [];
checkInputs = [];
nativeBuildInputs = [];
propagatedBuildInputs = [];
} )
( python311Packages.buildPythonPackage {
pname = "websocket-client";
version = "1.8.0";
src = fetchurl {
url = "https://files.pythonhosted.org/packages/5a/84/44687a29792a70e111c5c477230a72c4b957d88d16141199bf9acb7537a3/websocket_client-1.8.0-py3-none-any.whl";
sha256 = "09m5pwwi4bbwdv2vdhlc5k0737kskhnxyb5j17l9ii7mjz4lrd0p";
};
format = "wheel";
doCheck = false;
buildInputs = [];
checkInputs = [];
nativeBuildInputs = [];
propagatedBuildInputs = [];
} )
];
} )
];
} ''
import obsws_python as obs
client = obs.ReqClient(host='localhost', port=4455)
recording_status = client.get_record_status()
active = recording_status.output_active
paused = recording_status.output_paused
if not active:
client.start_record()
else:
client.toggle_record_pause()
'' )
];
}

View File

@ -0,0 +1,26 @@
{ pkgs, ... }:{
home.packages = with pkgs; [
ffmpeg_7-full
( writeShellApplication {
name = "send-to-x264-mp4"; # { filePath }: { none } (side-effect: transcodes & remuxes file to x264/mp4)
runtimeInputs = [
libnotify
];
text = ''
INPUT_FILE=$(realpath "$1")
FILE_PATH=$(dirname "$INPUT_FILE")
FILE_NAME=$(basename "$INPUT_FILE")
FILE_NAME="''${''\FILE_NAME%.*}"
OUTFILE="$FILE_PATH/$FILE_NAME.mp4"
notify-send -t 2000 "Transcode starting" "$FILE_NAME"
nixGL ffmpeg -hide_banner -vaapi_device /dev/dri/renderD128 -i "$INPUT_FILE" -map 0 -vf 'format=nv12,hwupload' -c:v h264_vaapi -b:v 8M -c:a copy "$OUTFILE"
notify-send -t 4000 "Transcode complete" "$FILE_NAME"
'';
} )
];
}

View File

@ -0,0 +1,8 @@
{ pkgs-unstable, inputs, ... }:
{
home.packages = [
pkgs-unstable.librespot
pkgs-unstable.fzf
inputs.deploy-rs.defaultPackage.x86_64-linux
];
}