restructured config directory

This commit is contained in:
Thilo Billerbeck 2023-10-28 23:16:29 +02:00
parent 0ea46ec3a4
commit e615e06990
43 changed files with 583 additions and 0 deletions

1
home-manager/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
home.nix

2
home-manager/dotfiles/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
.devenv*
.direnv*

View file

@ -0,0 +1,94 @@
Host db2
HostName tg.dm.informatik.tu-darmstadt.de
Port 9022
User tbillerbeck
Host *
ForwardAgent no
ForwardX11 no
ForwardX11Trusted yes
User thilo
Port 22
ServerAliveInterval 60
ServerAliveCountMax 30
Host 158.101.179.53
IdentityFile ~/.ssh/id_thilo-billerbeck-com
Host burns matrix
HostName burns.thilo-billerbeck.com
Host lisa bart burns homer marge
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_github-com
IdentitiesOnly yes
Host *.thilo-billerbeck.com
User root
IdentityFile ~/.ssh/id_thilo-billerbeck-com
Host krusty.thilo-billerbeck.com
User opc
AddressFamily inet
Host skinner.thilo-billerbeck.com
User opc
Host 130.61.97.198
User opc
IdentityFile ~/.ssh/id_thilo-billerbeck-com
Host avocadoom.de
User thilo
IdentityFile ~/.ssh/id_thilo-billerbeck-com
Host *.avocadoom.de
User thilo
IdentityFile ~/.ssh/id_thilo-billerbeck-com
Host *.officerent.de
User thilo
IdentityFile ~/.ssh/id_thilo-billerbeck-com
Host mail
HostName mail.officerent.de
Host *.tu-darmstadt.de
IdentityFile ~/.ssh/id_tu-darmstadt-de
Host *.rwth-aachen.de
IdentityFile ~/.ssh/id_tu-darmstadt-de
Host *.tobias-neidig.de
IdentityFile ~/.ssh/id_tobias-neidig-de
Host *.darmstadt.ccc.de
IdentityFile ~/.ssh/id_darmstadt-ccc-de
Host ssh.dev.azure.com
IdentityFile ~/.ssh/id_azure-com
IdentitiesOnly yes
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa
Host 192.168.50.54
User thilo
IdentityFile ~/.ssh/id_avocadoom-laptop
Host *.tailscale.net
User thilo
IdentityFile ~/.ssh/id_tailscale
Host digitaltwinservice.de
User tb12zysu
IdentityFile ~/.ssh/id_digitaltwinservice-de
Host thilo-pc
HostName thilo-pc.thilobillerbeck.github.beta.tailscale.net
Host *.relaix.net
User tbillerbeck
IdentityFile ~/.ssh/id_relaix-net

22
home-manager/install.sh Normal file
View file

@ -0,0 +1,22 @@
#/bin/bash -e
# Install nix
sh <(curl -L https://nixos.org/nix/install) --no-daemon
source $HOME/.nix-profile/etc/profile.d/nix.sh
# Install home-manager
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
# Install nixgl
nix-channel --add https://github.com/guibou/nixGL/archive/main.tar.gz nixgl
nix-channel --update
nix-shell '<home-manager>' -A install
# use my home-manager config
rm -rf ~/.config/home-manager
git clone https://git.thilo-billerbeck.com/thilobillerbeck/home-manager.git ~/.config/home-manager
# switch configs
home-manager switch

View file

@ -0,0 +1,18 @@
{ config, pkgs, lib, ... }:
{
imports = [
./../modules/machine.nix
];
machine = {
username = "thilo";
isGeneric = false;
isGnome = false;
noiseSuppression.enable = true;
isGraphical = true;
};
services.kdeconnect.enable = true;
services.kdeconnect.indicator = true;
}

View file

@ -0,0 +1,20 @@
{ config, pkgs, lib, ... }:
let
chromeArgs = lib.strings.concatStringsSep " " [
"--force-dark-mode"
"--enable-features=WebUIDarkMode"
"--enable-smooth-scrolling"
"--ozone-platform-hint=auto"
"--ignore-gpu-blocklist"
"--enable-gpu-rasterization"
"--enable-zero-copy"
"--force-device-scale-factor=1.0"
];
nixGLWrap = import ./../utils/nixGLWrap.nix { inherit pkgs lib; };
in {
imports = [
./common.nix
./../wrappers/fedora.nix
];
}

View file

@ -0,0 +1,41 @@
{ config, pkgs, lib, ... }:
{
imports = [
./../modules/machine.nix
];
machine = {
username = "thilo";
isGeneric = false;
nixPackage = pkgs.nixUnstable;
isGnome = false;
noiseSuppression.enable = true;
isGraphical = true;
};
wayland.windowManager.sway = {
enable = true;
config = rec {
modifier = "Mod4";
# Use kitty as default terminal
terminal = "alacritty";
bars = [];
};
};
programs.obs-studio = {
enable = true;
plugins = with pkgs.obs-studio-plugins; [
obs-vaapi
obs-teleport
droidcam-obs
obs-gstreamer
obs-shaderfilter
obs-command-source
obs-move-transition
advanced-scene-switcher
];
};
}

View file

@ -0,0 +1,16 @@
{ config, pkgs, lib, ... }:
{
imports = [
./../modules/machine.nix
];
machine = {
username = "thilo";
isGeneric = true;
nixPackage = pkgs.nixUnstable;
isGnome = false;
noiseSuppression.enable = false;
isGraphical = false;
};
}

View file

@ -0,0 +1,142 @@
{ lib, pkgs, config, ... }:
with lib;
{
imports = [
./../programs/alacritty.nix
./../programs/bat.nix
./../programs/beets.nix
./../programs/command-not-found.nix
./../programs/dircolors.nix
./../programs/direnv.nix
./../programs/fzf.nix
./../programs/git.nix
./../programs/htop.nix
./../programs/neovim.nix
./../programs/starship.nix
./../programs/topgrade.nix
./../programs/yt-dlp.nix
./../programs/zsh.nix
./../programs/go.nix
./packages.nix
];
options = {
machine = {
username = mkOption {
type = types.str;
default = "thilo";
description = "The username of the user";
};
isGeneric = mkOption {
type = types.bool;
default = false;
description = "Whether the system is generic or not";
};
isGraphical = mkOption {
type = types.bool;
default = false;
description = "Whether the system is graphical or not";
};
isGnome = mkOption {
type = types.bool;
default = false;
description = "Whether the system is gnome or not";
};
noiseSuppression.enable = mkOption {
type = types.bool;
default = false;
description = "Whether to enable noise suppression or not";
};
};
};
config = {
news.display = "silent";
targets.genericLinux.enable = config.machine.isGeneric;
home = {
username = "${config.machine.username}";
homeDirectory = "/home/${config.machine.username}";
stateVersion = "22.11";
file = {
".config/nano/nanorc".text = ''
set linenumbers
include "/usr/share/nano/*.nanorc"
'';
".ssh/config".source = ./../dotfiles/ssh-config;
".gitignore".source = ./../dotfiles/.gitignore;
".config/pipewire/pipewire.conf.d/99-noise-suppression.conf".text = ''
context.modules = [{
name = libpipewire-module-filter-chain
args = {
node.description = "Noise Canceling source"
media.name = "Noise Canceling source"
filter.graph = {
nodes = [{
type = ladspa
name = rnnoise
plugin = ${pkgs.rnnoise-plugin}/lib/ladspa/librnnoise_ladspa.so
label = noise_suppressor_stereo
control = {
"VAD Threshold (%)" 50.0
"VAD Grace Period (ms)" 200
"Retroactive VAD Grace (ms)" 0
}
}]
}
capture.props = {
node.name = "capture.rnnoise_source"
node.passive = true
audio.rate = 48000
}
playback.props = {
node.name = "rnnoise_source"
media.class = Audio/Source
audio.rate = 48000
}
}
}]
'';
};
activation = {
setNodeGlobalDir = {
after = [ "writeBoundary" "createXdgUserDirectories" ];
before = [ ];
data = ''
mkdir -p ${config.home.homeDirectory}/.node-global
${pkgs.nodejs}/bin/npm config set prefix ${config.home.homeDirectory}/.node-global
'';
};
} // mkIf config.machine.isGeneric {
linkDesktopApplications = {
after = [ "writeBoundary" "createXdgUserDirectories" ];
before = [ ];
data = ''
for dir in ${config.home.homeDirectory}/.nix-profile/share/applications/*; do
chmod +x $(realpath $dir) -v
done
'';
};
};
sessionPath = [ "${config.home.homeDirectory}/.node-global/bin" ];
};
programs.home-manager.enable = true;
nix = {
package = mkDefault pkgs.nixUnstable;
extraOptions = ''
experimental-features = nix-command flakes
'';
};
gtk = {
enable = config.machine.isGnome;
theme = {
name = "adw-gtk3-dark";
package = pkgs.adw-gtk3;
};
};
};
}

View file

@ -0,0 +1,113 @@
{ config, pkgs, lib, ... }:
with lib;
{
config = {
nixpkgs.overlays = [
(final: prev: {
quickemu = prev.quickemu.overrideAttrs (old: {
patches = (old.patches or [ ]) ++ [
./../patches/quickemu.patch
];
});
})
];
home.packages = with pkgs; [
up
rbenv
cargo-update
htop
rustup
nixfmt
nodejs
bun
deno
devbox
tldr
flutter
nurl
hcloud
tea
dgraph
nix-init
nodePackages.nodemon
pocketbase
# surrealdb
thefuck
hub
httpie
manix
(pkgs.writeShellScriptBin "ssh-fix-permissions"
(builtins.readFile ./../scripts/ssh-fix-permissions.sh))
(pkgs.writeShellScriptBin "yt-dlp-audio"
(builtins.readFile ./../scripts/yt-dlp-audio.sh))
(pkgs.writeShellScriptBin "nix-shell-init"
(builtins.readFile ./../scripts/nix-shell-init.sh))
(pkgs.writeShellScriptBin "http-server" ''
${pkgs.caddy}/bin/caddy file-server --listen :2345
'')
(pkgs.writeShellScriptBin "nix-build-default" ''
nix-build -E 'with import <nixpkgs> { }; callPackage ./default.nix { }'
'')
(callPackage ./../pkgs/docker-craft-cms-dev-env.nix {
inherit lib;
})
(callPackage ./../pkgs/toggl-time-grouper/package.nix {
inherit lib;
})
nixpkgs-fmt
toolbox
distrobox
ddev
act
mkcert
pulumi
kubectl
pulumiPackages.pulumi-language-nodejs
ncdu
] ++ (if config.machine.isGraphical then [
(pkgs.nerdfonts.override {
fonts = [ "JetBrainsMono" "FiraCode" "FiraMono" ];
})
# anki
corefonts
vistafonts
jetbrains.webstorm
element-desktop
ludusavi
dbeaver
insomnia
onlyoffice-bin
spotify
(lutris.override {
extraLibraries = pkgs: [
gnome3.adwaita-icon-theme
];
extraPkgs = pkgs: [
wineWowPackages.full
winetricks
gnome3.adwaita-icon-theme
];
})
bottles
protontricks
heroic
google-chrome
chromium
vscode
discord
chromium
quickemu
quickgui
trilium-desktop
anki
] else [ ]) ++ (if config.machine.isGnome then [
gnomeExtensions.blur-my-shell
gnomeExtensions.dash-to-panel
gnomeExtensions.user-themes
gnomeExtensions.vitals
gnomeExtensions.custom-accent-colors
] else [ ]);
};
}

View file

@ -0,0 +1,13 @@
diff --git a/quickget b/quickget
index 756eb82..19998d0 100755
--- a/quickget
+++ b/quickget
@@ -2133,7 +2133,7 @@ function get_windows() {
# - https://www.itechtics.com/windows-11-download-iso/
# 0 : Prompt for a manual ISO download
# 1 : Download automatically
- local AUTO_DOWNLOAD=1
+ local AUTO_DOWNLOAD=0
local DOWNLOAD_URL=""
if [ ${AUTO_DOWNLOAD} -eq 1 ]; then

View file

@ -0,0 +1,28 @@
{ lib
, stdenv
, fetchFromGitHub
}:
stdenv.mkDerivation rec {
pname = "docker-craft-cms-dev-env";
version = "unstable-2023-04-14";
src = fetchFromGitHub {
owner = "codemonauts";
repo = "docker-craft-cms-dev-env";
rev = "5053d61654bc720fd61e011642e925a99d81baa0";
hash = "sha256-VNL/cyECDx0FSn2xMHMQDbJ3d0y7SEKPZ2EzotQy/PA=";
};
postInstall = ''
mkdir -p $out/bin
cp -r $src/bin/craft $out/bin/craft
'';
meta = with lib; {
description = "Docker image for local development of sites based on Craft CMS";
homepage = "https://github.com/codemonauts/docker-craft-cms-dev-env";
license = licenses.mit;
maintainers = with maintainers; [ ];
};
}

View file

@ -0,0 +1,34 @@
{ lib
, stdenv
, buildNpmPackage
, fetchFromGitHub
}:
buildNpmPackage rec {
pname = "spx-gc";
version = "1.1.2";
src = fetchFromGitHub {
owner = "TuomoKu";
repo = "SPX-GC";
rev = "v.${version}";
hash = "sha256-NVppqlQOpOmBtsoDVhaIiHzc360ek273rpr2i9p8WK8=";
};
dontNpmBuild = true;
npmDepsHash = "sha256-TGiurf/vwGV1KBxQXl0gVDNeZZWrW1Yku3fhTmh3nhk=";
postInstall = ''
mkdir -p $out/locales
cp -r $src/locales/* $out/locales
'';
meta = with lib; {
description = "SPX is a graphics control client for live video productions and live streams using CasparCG, OBS, vMix, or similar software";
homepage = "https://github.com/TuomoKu/SPX-GC#npminstall";
license = licenses.mit;
maintainers = with maintainers; [ ];
mainProgram = "spx";
};
}

View file

@ -0,0 +1,7 @@
{ lib, python3Packages }:
with python3Packages;
buildPythonApplication {
name = "toggl-time-grouper";
src = ./.;
propagatedBuildInputs = [ pandas ];
}

View file

@ -0,0 +1,9 @@
#!/usr/bin/env python3
from distutils.core import setup
setup(
name='toggl-time-grouper',
version='0.0.1',
scripts=['toggl-time-grouper'],
)

View file

@ -0,0 +1,15 @@
#!/usr/bin/env python3
import pandas as pd
import sys
from pathlib import Path
df = pd.read_csv(sys.argv[1])
df = df.drop(columns=['User', 'Email', 'Billable', 'Tags', 'Amount ()', 'Start time', 'End date', 'End time'])
df['Duration'] = pd.to_timedelta(df['Duration'])
df['Start date'] = pd.to_datetime(df['Start date'])
df = df.groupby(['Project','Description','Start date'])['Duration'].sum()
df.to_csv(Path(sys.argv[1]).stem + '-grouped.csv')

View file

@ -0,0 +1,53 @@
{ config, pkgs, lib, ... }:
{
programs.alacritty = {
enable = true;
settings = {
window = {
decorations = "full";
dynamic_title = true;
gtk_theme_variant = "None";
};
window.opacity = 1;
font = {
normal = {
family = "JetbrainsMono NFM";
style = "Regular";
};
bold = {
family = "JetbrainsMono NFM";
style = "Bold";
};
size = 14;
};
cursor.style.shape = "Beam";
colors = {
primary = {
background = "0x282a36";
foreground = "0xeff0eb";
};
normal = {
black = "0x282a36";
red = "0xff5c57";
green = "0x5af78e";
yellow = "0xf3f99d";
blue = "0x57c7ff";
magenta = "0xff6ac1";
cyan = "0x9aedfe";
white = "0xf1f1f0";
};
bright = {
black = "0x686868";
red = "0xff5c57";
green = "0x5af78e";
yellow = "0xf3f99d";
blue = "0x57c7ff";
magenta = "0xff6ac1";
cyan = "0x9aedfe";
white = "0xf1f1f0";
};
};
};
};
}

View file

@ -0,0 +1,5 @@
{ config, pkgs, lib, ... }:
{
programs.bat = { enable = true; };
}

View file

@ -0,0 +1,27 @@
{ config, pkgs, lib, ... }:
{
programs.beets = {
enable = false;
settings = {
directory = "~/Music/dj/Library";
library = "~/Music/dj/library.db";
plugins = "spotify acousticbrainz badfiles duplicates fetchart";
import = {
write = "yes";
copy = "yes";
resume = "no";
duplicate_action = "ask";
default_action = "apply";
};
badfiles = { check_on_import = "yes"; };
match = {
max_rec = {
track_length = "strong";
track_title = "strong";
track_artist = "strong";
};
};
};
};
}

View file

@ -0,0 +1,5 @@
{ config, pkgs, lib, ... }:
{
programs.command-not-found = { enable = true; };
}

View file

@ -0,0 +1,8 @@
{ config, pkgs, lib, ... }:
{
programs.dircolors = {
enable = true;
enableZshIntegration = true;
};
}

View file

@ -0,0 +1,8 @@
{ config, pkgs, lib, ... }:
{
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
}

View file

@ -0,0 +1,8 @@
{ config, pkgs, lib, ... }:
{
programs.fzf = {
enable = true;
enableZshIntegration = true;
};
}

View file

@ -0,0 +1,29 @@
{ config, pkgs, lib, ... }:
{
programs.git = {
enable = true;
lfs.enable = true;
userEmail = "thilo.billerbeck@officerent.de";
userName = "Thilo Billerbeck";
extraConfig = {
color = {
diff = "auto";
status = "auto";
branch = "auto";
interactive = "auto";
ui = true;
pager = true;
};
log = { date = "short"; };
rerere = { enabled = "1"; };
core = {
whitespace = "fix,-indent-with-non-tab,trailing-space,cr-at-eol";
excludesfile = "~/.gitignore";
autocrlf = "input";
};
apply = { whitespace = "nowarn"; };
branch = { autosetuprebase = "always"; };
};
};
}

View file

@ -0,0 +1,7 @@
{ config, pkgs, lib, ... }:
{
programs.go = {
enable = true;
};
}

View file

@ -0,0 +1,46 @@
{ config, pkgs, lib, ... }:
{
programs.htop = {
enable = true;
settings = {
fields = "0 48 17 18 38 39 40 2 46 47 49 1";
sort_key = "46";
sort_direction = "1";
tree_sort_key = "0";
tree_sort_direction = "1";
hide_kernel_threads = "1";
hide_userland_threads = "0";
shadow_other_users = "0";
show_thread_names = "0";
show_program_path = "1";
highlight_base_name = "0";
highlight_megabytes = "1";
highlight_threads = "1";
highlight_changes = "0";
highlight_changes_delay_secs = "5";
find_comm_in_cmdline = "1";
strip_exe_from_cmdline = "1";
show_merged_command = "0";
tree_view = "1";
tree_view_always_by_pid = "0";
header_margin = "1";
detailed_cpu_time = "0";
cpu_count_from_one = "0";
show_cpu_usage = "1";
show_cpu_frequency = "0";
show_cpu_temperature = "0";
degree_fahrenheit = "0";
update_process_names = "0";
account_guest_in_cpu_meter = "0";
color_scheme = "0";
enable_mouse = "1";
delay = "15";
left_meters = "LeftCPUs2 CPU Memory DiskIO NetworkIO";
left_meter_modes = "1 1 1 2 2";
right_meters = "RightCPUs2 Tasks LoadAverage Uptime Battery";
right_meter_modes = "1 2 2 2 2";
hide_function_bar = "0";
};
};
}

View file

@ -0,0 +1,33 @@
{ config, pkgs, lib, ... }:
{
programs.neovim = {
defaultEditor = true;
enable = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
coc = { enable = true; };
extraConfig = ''
set title
set number
set relativenumber
set cursorline
set mouse=a
syntax enable
let g:NERDTreeShowHidden = 1
let g:NERDTreeMinimalUI = 1
let g:NERDTreeIgnore = [ '.git/' ]
let g:NERDTreeStatusline = ""
let g:NERDTreeMouseMode = 2
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
nnoremap <silent> <C-b> :NERDTreeToggle<CR>
'';
plugins = with pkgs.vimPlugins; [
nerdtree
vim-devicons
# fzf
ale
];
};
}

View file

@ -0,0 +1,12 @@
{ config, pkgs, lib, ... }:
{
programs.starship = {
enable = true;
settings = {
add_newline = false;
character = { success_symbol = "[](bold white)"; };
package = { disabled = true; };
};
};
}

View file

@ -0,0 +1,23 @@
{ config, pkgs, lib, ... }:
{
programs.topgrade = {
enable = true;
settings = {
misc = {
assume_yes = true;
ignore_failures = [ "git_repos" ];
no_retry = true;
pre_sudo = false;
cleanup = true;
skip_notify = true;
disable = [
"bun"
"tldr"
"flutter"
];
};
firmware = { upgrade = true; };
};
};
}

View file

@ -0,0 +1,6 @@
{ config, pkgs, lib, ... }:
{
programs.yt-dlp = { enable = true; };
}

View file

@ -0,0 +1,53 @@
{ config, pkgs, lib, ... }:
let
omz-plugins = [
"git"
"archlinux"
"composer"
"colored-man-pages"
"extract"
"gradle"
"node"
"npm"
"rbenv"
"sudo"
"direnv"
"docker"
"docker-compose"
"golang"
"pip"
"history"
"vagrant"
];
in {
programs.zsh = {
enable = true;
enableAutosuggestions = true;
enableCompletion = true;
enableVteIntegration = true;
syntaxHighlighting.enable = true;
shellAliases = {
pub-ipv4 = "curl ip4.clerie.de";
serve = "python -m SimpleHTTPServer 8080";
week = "date +%V";
path = "echo -e \${PATH//:/\\n}";
distro = "cat /etc/*-release";
reload = "source ~/.zshrc";
undo-git-reset-head = "git reset 'HEAD@{1}'";
update-local = "bash $HOME/.dotfiles/install";
};
zplug = {
enable = true;
plugins = map (x: {
name = "plugins/${x}";
tags = [ "from:oh-my-zsh" ];
}) omz-plugins;
};
initExtra = ''
eval $(${pkgs.thefuck}/bin/thefuck --alias)
[ -d ~/.npm-global ] || mkdir ~/.npm-global
${pkgs.nodejs}/bin/npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH
'';
};
}

View file

@ -0,0 +1,21 @@
#/usr/bin/env bash
nixshell=$(cat << EOF
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
nativeBuildInputs = with pkgs; [ ];
shellHook = ''
'';
}
EOF
)
envrc=$(cat << EOF
use nix
EOF
)
echo $nixshell > shell.nix
echo $envrc > .envrc

View file

@ -0,0 +1,4 @@
#!/bin/bash
chmod 700 ~/.ssh
chmod 600 ~/.ssh/*
chmod 644 -f ~/.ssh/*.pub ~/.ssh/authorized_keys ~/.ssh/known_hosts

View file

@ -0,0 +1,45 @@
#!/bin/bash
### Script for downloading albums from Youtube Music ##########
### Usage: ./yt-music-album-download.sh <youtube music url> ###
# - Converts to MP3 from the best quality audio feed
# - Adds track number, album, artist, title, and release year into id3 tags
# - Adds album art embedded thumbnails
echo "Retrieving album information..."
# Downloading the json data of the first track only
jsondata=`yt-dlp -j --playlist-items 1 $1`
# Grabbing the "release_year" and "release_date" and comparing which is lowest integer.
# Sometimes Youtube Music doesn't even populate the "release_date" field, but when it does we need to compare it to "release_year"
# If both the "release_date" and "release_year" exist, check which one is the lower integer, and that should be the actual album release year.
jq_release_year_1=`echo $jsondata | jq -r '.release_year'`
jq_release_date=`echo $jsondata | jq -r '.release_date'`
if [ $jq_release_date != 'null' ]; then
jq_release_year_2=${jq_release_date::-4};
year=$((jq_release_year_1<jq_release_year_2?jq_release_year_1:jq_release_year_2));
else
year=$jq_release_year_1;
fi
# Grabbing the artist then removing any superfluous information after the first comma. Some artists put every band memember into the artist field.
jq_artist=`echo $jsondata | jq -r '.artist'`
artist=${jq_artist%%,*}
echo "Album information retrieved..."
# Pass to yt-dlp and begin download all the music!
yt-dlp --ignore-errors \
--format "(bestaudio[acodec^=opus]/bestaudio)/best" \
--extract-audio \
--audio-format mp3 \
--audio-quality 0 \
--parse-metadata "playlist_index:%(track_number)s" \
--parse-metadata ":(?P<webpage_url>)" \
--parse-metadata ":(?P<synopsis>)" \
--parse-metadata ":(?P<description>)" \
--add-metadata \
--postprocessor-args "-metadata date='${year}' -metadata artist=\"${artist}\"" \
--embed-thumbnail \
--ppa "EmbedThumbnail+ffmpeg_o:-c:v mjpeg -vf crop=\"'if(gt(ih,iw),iw,ih)':'if(gt(iw,ih),ih,iw)'\"" \
-o "%(playlist_index)s. %(title)s.%(ext)s" "$1"

View file

@ -0,0 +1,17 @@
{ pkgs, lib, ... }:
let nixgl = import <nixgl> { };
in pkg:
pkgs.runCommand "${pkg.name}-nixgl-wrapper" { } ''
mkdir $out
ln -s ${pkg}/* $out
rm $out/bin
mkdir $out/bin
for bin in ${pkg}/bin/*; do
wrapped_bin=$out/bin/$(basename $bin)
echo -e "#!/bin/bash\nexec ${
lib.getExe nixgl.auto.nixGLDefault
} $bin \$@" > $wrapped_bin
chmod +x $wrapped_bin
done
''

View file

@ -0,0 +1,300 @@
{ config, pkgs, lib, ... }:
let
chromeArgs = lib.strings.concatStringsSep " " [
"--force-dark-mode"
"--enable-features=WebUIDarkMode"
"--enable-smooth-scrolling"
"--ozone-platform-hint=auto"
"--ignore-gpu-blocklist"
"--enable-gpu-rasterization"
"--enable-zero-copy"
"--force-device-scale-factor=1.0"
];
codeArgs = lib.strings.concatStringsSep " " [
"--ozone-platform-hint=auto"
"--enable-features=WaylandWindowDecorations"
];
code-wrapper = (pkgs.writeShellScriptBin "code" ''
exec /usr/bin/code ${codeArgs} "$@"
'');
chrome-wrapper = (pkgs.writeShellScriptBin "google-chrome" ''
exec /usr/bin/google-chrome ${chromeArgs} "$@"
'');
chrome-stable-wrapper = (pkgs.writeShellScriptBin "google-chrome-stable" ''
exec /usr/bin/google-chrome-stable ${chromeArgs} "$@"
'');
in {
home.packages = with pkgs; [
code-wrapper
chrome-wrapper
chrome-stable-wrapper
];
home.file = {
".local/share/applications/google-chrome.desktop" = {
text = ''
[Desktop Entry]
Version=1.0
Name=Google Chrome
# Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
# From Ubuntu's language-pack-kde-XX-base packages, version 9.04-20090413.
GenericName=Web Browser
GenericName[ar]=متصفح الشبكة
GenericName[bg]=Уеб браузър
GenericName[ca]=Navegador web
GenericName[cs]=WWW prohlížeč
GenericName[da]=Browser
GenericName[de]=Web-Browser
GenericName[el]=Περιηγητής ιστού
GenericName[en_GB]=Web Browser
GenericName[es]=Navegador web
GenericName[et]=Veebibrauser
GenericName[fi]=WWW-selain
GenericName[fr]=Navigateur Web
GenericName[gu]=
GenericName[he]=דפדפן אינטרנט
GenericName[hi]=
GenericName[hu]=Webböngésző
GenericName[it]=Browser Web
GenericName[ja]=
GenericName[kn]=
GenericName[ko]=
GenericName[lt]=Žiniatinklio naršyklė
GenericName[lv]=Tīmekļa pārlūks
GenericName[ml]=
GenericName[mr]=
GenericName[nb]=Nettleser
GenericName[nl]=Webbrowser
GenericName[pl]=Przeglądarka WWW
GenericName[pt]=Navegador Web
GenericName[pt_BR]=Navegador da Internet
GenericName[ro]=Navigator de Internet
GenericName[ru]=Веб-браузер
GenericName[sl]=Spletni brskalnik
GenericName[sv]=Webbläsare
GenericName[ta]= ி
GenericName[th]=
GenericName[tr]=Web Tarayıcı
GenericName[uk]=Навігатор Тенет
GenericName[zh_CN]=
GenericName[zh_HK]=
GenericName[zh_TW]=
# Not translated in KDE, from Epiphany 2.26.1-0ubuntu1.
GenericName[bn]=
GenericName[fil]=Web Browser
GenericName[hr]=Web preglednik
GenericName[id]=Browser Web
GenericName[or]=
GenericName[sk]=WWW prehliadač
GenericName[sr]=Интернет прегледник
GenericName[te]= ి
GenericName[vi]=B duyt Web
# Gnome and KDE 3 uses Comment.
Comment=Access the Internet
Comment[ar]=الدخول إلى الإنترنت
Comment[bg]=Достъп до интернет
Comment[bn]=ি
Comment[ca]=Accedeix a Internet
Comment[cs]=Přístup k internetu
Comment[da]=Få adgang til internettet
Comment[de]=Internetzugriff
Comment[el]=Πρόσβαση στο Διαδίκτυο
Comment[en_GB]=Access the Internet
Comment[es]=Accede a Internet.
Comment[et]=Pääs Internetti
Comment[fi]=Käytä internetiä
Comment[fil]=I-access ang Internet
Comment[fr]=Accéder à Internet
Comment[gu]=
Comment[he]=גישה אל האינטרנט
Comment[hi]= ि
Comment[hr]=Pristup Internetu
Comment[hu]=Internetelérés
Comment[id]=Akses Internet
Comment[it]=Accesso a Internet
Comment[ja]=
Comment[kn]= ಿಿ
Comment[ko]=
Comment[lt]=Interneto prieiga
Comment[lv]=Piekļūt internetam
Comment[ml]=
Comment[mr]=
Comment[nb]=Gå til Internett
Comment[nl]=Verbinding maken met internet
Comment[or]=
Comment[pl]=Skorzystaj z internetu
Comment[pt]=Aceder à Internet
Comment[pt_BR]=Acessar a internet
Comment[ro]=Accesaţi Internetul
Comment[ru]=Доступ в Интернет
Comment[sk]=Prístup do siete Internet
Comment[sl]=Dostop do interneta
Comment[sr]=Приступите Интернету
Comment[sv]=Gå ut på Internet
Comment[ta]=
Comment[te]= ి
Comment[th]=
Comment[tr]=İnternet'e erişin
Comment[uk]=Доступ до Інтернету
Comment[vi]=Truy cp Internet
Comment[zh_CN]=访
Comment[zh_HK]=
Comment[zh_TW]=
Exec=/usr/bin/google-chrome-stable ${chromeArgs} %U
StartupNotify=true
Terminal=false
Icon=google-chrome
Type=Application
Categories=Network;WebBrowser;
Actions=new-window;new-private-window;
[Desktop Action new-window]
Name=New Window
Name[am]=
Name[ar]=نافذة جديدة
Name[bg]=Нов прозорец
Name[bn]=
Name[ca]=Finestra nova
Name[cs]=Nové okno
Name[da]=Nyt vindue
Name[de]=Neues Fenster
Name[el]=Νέο Παράθυρο
Name[en_GB]=New Window
Name[es]=Nueva ventana
Name[et]=Uus aken
Name[fa]=پنجره جدید
Name[fi]=Uusi ikkuna
Name[fil]=New Window
Name[fr]=Nouvelle fenêtre
Name[gu]= િ
Name[hi]= ि
Name[hr]=Novi prozor
Name[hu]=Új ablak
Name[id]=Jendela Baru
Name[it]=Nuova finestra
Name[iw]=חלון חדש
Name[ja]=
Name[kn]= ಿ
Name[ko]=
Name[lt]=Naujas langas
Name[lv]=Jauns logs
Name[ml]=ി ി
Name[mr]= ि
Name[nl]=Nieuw venster
Name[no]=Nytt vindu
Name[pl]=Nowe okno
Name[pt]=Nova janela
Name[pt_BR]=Nova janela
Name[ro]=Fereastră nouă
Name[ru]=Новое окно
Name[sk]=Nové okno
Name[sl]=Novo okno
Name[sr]=Нови прозор
Name[sv]=Nytt fönster
Name[sw]=Dirisha Jipya
Name[ta]=ி
Name[te]= ి
Name[th]=
Name[tr]=Yeni Pencere
Name[uk]=Нове вікно
Name[vi]=Ca s Mi
Name[zh_CN]=
Name[zh_TW]=
Exec=/usr/bin/google-chrome-stable ${chromeArgs}
[Desktop Action new-private-window]
Name=New Incognito Window
Name[ar]=نافذة جديدة للتصفح المتخفي
Name[bg]=Нов прозорец инкогнито
Name[bn]=
Name[ca]=Finestra d'incògnit nova
Name[cs]=Nové anonymní okno
Name[da]=Nyt inkognitovindue
Name[de]=Neues Inkognito-Fenster
Name[el]=Νέο παράθυρο για ανώνυμη περιήγηση
Name[en_GB]=New Incognito window
Name[es]=Nueva ventana de incógnito
Name[et]=Uus inkognito aken
Name[fa]=پنجره جدید حالت ناشناس
Name[fi]=Uusi incognito-ikkuna
Name[fil]=Bagong Incognito window
Name[fr]=Nouvelle fenêtre de navigation privée
Name[gu]= િ
Name[hi]= ि
Name[hr]=Novi anoniman prozor
Name[hu]=Új Inkognitóablak
Name[id]=Jendela Penyamaran baru
Name[it]=Nuova finestra di navigazione in incognito
Name[iw]=חלון חדש לגלישה בסתר
Name[ja]=
Name[kn]= ಿ
Name[ko]= 릿
Name[lt]=Naujas inkognito langas
Name[lv]=Jauns inkognito režīma logs
Name[ml]=ി ി
Name[mr]= ि
Name[nl]=Nieuw incognitovenster
Name[no]=Nytt inkognitovindu
Name[pl]=Nowe okno incognito
Name[pt]=Nova janela de navegação anónima
Name[pt_BR]=Nova janela anônima
Name[ro]=Fereastră nouă incognito
Name[ru]=Новое окно в режиме инкогнито
Name[sk]=Nové okno inkognito
Name[sl]=Novo okno brez beleženja zgodovine
Name[sr]=Нови прозор за прегледање без архивирања
Name[sv]=Nytt inkognitofönster
Name[ta]=ி ி
Name[te]= ి
Name[th]=
Name[tr]=Yeni Gizli pencere
Name[uk]=Нове вікно в режимі анонімного перегляду
Name[vi]=Ca s n danh mi
Name[zh_CN]=
Name[zh_TW]=
Exec=/usr/bin/google-chrome-stable --incognito ${chromeArgs}
MimeType=x-scheme-handler/unknown;x-scheme-handler/about;application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https;
'';
};
".local/share/applications/code.desktop" = {
text = ''
[Desktop Entry]
Name=Visual Studio Code
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=/usr/share/code/code ${codeArgs} --unity-launch %F
Icon=vscode
Type=Application
StartupNotify=false
StartupWMClass=Code
Categories=TextEditor;Development;IDE;
MimeType=text/plain;inode/directory;application/x-code-workspace;
Actions=new-empty-window;
Keywords=vscode;
[Desktop Action new-empty-window]
Name=New Empty Window
Exec=/usr/share/code/code ${codeArgs} --new-window %F
Icon=vscode
'';
};
".local/share/applications/code-url-handler.desktop" = {
text = ''
[Desktop Entry]
Name=Visual Studio Code - URL Handler
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=/usr/share/code/code ${codeArgs} --open-url %U
Icon=vscode
Type=Application
NoDisplay=true
StartupNotify=true
Categories=Utility;TextEditor;Development;IDE;
MimeType=x-scheme-handler/vscode;
Keywords=vscode;
'';
};
};
}

View file