mirror of
https://forgejo.merr.is/annika/nixos.git
synced 2025-12-11 13:01:01 -05:00
Tryint To Add spotifyd And SOPS
This commit is contained in:
parent
dd3dc90fa3
commit
cdf1c024c0
3 changed files with 58 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -6,5 +6,6 @@
|
|||
./firefox.nix
|
||||
./netbird.nix
|
||||
./prusa-slicer.nix
|
||||
./spotifyd.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
51
modules/common/applications/spotifyd.nix
Normal file
51
modules/common/applications/spotifyd.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue