Tryint To Add spotifyd And SOPS

This commit is contained in:
Annika Merris 2024-05-19 19:33:20 -04:00
parent dd3dc90fa3
commit cdf1c024c0
3 changed files with 58 additions and 0 deletions

View file

@ -54,6 +54,11 @@ inputs.nixpkgs.lib.nixosSystem {
# Theming?
sops = {
defaultSopsFile = ../../secrets/secrets.yaml;
defaultSopsFormat = "yaml";
age.keyFile = "/home/annika/.config/sops/age/keys.txt";
};
# TODO: Temporary, remove eventually!
networking.networkmanager.enable = true;
@ -104,6 +109,7 @@ inputs.nixpkgs.lib.nixosSystem {
firefox.enable = true;
netbird.enable = true;
prusa-slicer.enable = true;
spotifyd.enable = true;
# Programming Stuff
nixpkgs-fmt.enable = true;
vscode.enable = true;

View file

@ -6,5 +6,6 @@
./firefox.nix
./netbird.nix
./prusa-slicer.nix
./spotifyd.nix
];
}

View file

@ -0,0 +1,51 @@
{ config, pkgs, lib, ... }:
{
options = {
spotifyd = {
enable = lib.mkEnableOption {
description = "Enable spotifyd";
default = false;
};
};
};
config = lib.mkIf (config.spotifyd.enable) {
home-manager.users.${config.user} = {
home.packages = [
pkgs.spotifyd
];
};
};
sops = {
secrets."spotifyd/settings/global/password" = { };
templates = {
"spotifyd.conf" = {
owner = "annika";
content = ''
[global]
username = "me@annikamerris.com"
password = "${config.sops.placeholder."spotifyd/settings/global/password"}"
use_mpris = true
device_name = "kim-nix"
device_type = "computer"
'';
};
};
};
# Install and setup spotifyd
# sops.templates.
systemd.user.services.spotifyd = {
description = "spotify daemon";
documentation = [ "https://github.com/Spotifyd/spotifyd" ];
wantedBy = [ "default.target" ];
serviceConfig = {
ExecStart =
"${pkgs.spotifyd}/bin/spotifyd --no-daemon --config-path ${config.sops.templates."spotifyd.conf".path}";
Restart = "always";
RestartSec = 12;
};
};
}