Compare commits
No commits in common. "526783f07a05093fab2cd437af4b2681d7b7393a" and "e47078d7d70f90349f81b260172fb7cb4ca54229" have entirely different histories.
526783f07a
...
e47078d7d7
|
@ -36,25 +36,7 @@ in
|
|||
nix-edit.enable = mkDefault true;
|
||||
nvim.enable = mkDefault true;
|
||||
python.versions."311".enable = mkDefault true;
|
||||
spotify-player = {
|
||||
enable = mkDefault true;
|
||||
package = pkgs.spotify-player.overrideAttrs (old: {
|
||||
buildFeatures = lib.lists.remove "notify" (old.buildFeatures or [ ]);
|
||||
});
|
||||
config = {
|
||||
client_id = "3172dbeaf64949728920c58b823bc24b";
|
||||
copy_command = {
|
||||
command = "wl-copy";
|
||||
args = [ ];
|
||||
};
|
||||
enable_cover_image_cache = true;
|
||||
default_device = "spotify-player-daemon";
|
||||
enable_streaming = false;
|
||||
playback_window_position = "Bottom";
|
||||
cover_img_length = 20;
|
||||
cover_img_width = 10;
|
||||
};
|
||||
};
|
||||
spotify.enable = mkDefault true;
|
||||
ssh.enable = mkDefault true;
|
||||
thunar.enable = mkDefault true;
|
||||
wallpaper.enable = mkDefault true;
|
||||
|
@ -65,19 +47,6 @@ in
|
|||
gammastep.enable = true;
|
||||
kdeconnect.enable = mkDefault true;
|
||||
printing.enable = true;
|
||||
spotify-player = {
|
||||
enable = mkDefault true;
|
||||
config = {
|
||||
client_id = "3172dbeaf64949728920c58b823bc24b";
|
||||
device = {
|
||||
name = "spotify-player-daemon";
|
||||
device_type = "computer";
|
||||
volume = 70;
|
||||
bitrate = 320;
|
||||
audio_cache = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
wireguard.enable = true;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -269,13 +269,33 @@ with builtins;
|
|||
plugin = telekasten-nvim;
|
||||
dependencies = [
|
||||
{ plugin = telescope-nvim; }
|
||||
{ plugin = which-key-nvim; }
|
||||
];
|
||||
cmd = [ "Telekasten" ];
|
||||
keys = [
|
||||
{ key = "<leader>z"; cmd = "<cmd>Telekasten<cr>"; desc = "zettelkasten"; }
|
||||
];
|
||||
conf = builtins.readFile ./zettelkasten-nvim.lua;
|
||||
conf = ''
|
||||
require("telekasten").setup({
|
||||
home = vim.fn.expand("~/Nextcloud/Notes/zettelkasten"),
|
||||
auto_set_filetype = false,
|
||||
image_subdir = "assets",
|
||||
})
|
||||
vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile" }, {
|
||||
pattern = "*/zettelkasten/*",
|
||||
callback = function(event)
|
||||
vim.api.nvim_buf_set_keymap(0, "n", "<CR>", "", {
|
||||
callback = function()
|
||||
local current_word = vim.fn.expand("<cWORD>")
|
||||
if vim.fn.match(current_word, "[[") == 0 then
|
||||
require("telekasten").follow_link()
|
||||
else
|
||||
require("telekasten").toggle_todo()
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
})
|
||||
'';
|
||||
}
|
||||
{
|
||||
plugin = markdown-preview-nvim;
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
local telekasten = require("telekasten")
|
||||
telekasten.setup({
|
||||
home = vim.fn.expand("~/Nextcloud/Notes/zettelkasten"),
|
||||
auto_set_filetype = false,
|
||||
image_subdir = "assets",
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile" }, {
|
||||
pattern = "*/zettelkasten/*",
|
||||
callback = function(_)
|
||||
require("which-key").register({
|
||||
g = {
|
||||
f = { telekasten.follow_link, "Follow link" },
|
||||
r = { telekasten.show_backlinks, "Show backlinks" },
|
||||
},
|
||||
["<leader>"] = {
|
||||
f = {
|
||||
f = { telekasten.find_notes, "Find note" },
|
||||
n = { telekasten.new_note, "New note" },
|
||||
},
|
||||
s = {
|
||||
g = { telekasten.search_note, "Grep notes" },
|
||||
},
|
||||
},
|
||||
}, { buffer = vim.fn.bufnr("%") })
|
||||
end,
|
||||
})
|
|
@ -1,33 +0,0 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.programs.spotify-player;
|
||||
toml = pkgs.formats.toml { };
|
||||
in
|
||||
{
|
||||
options.my.programs.spotify-player = {
|
||||
enable = mkEnableOption "spotify-player";
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.spotify-player;
|
||||
};
|
||||
config = mkOption {
|
||||
inherit (toml) type;
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.moritz = {
|
||||
xdg.configFile."spotify-player/app.toml" = {
|
||||
source = toml.generate "app.toml" cfg.config;
|
||||
};
|
||||
home.packages = [ cfg.package ];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
toml = pkgs.formats.toml { };
|
||||
cfg = config.my.services.spotify-player;
|
||||
|
||||
tomlConfig =
|
||||
if cfg.configFile != null
|
||||
then cfg.configFile
|
||||
else toml.generate "app.toml" cfg.config;
|
||||
|
||||
configFolder = pkgs.runCommand "spotify-player-config" { } ''
|
||||
mkdir $out
|
||||
ln -s "${tomlConfig}" $out/app.toml
|
||||
'';
|
||||
in
|
||||
{
|
||||
options.my.services.spotify-player = {
|
||||
enable = mkEnableOption "spotify_player";
|
||||
config = mkOption {
|
||||
inherit (toml) type;
|
||||
default = { };
|
||||
};
|
||||
configFile = mkOption {
|
||||
type = with types; nullOr path;
|
||||
default = null;
|
||||
};
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.spotify-player;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion = cfg.config == { } || cfg.configFile == null;
|
||||
message = "At least one of the options 'config' or 'configFile' must be set.";
|
||||
}
|
||||
{
|
||||
assertion = cfg.config != { } || cfg.configFile != null;
|
||||
message = "Only one of the options 'config' or 'configFile' may be set.";
|
||||
}
|
||||
];
|
||||
systemd.user.services.spotify-player = {
|
||||
after = [ "graphical-session.target" "network.target" ];
|
||||
partOf = [ "graphical-session.target" ];
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
serviceConfig = {
|
||||
Type = "forking";
|
||||
Restart = "always";
|
||||
RestartSec = "1s";
|
||||
ExecStart = "${getExe cfg.package} --daemon --config-folder ${configFolder}";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue