working mpd and beet!

This commit is contained in:
Charlie Root 2024-07-14 13:31:28 +02:00
commit 090e8e3a9d
25 changed files with 659 additions and 16 deletions

79
modules/cli/beets.nix Normal file
View file

@ -0,0 +1,79 @@
{
config,
lib,
...
}: let
cfg = config.modules.programs.beets;
inherit (lib) mkIf mkEnableOption;
inherit (config.modules.other.system) username;
inherit (config.modules.services.mpd) musicDirectory;
in {
options.modules.programs.beets.enable = mkEnableOption "beets";
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.beets = {
enable = true;
settings = {
ui.color = true;
directory = musicDirectory;
library = "${musicDirectory}/musiclibrary.db";
clutter = [
"Thumbs.DB"
".DS_Store"
".directory"
];
plugins = [
# "acousticbrainz" # DEPRECATED
"mpdupdate"
"lyrics"
"thumbnails"
"fetchart"
"embedart"
"chroma"
"fromfilename"
"lastgenre"
#"absubmit" # DEPRECATED
"duplicates"
"edit"
#"mbcollection" # not set up yet
# "mbsync"
"replaygain"
"scrub"
];
import = {
move = true;
timid = true;
detail = true;
bell = true;
write = true;
};
mpd = {
host = "localhost";
port = 6600;
};
lyrics = {
auto = true;
};
thumbnails.auto = true;
fetchart.auto = true;
embedart = {
auto = true;
remove_art_file = true;
};
acousticbrainz.auto = true;
chroma.auto = true;
replaygain.backend = "gstreamer";
};
};
};
};
}

View file

@ -1 +1 @@
_: {imports = [./fish.nix ./nh.nix ./starship.nix];}
_: {imports = [./fish.nix ./nh.nix ./starship.nix ./beets.nix];}

View file

@ -15,10 +15,10 @@
# leap.enable = false;
# };
#
# preview = {
# glow.enable = true;
# markdownPreview.enable = true;
# };
preview = {
glow.enable = true;
markdownPreview.enable = true;
};
};
};
}

View file

@ -1,13 +1,11 @@
{config, ...}: let
inherit (config.modules.other.system) username;
in {
_: {
programs.neovim-flake.settings.vim = {
visuals = {
enable = true;
nvimWebDevicons.enable = true;
scrollBar.enable = false;
smoothScroll.enable = false;
cellularAutomaton.enable = false;
cellularAutomaton.enable = true;
highlight-undo.enable = true;
indentBlankline = {

View file

@ -14,7 +14,7 @@ _: {
#./vivado.nix
./steam.nix
./waybar.nix
./schizofox.nix
./schizofox
./minecraft.nix
# ./emacs
];

View file

@ -69,7 +69,7 @@ in {
};
cursor = {
style = "block";
blink = "true";
blink = "false";
};
mouse = {
hide-when-typing = "yes";

View file

@ -0,0 +1,146 @@
{
config,
inputs,
lib,
...
}: let
cfg = config.modules.programs.schizofox;
inherit (config.modules.other.system) username;
inherit (lib) mkEnableOption mkIf;
in {
options.modules.programs.schizofox = {enable = mkEnableOption "schizofox";};
config = mkIf cfg.enable {
home-manager.users.${username} = {
imports = [inputs.schizofox.homeManagerModule];
programs.schizofox = {
enable = true;
theme = {
# colors = {
# background-darker = "181825";
# background = "1e1e2e";
# foreground = "cdd6f4";
# };
colors = {
background-darker = "1d2021";
background = "282828";
foreground = "ebdbb2";
};
font = "Lexend";
extraUserChrome = ''
body {
color: red !important;
}
'';
};
search = {
defaultSearchEngine = "DuckDuckGo";
removeEngines = ["Google" "Bing" "Amazon.com" "eBay" "Twitter" "Wikipedia"];
addEngines = [
{
Name = "NixOS Packages";
Description = "NixOS Unstable package search";
Alias = "!np";
Method = "GET";
URLTemplate = "https://search.nixos.org/packages?channel=unstable&query={searchTerms}";
}
{
Name = "NixOS Options";
Description = "NixOS Unstable option search";
Alias = "!no";
Method = "GET";
URLTemplate = "https://search.nixos.org/options?channel=unstable&query={searchTerms}";
}
{
Name = "NixOS Wiki";
Description = "NixOS Wiki search";
Alias = "!nw";
Method = "GET";
URLTemplate = "https://nixos.wiki/index.php?search={searchTerms}";
}
{
Name = "Home Manager Options";
Description = "Home Manager option search";
Alias = "!hm";
Method = "GET";
URLTemplate = "https://home-manager-options.extranix.com/?query={searchTerms}&release=master";
}
{
Name = "Arch Wiki";
Description = "Arch Wiki search";
Alias = "!aw";
Method = "GET";
URLTemplate = "https://wiki.archlinux.org/index.php?search={searchTerms}";
}
{
Name = "Gentoo Wiki";
Description = "Gentoo Wiki search";
Alias = "!gw";
Method = "GET";
URLTemplate = "https://wiki.gentoo.org/index.php?search={searchTerms}";
}
{
Name = "Debian Wiki";
Description = "Debian Wiki search";
Alias = "!dw";
Method = "GET";
URLTemplate = "https://wiki.debian.org/FrontPage?action=fullsearch&value={searchTerms}";
}
{
Name = "noogle";
Descriptiom = "Noogle Search";
Alias = "!no";
Method = "GET";
URLTemplate = "https://noogle.dev/";
}
];
};
extensions = {
simplefox.enable = true;
darkreader.enable = true;
extraExtensions = let
mkUrl = name: "https://addons.mozilla.org/firefox/downloads/latest/${name}/latest.xpi";
extensions = [
{
id = "1018e4d6-728f-4b20-ad56-37578a4de76";
name = "flagfox";
}
{
id = "{c2c003ee-bd69-42a2-b0e9-6f34222cb046}";
name = "auto-tab-discard";
}
{
id = "{a4c4eda4-fb84-4a84-b4a1-f7c1cbf2a1ad}";
name = "refined-github-";
}
{
id = "sponsorBlocker@ajay.app";
name = "sponsorblock";
}
{
id = "uBlock0@raymondhill.net";
name = "UBlock Origin";
}
];
extraExtensions = builtins.foldl' (acc: ext: acc // {ext.id = {install_url = mkUrl ext.name;};}) {} extensions;
in
extraExtensions;
};
security = {
sanitizeOnShutdown = false;
sandbox = true;
userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0";
};
misc = {
drm.enable = true;
disableWebgl = true;
#startPageURL = "file://${./src}/index.html";
};
};
};
};
}

View file

@ -0,0 +1,26 @@
# Stolen from Raf, kinda
{
lib,
stdenvNoCC,
}: let
name = "schizofox-startpage";
version = "2023-12-29-unstable";
in
stdenvNoCC.mkDerivation {
inherit name version;
src = ./src;
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out
cp -rv $src/* $out
runHook postInstall
'';
meta = {
description = "My personal startpage";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [NotAShelf];
};
}

View file

@ -0,0 +1,17 @@
module.exports = {
env: {
es2021: true,
},
extends: "eslint:recommended",
overrides: [],
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
rules: {
indent: ["error", 4],
"linebreak-style": ["error", "unix"],
quotes: ["error", "double"],
semi: ["error", "always"],
},
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -0,0 +1,88 @@
<html>
<head>
<!--<link rel="shortcut icon" href="img\opera-multi-size.ico">-->
<link rel="stylesheet" type="text/css" href="style.css">
<title>Startpage</title>
</head>
<body>
<div id=stripe>
<div id="Title">notashelf@nyx ~ $ > ls</div>
<input
id="searchbox"
placeholder="Options: | -a | -h | -m | -w | -y |"
type="text"
autofocus="true"
autocomplete="true">
</input>
<div id=mainframe>
<div id=linkblock style="background-image:url(assets/planet.png)">
<ul>
<!-- General -->
<li><a href="https://google.com">> Google</a></li>
<li><a href="https://youtube.com">> Youtube</a></li>
<li><a href="https://monkeytype.com/">> Monkeytype</a></li>
</ul>
</div>
<div id=linkblock style="background-image:url(assets/flowers.png);">
<ul>
<!-- Social -->
<li><a href="https://twitter.com/">> Twitter</a></li>
<li><a href="https://web.telegram.org">> Telegram</a></li>
</ul>
</div>
<div id=linkblock style="background-image:url(assets/logs.png);">
<ul>
<!-- Reddit -->
<li><a href="https://www.reddit.com/r/android">> r/android</a></li>
<li><a href="https://www.reddit.com/r/sysadmin">> r/sysadmin</a></li>
<li><a href="https://www.reddit.com/r/linux">> r/linux</a></li>
<li><a href="https://www.reddit.com/r/unixporn">> r/unixporn</a></li>
<li><a href="https://www.reddit.com/r/hyprland">> r/hyprland</a></li>
</ul>
</div>
<div id=linkblock style="background-image:url(assets/blossom.png);">
<ul>
<!-- 4chan -->
<li><a href="https://www.4chan.org/a/">> /a/</a></li>
<li><a href="https://www.4chan.org/ck/">> /ck/</a></li>
<li><a href="https://www.4chan.org/g/">> /g/</a></li>
<li><a href="https://www.4chan.org/w/">> /w/</a></li>
<li><a href="https://www.4chan.org/wg/">> /wg/</a></li>
</ul>
</div>
<div id=linkblock style="background-image:url(assets/malachite.png);">
<ul>
<!-- Dev -->
<li><a href="https://github.com">> Github</a></li>
<li><a href="http://forum.xda-developers.com">> XDA Developers</a></li>
<li><a href="https://www.archlinux.org/">> Archwiki</a></li>
<li><a href="https://go.dev/doc/">> Golang Docs</a></li>
<li><a href="https://crates.io/">> Crate Registry</a></li>
</ul>
</div>
<div id=linkblock style="background-image:url(assets/sway.png);">
<!-- Nix -->
<ul>
<li>
<a href="https://nixos.org/manual/nixos/unstable/">> NixOS Manual</a>
</li>
<li>
<a href="https://nixos.org/manual/nixpkgs/ustable/">> Nixpkgs Manual</a>
</li>
<li>
<a href="https://nixos.org/manual/nix/unstable/">> Nix Manual</a>
</li>
<li>
<a href="https://noogle.dev/">> noogle</a>
</li>
</ul>
</div>
</div>
</div>
<div id=footer>
<a href="secondary.html">o</a>
</div>
</body>
<script src="search.js" type="text/javascript"></script>
</html>

View file

@ -0,0 +1,78 @@
String.prototype.replaceChars = function (character, replacement) {
return this.split(character).join(replacement);
};
function search(query) {
const searchPrefix = query.substring(0, 2);
query = query.substring(3);
switch (searchPrefix) {
case "-a":
window.location = `http://www.amazon.com/s/ref=nb_sb_noss_1?url=search-alias%3Daps&field-keywords=${query.replaceChars(
" ",
"+",
)}`;
break;
case "-y":
window.location = `https://www.youtube.com/results?search_query=${query.replaceChars(
" ",
"+",
)}`;
break;
case "-w":
window.location = `https://en.wikipedia.org/w/index.php?search=${query.replaceChars(
" ",
"%20",
)}`;
break;
case "-m":
window.location = `http://www.wolframalpha.com/input/?i=${query.replaceChars(
"+",
"%2B",
)}`;
break;
case "-h":
window.location = `http://alpha.wallhaven.cc/search?q=${query}&categories=111&purity=100&resolutions=1920x1080&sorting=relevance&order=desc`;
break;
default:
window.location = `https://search.notashelf.dev/search?q=${query.replaceChars(
" ",
"+",
)}&categories=general`;
}
}
window.onload = function () {
const searchInput = document.getElementById("searchbox");
if (searchInput) {
searchInput.addEventListener("keypress", function (event) {
if (event.keyCode === 13) {
search(this.value);
}
});
}
};
//
// To add a new search provider, paste the following between the last "break;" and "default:" (Line 39 & 40)
//
// case "-a":
// query = query.substr(3);
// window.location =
// "https://en.website.com/" +
// query.replaceChars(" ", "%20");
// break;
//
// -a on ln68 should be replaced with a "-letter" of your choice. You can also change it to !a, .a, /a etc.
// https://en.website.com/ on ln70 should be replaced with the search page of the website. To find this, make a few searches on your website.
//Try to identify where your search is in the URL. If you're not sure, post in the thread and someone should help you out
//
// You can use the above two to modify an existing rule
//
// If you wish to change the number of characters in a "case", you need to change the line below, changing query.substr() to n+1, n being the number of characters.
// This ensures that when you search for something, the whole of your idenfier and the space between the identifier and query are removed.

View file

@ -0,0 +1,130 @@
body {
background-color: #11111b;
color: #cdd6f4;
}
#Title {
font-family: "Malgun Gothic";
text-align: center;
color: #cdd6f4;
margin-top: 75px;
}
#searchbox {
width: 500;
height: 4%;
border: none;
border-radius: 2px;
outline: none;
padding-left: 15px;
text-align: left;
background-color: #1e1e2e;
color: #cdd6f4;
font-size: 15px;
font-family: "Malgun Gothic", sans-serif;
display: block;
margin: auto;
margin-top: 50px;
}
#stripe {
width: 100%;
vertical-align: middle;
}
#mainframe {
text-align: center;
position: absolute;
top: 25%;
left: 16%;
right: 11%;
}
#footer {
position: absolute;
bottom: 0;
right: 0;
text-align: right;
padding: 10px;
font-size: 30%;
}
#linkblock {
width: 20%;
height: 140px;
margin-left: 25px;
margin-right: 30px;
margin-top: 30px;
margin-bottom: 40px;
padding-left: 67px;
padding-right: 1px;
padding-top: 0px;
padding-bottom: 5px;
color: #cdd6f4;
text-align: left;
background-position: top 0px left 0px;
background-repeat: no-repeat;
font-family: "Malgun Gothic";
font-size: 100%;
display: inline-block;
vertical-align: top;
border-left: 3px solid #181825;
transition: 0.5s;
}
ul {
list-style-type: none;
padding-left: 0;
}
a:link {
text-decoration: none;
font-weight: normal;
color: #89b4fa;
}
a:visited {
text-decoration: none;
font-weight: normal;
color: #89b4fa;
}
a:hover {
text-decoration: none;
font-weight: normal;
color: #b4befe;
}
a:active {
text-decoration: none;
font-weight: normal;
color: #89b4fa;
}
a:focus {
text-decoration: none;
font-weight: normal;
color: #89b4fa;
}
#footer a:link {
text-decoration: none;
font-weight: normal;
color: #101010;
}
#footer a:visited {
text-decoration: none;
font-weight: normal;
color: #101010;
}
#footer a:hover {
text-decoration: none;
font-weight: normal;
color: #101010;
}
#footer a:active {
text-decoration: none;
font-weight: normal;
color: #101010;
}
#footer a:focus {
text-decoration: none;
font-weight: normal;
color: #101010;
}

View file

@ -28,10 +28,10 @@ in {
user = username;
extraConfig = ''
user "${username}"
playlist_directory "${cfg.musicDirectory}/.playlists"
restore_paused "yes"
follow_outside_symlinks "yes"
follow_inside_symlinks "yes"
volume_normalization "yes"
audio_output {
type "pipewire"

View file

@ -12,7 +12,7 @@ in {
hardware.pulseaudio.enable = false;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.enable = true; # TODO Do I need this?
pulse.enable = true;
};
security.rtkit.enable = true;

View file

@ -13,12 +13,91 @@ in {
config = mkIf cfg.enable {
home-manager.users.${username} = {
#xdg.configFile."ncmpcpp/config".source = ./config;
programs.ncmpcpp = {
enable = true;
package = pkgs.ncmpcpp.override {visualizerSupport = true;};
mpdMusicDir = "${musicDirectory}";
bindings = [
{
key = "j";
command = "scroll_down";
}
{
key = "k";
command = "scroll_up";
}
{
key = "J";
command = ["select_item" "scroll_down"];
}
{
key = "K";
command = ["select_item" "scroll_up"];
}
];
settings = {
# Miscelaneous
ignore_leading_the = true;
external_editor = "nvim";
message_delay_time = 1;
playlist_disable_highlight_delay = 2;
autocenter_mode = "yes";
centered_cursor = "yes";
allow_for_physical_item_deletion = "no";
lines_scrolled = "0";
follow_now_playing_lyrics = "yes";
lyrics_fetchers = "musixmatch";
connected_message_on_startup = "no";
mouse_support = "yes";
# visualizer
visualizer_data_source = "/tmp/mpd.fifo";
visualizer_output_name = "mpd_visualizer";
visualizer_type = "ellipse";
visualizer_look = " ";
visualizer_color = "blue, green";
# appearance
colors_enabled = "yes";
browser_playlist_prefix = "$2 $5 ";
playlist_display_mode = "classic";
user_interface = "classic";
volume_color = "white";
# window
song_window_title_format = "Music";
statusbar_visibility = "no";
header_visibility = "no";
titles_visibility = "no";
# progress bar
progressbar_look = "";
progressbar_color = "black";
progressbar_elapsed_color = "blue";
# song list
song_status_format = "$7%t";
song_list_format = "$(008)%t$R $(247)%a$R$5 %l$8";
song_columns_list_format = "(53)[blue]{tr} (45)[blue]{a}";
current_item_prefix = "$b$2| ";
current_item_suffix = "$/b$5";
now_playing_prefix = "$b$5| ";
now_playing_suffix = "$/b$5";
song_library_format = "{{%a - %t} (%b)}|{%f}";
# colors
main_window_color = "blue";
current_item_inactive_column_prefix = "$b$5";
current_item_inactive_column_suffix = "$/b$5";
color1 = "white";
color2 = "blue";
/*
alternative_header_first_line_format = "$5{$b%t$/b}$9";
alternative_header_second_line_format = "$3by $7{$b%a$/b}$9 $3from $7{$b%b$/b}$9 $5{(%y)}";
song_list_format = " $2%n$(end) $9 $3%a$(end) $(245)-$9 $(246)%t$9 $R{ $5%y$9}$(end) $(246)%lq$(end)";
@ -77,6 +156,7 @@ in {
visualizer_data_source = "/tmp/mpd.fifo";
visualizer_type = "wave_filled";
visualizer_look = "";
*/
};
};
};

View file

@ -5,7 +5,7 @@
}:
with lib; let
cfg = config.modules.programs.yazi;
username = config.modules.other.system.username;
inherit (config.modules.other.system) username;
in {
options.modules.programs.yazi = {enable = mkEnableOption "yazi";};