migrated many of my scripts, and minor pack adjstm

This commit is contained in:
Danilo Reyes 2023-08-20 03:01:27 -06:00
parent a178298564
commit c25dfd3916
2 changed files with 118 additions and 85 deletions

View File

@ -19,16 +19,23 @@ let
unstable = import unstable_tarball { config = config.nixpkgs.config; }; unstable = import unstable_tarball { config = config.nixpkgs.config; };
nix-gaming = import (builtins.fetchTarball nix-gaming = import (builtins.fetchTarball
"https://github.com/fufexan/nix-gaming/archive/master.tar.gz"); "https://github.com/fufexan/nix-gaming/archive/master.tar.gz");
nextcloud_scrapsync = pkgs.writeScriptBin "nextcloud_scrapsync" jawz_nextcloud_scrapsync = pkgs.writeScriptBin "nextcloud_scrapsync"
(builtins.readFile ./scripts/nextcloud_scrapsync.sh); (builtins.readFile ./scripts/nextcloud_scrapsync.sh);
manage_library = pkgs.writeScriptBin "manage_library" jawz_manage_library = pkgs.writeScriptBin "manage_library"
(builtins.readFile ./scripts/manage_library.sh); (builtins.readFile ./scripts/manage_library.sh);
ffmpreg = jawz_ffmpreg =
pkgs.writeScriptBin "ffmpreg" (builtins.readFile ./scripts/ffmpreg.sh); pkgs.writeScriptBin "ffmpreg" (builtins.readFile ./scripts/ffmpreg.sh);
ffmpeg4discord = pkgs.writeScriptBin "ffmpeg4discord" jawz_ffmpeg4discord = pkgs.writeScriptBin "ffmpeg4discord"
(builtins.readFile ./scripts/ffmpeg4discord.py); (builtins.readFile ./scripts/ffmpeg4discord.py);
chat-dl = jawz_chat-dl =
pkgs.writeScriptBin "chat-dl" (builtins.readFile ./scripts/chat-dl.sh); pkgs.writeScriptBin "chat-dl" (builtins.readFile ./scripts/chat-dl.sh);
jawz_tasks =
pkgs.writeScriptBin "tasks" (builtins.readFile ./scripts/tasks.sh);
jawz_split_dir =
pkgs.writeScriptBin "split_dir" (builtins.readFile ./scripts/split_dir.sh);
jawz_pika_list =
pkgs.writeScriptBin "pika_list" (builtins.readFile ./scripts/pika_list.sh);
jawz_run = pkgs.writeScriptBin "run" (builtins.readFile ./scripts/run.sh);
in { # Remember to close this bracket at the end of the document in { # Remember to close this bracket at the end of the document
imports = [ imports = [
@ -150,7 +157,7 @@ in { # Remember to close this bracket at the end of the document
vulkan-tools vulkan-tools
# nix-gaming.packages.${pkgs.hostPlatform.system}.wine-tkg # nix-gaming.packages.${pkgs.hostPlatform.system}.wine-tkg
winetricks winetricks
nix-gaming.packages.${pkgs.hostPlatform.system}.wine-discord-ipc-bridge # nix-gaming.packages.${pkgs.hostPlatform.system}.wine-discord-ipc-bridge
# grapejuice # roblox manager # grapejuice # roblox manager
# minecraft # minecraft official launcher # minecraft # minecraft official launcher
parsec-bin # remote gaming with friends parsec-bin # remote gaming with friends
@ -160,7 +167,7 @@ in { # Remember to close this bracket at the end of the document
libreoffice-fresh # office, but based libreoffice-fresh # office, but based
calibre # ugly af eBook library manager calibre # ugly af eBook library manager
foliate # gtk eBook reader foliate # gtk eBook reader
gnome-feeds # feed reader, maybe will replace with nextcloud newsflash # feed reader, syncs with nextcloud
wike # gtk wikipedia wow! wike # gtk wikipedia wow!
unstable.furtherance # I made this one tehee track time utility unstable.furtherance # I made this one tehee track time utility
gnome.simple-scan # scanner gnome.simple-scan # scanner
@ -222,11 +229,14 @@ in { # Remember to close this bracket at the end of the document
lm_sensors # for extension, displays cpu temp lm_sensors # for extension, displays cpu temp
# My own scripts # My own scripts
nextcloud_scrapsync jawz_ffmpeg4discord
ffmpeg4discord jawz_ffmpreg
ffmpreg jawz_manage_library
manage_library jawz_chat-dl
chat-dl jawz_tasks
jawz_split_dir
jawz_pika_list
jawz_run
# required by doom emacs, but still are rather useful. # required by doom emacs, but still are rather useful.
fd # modern find, faster searches fd # modern find, faster searches
@ -248,7 +258,7 @@ in { # Remember to close this bracket at the end of the document
shellcheck # linting shellcheck # linting
shfmt # a shell parser and formatter shfmt # a shell parser and formatter
file # required by my tasks script? file # required by my tasks script?
gnome.zenity # dependency of my scripts # gnome.zenity # dependency of my scripts
xclip # manipulate clipboard from scripts xclip # manipulate clipboard from scripts
# NIX # NIX
@ -312,17 +322,6 @@ in { # Remember to close this bracket at the end of the document
buildInputs = [ setuptools ]; buildInputs = [ setuptools ];
propagatedBuildInputs = [ pyyaml types-pyyaml ]; propagatedBuildInputs = [ pyyaml types-pyyaml ];
}) })
(buildPythonApplication rec {
pname = "classifier";
version = "2.0";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-yHtc0qNZbKIkhhxrh0Zh5KWWsC/aU51WX1oEPVN9nOg=";
};
doCheck = false;
buildInputs = [ setuptools ];
propagatedBuildInputs = [ arrow ];
})
(buildPythonApplication rec { (buildPythonApplication rec {
pname = "ffpb"; pname = "ffpb";
version = "0.4.1"; version = "0.4.1";
@ -383,8 +382,8 @@ in { # Remember to close this bracket at the end of the document
ls = ls =
"exa --icons --group-directories-first --no-permissions --no-user --no-time"; "exa --icons --group-directories-first --no-permissions --no-user --no-time";
edit = "emacsclient -t"; edit = "emacsclient -t";
comic = "download -u jawz -i $(cat $lc | fzf --multi --exact -i)"; comic = "download -u jawz -i $(cat $LC | fzf --multi --exact -i)";
gallery = "download -u jawz -i $(cat $lw | fzf --multi --exact -i)"; gallery = "download -u jawz -i $(cat $LW | fzf --multi --exact -i)";
open_gallery = '' open_gallery = ''
cd /mnt/disk2/scrapping/JawZ/gallery-dl && nautilus cd /mnt/disk2/scrapping/JawZ/gallery-dl && nautilus
"$(fd . ./ Husbands -tdirectory -d 1 | fzf -i)"''; "$(fd . ./ Husbands -tdirectory -d 1 | fzf -i)"'';
@ -413,9 +412,9 @@ in { # Remember to close this bracket at the end of the document
/home/jawz/.local/bin/pokemon-colorscripts -r --no-title /home/jawz/.local/bin/pokemon-colorscripts -r --no-title
# Lists # Lists
list_root=${config.home.homeDirectory}/.config/jawz/lists/jawz list_root=${config.home.homeDirectory}/.config/jawz/lists/jawz
export lw=$list_root/watch.txt export LW=$list_root/watch.txt
export li=$list_root/instant.txt export LI=$list_root/instant.txt
export lc=$list_root/comic.txt export LC=$list_root/comic.txt
export command_timeout=30 export command_timeout=30
# GPG_TTY=$(tty) # GPG_TTY=$(tty)
@ -569,7 +568,7 @@ in { # Remember to close this bracket at the end of the document
}; };
parityFiles = [ "/mnt/parity/snapraid.parity" ]; parityFiles = [ "/mnt/parity/snapraid.parity" ];
extraConfig = '' extraConfig = ''
autosave 50 autosave 5000
''; '';
exclude = [ exclude = [
"/tmp/" "/tmp/"
@ -639,14 +638,6 @@ in { # Remember to close this bracket at the end of the document
defaultEditor = true; defaultEditor = true;
package = pkgs.emacs; package = pkgs.emacs;
}; };
# udev = {
# packages = with pkgs; [ gnome.gnome-settings-daemon ];
# extraRules = ''
# SUBSYSTEM=="hidraw", ATTRS{idVendor}=="256c", ATTRS{idProduct}=="006d", MODE="0666"
# SUBSYSTEM=="usb", ATTRS{idVendor}=="256c", ATTRS{idProduct}=="006d", MODE="0666"
# SUBSYSTEM=="input", ATTRS{idVendor}=="256c", ATTRS{idProduct}=="006d", ENV{LIBINPUT_IGNORE_DEVICE}="1"
# '';
# };
}; };
systemd.services = { systemd.services = {
@ -672,10 +663,10 @@ in { # Remember to close this bracket at the end of the document
"nextcloud_scrapsync" = { "nextcloud_scrapsync" = {
description = "Sync scrapped files with nextcloud"; description = "Sync scrapped files with nextcloud";
wantedBy = [ "default.target" ]; wantedBy = [ "default.target" ];
path = [ pkgs.bash nextcloud_scrapsync ]; path = [ pkgs.bash jawz_nextcloud_scrapsync ];
serviceConfig = { serviceConfig = {
RestartSec = 30; RestartSec = 30;
ExecStart = "${nextcloud_scrapsync}/bin/nextcloud_scrapsync"; ExecStart = "${jawz_nextcloud_scrapsync}/bin/nextcloud_scrapsync";
}; };
}; };
}; };
@ -715,11 +706,34 @@ in { # Remember to close this bracket at the end of the document
restartIfChanged = true; restartIfChanged = true;
description = "Run the manage library bash script"; description = "Run the manage library bash script";
wantedBy = [ "default.target" ]; wantedBy = [ "default.target" ];
path = [ pkgs.bash manage_library ]; path = [ pkgs.bash pkgs.nix jawz_manage_library ];
serviceConfig = { serviceConfig = {
Restart = "on-failure"; Restart = "on-failure";
RestartSec = 30; RestartSec = 30;
ExecStart = "${manage_library}/bin/manage_library"; ExecStart = "${jawz_manage_library}/bin/manage_library";
};
};
"tasks" = {
restartIfChanged = true;
description = "Run a tasks script which keeps a lot of things organized";
wantedBy = [ "default.target" ];
path = [ pkgs.bash pkgs.nix jawz_tasks ];
serviceConfig = {
Restart = "on-failure";
RestartSec = 30;
ExecStart = "${jawz_tasks}/bin/tasks";
};
};
};
systemd.user.timers = {
"tasks" = {
enable = true;
description = "Run a tasks script which keeps a lot of things organized";
wantedBy = [ "timers.target" ];
timerConfig = {
OnBootSec = "1min";
OnUnitActivateSec = "5m";
Persistent = true;
}; };
}; };
}; };

View File

@ -56,16 +56,24 @@ let
config = config.nixpkgs.config; config = config.nixpkgs.config;
}; };
nix-gaming = import (builtins.fetchTarball "https://github.com/fufexan/nix-gaming/archive/master.tar.gz"); nix-gaming = import (builtins.fetchTarball "https://github.com/fufexan/nix-gaming/archive/master.tar.gz");
nextcloud_scrapsync = pkgs.writeScriptBin jawz_nextcloud_scrapsync = pkgs.writeScriptBin
"nextcloud_scrapsync" (builtins.readFile ./scripts/nextcloud_scrapsync.sh); "nextcloud_scrapsync" (builtins.readFile ./scripts/nextcloud_scrapsync.sh);
manage_library = pkgs.writeScriptBin jawz_manage_library = pkgs.writeScriptBin
"manage_library" (builtins.readFile ./scripts/manage_library.sh); "manage_library" (builtins.readFile ./scripts/manage_library.sh);
ffmpreg = pkgs.writeScriptBin jawz_ffmpreg = pkgs.writeScriptBin
"ffmpreg" (builtins.readFile ./scripts/ffmpreg.sh); "ffmpreg" (builtins.readFile ./scripts/ffmpreg.sh);
ffmpeg4discord = pkgs.writeScriptBin jawz_ffmpeg4discord = pkgs.writeScriptBin
"ffmpeg4discord" (builtins.readFile ./scripts/ffmpeg4discord.py); "ffmpeg4discord" (builtins.readFile ./scripts/ffmpeg4discord.py);
chat-dl = pkgs.writeScriptBin jawz_chat-dl = pkgs.writeScriptBin
"chat-dl" (builtins.readFile ./scripts/chat-dl.sh); "chat-dl" (builtins.readFile ./scripts/chat-dl.sh);
jawz_tasks = pkgs.writeScriptBin
"tasks" (builtins.readFile ./scripts/tasks.sh);
jawz_split_dir = pkgs.writeScriptBin
"split_dir" (builtins.readFile ./scripts/split_dir.sh);
jawz_pika_list = pkgs.writeScriptBin
"pika_list" (builtins.readFile ./scripts/pika_list.sh);
jawz_run = pkgs.writeScriptBin
"run" (builtins.readFile ./scripts/run.sh);
in in
{ # Remember to close this bracket at the end of the document { # Remember to close this bracket at the end of the document
#+end_src #+end_src
@ -290,7 +298,7 @@ wineWowPackages.full
vulkan-tools vulkan-tools
# nix-gaming.packages.${pkgs.hostPlatform.system}.wine-tkg # nix-gaming.packages.${pkgs.hostPlatform.system}.wine-tkg
winetricks winetricks
nix-gaming.packages.${pkgs.hostPlatform.system}.wine-discord-ipc-bridge # nix-gaming.packages.${pkgs.hostPlatform.system}.wine-discord-ipc-bridge
# grapejuice # roblox manager # grapejuice # roblox manager
# minecraft # minecraft official launcher # minecraft # minecraft official launcher
parsec-bin # remote gaming with friends parsec-bin # remote gaming with friends
@ -306,7 +314,7 @@ this are not used as often as I wish…
libreoffice-fresh # office, but based libreoffice-fresh # office, but based
calibre # ugly af eBook library manager calibre # ugly af eBook library manager
foliate # gtk eBook reader foliate # gtk eBook reader
gnome-feeds # feed reader, maybe will replace with nextcloud newsflash # feed reader, syncs with nextcloud
wike # gtk wikipedia wow! wike # gtk wikipedia wow!
unstable.furtherance # I made this one tehee track time utility unstable.furtherance # I made this one tehee track time utility
gnome.simple-scan # scanner gnome.simple-scan # scanner
@ -391,11 +399,14 @@ torrenttools # create torrent files from the terminal!
lm_sensors # for extension, displays cpu temp lm_sensors # for extension, displays cpu temp
# My own scripts # My own scripts
nextcloud_scrapsync jawz_ffmpeg4discord
ffmpeg4discord jawz_ffmpreg
ffmpreg jawz_manage_library
manage_library jawz_chat-dl
chat-dl jawz_tasks
jawz_split_dir
jawz_pika_list
jawz_run
#+end_src #+end_src
** DEVELOPMENT PACKAGES ** DEVELOPMENT PACKAGES
@ -421,7 +432,7 @@ bashdb # autocomplete
shellcheck # linting shellcheck # linting
shfmt # a shell parser and formatter shfmt # a shell parser and formatter
file # required by my tasks script? file # required by my tasks script?
gnome.zenity # dependency of my scripts # gnome.zenity # dependency of my scripts
xclip # manipulate clipboard from scripts xclip # manipulate clipboard from scripts
# NIX # NIX
@ -496,18 +507,6 @@ symbola
propagatedBuildInputs = propagatedBuildInputs =
[ pyyaml types-pyyaml ]; [ pyyaml types-pyyaml ];
}) })
(buildPythonApplication rec {
pname = "classifier";
version = "2.0";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-yHtc0qNZbKIkhhxrh0Zh5KWWsC/aU51WX1oEPVN9nOg=";
};
doCheck = false;
buildInputs = [ setuptools ];
propagatedBuildInputs =
[ arrow ];
})
(buildPythonApplication rec { (buildPythonApplication rec {
pname = "ffpb"; pname = "ffpb";
version = "0.4.1"; version = "0.4.1";
@ -606,8 +605,8 @@ programs.bash = {
shellAliases = { shellAliases = {
ls = "exa --icons --group-directories-first --no-permissions --no-user --no-time"; ls = "exa --icons --group-directories-first --no-permissions --no-user --no-time";
edit = "emacsclient -t"; edit = "emacsclient -t";
comic = "download -u jawz -i $(cat $lc | fzf --multi --exact -i)"; comic = "download -u jawz -i $(cat $LC | fzf --multi --exact -i)";
gallery = "download -u jawz -i $(cat $lw | fzf --multi --exact -i)"; gallery = "download -u jawz -i $(cat $LW | fzf --multi --exact -i)";
open_gallery = "cd /mnt/disk2/scrapping/JawZ/gallery-dl && nautilus \ open_gallery = "cd /mnt/disk2/scrapping/JawZ/gallery-dl && nautilus \
\"$(fd . ./ Husbands -tdirectory -d 1 | fzf -i)\""; \"$(fd . ./ Husbands -tdirectory -d 1 | fzf -i)\"";
unique_extensions = "fd -tf | rev | cut -d. -f1 | rev | tr '[:upper:]' '[:lower:]' | sort | uniq --count | sort -rn"; unique_extensions = "fd -tf | rev | cut -d. -f1 | rev | tr '[:upper:]' '[:lower:]' | sort | uniq --count | sort -rn";
@ -636,9 +635,9 @@ programs.bash = {
/home/jawz/.local/bin/pokemon-colorscripts -r --no-title /home/jawz/.local/bin/pokemon-colorscripts -r --no-title
# Lists # Lists
list_root=${config.home.homeDirectory}/.config/jawz/lists/jawz list_root=${config.home.homeDirectory}/.config/jawz/lists/jawz
export lw=$list_root/watch.txt export LW=$list_root/watch.txt
export li=$list_root/instant.txt export LI=$list_root/instant.txt
export lc=$list_root/comic.txt export LC=$list_root/comic.txt
export command_timeout=30 export command_timeout=30
# GPG_TTY=$(tty) # GPG_TTY=$(tty)
@ -834,7 +833,7 @@ snapraid = {
"/mnt/parity/snapraid.parity" "/mnt/parity/snapraid.parity"
]; ];
extraConfig = '' extraConfig = ''
autosave 50 autosave 5000
''; '';
exclude = [ exclude = [
"/tmp/" "/tmp/"
@ -918,14 +917,6 @@ services = {
defaultEditor = true; defaultEditor = true;
package = pkgs.emacs; package = pkgs.emacs;
}; };
# udev = {
# packages = with pkgs; [ gnome.gnome-settings-daemon ];
# extraRules = ''
# SUBSYSTEM=="hidraw", ATTRS{idVendor}=="256c", ATTRS{idProduct}=="006d", MODE="0666"
# SUBSYSTEM=="usb", ATTRS{idVendor}=="256c", ATTRS{idProduct}=="006d", MODE="0666"
# SUBSYSTEM=="input", ATTRS{idVendor}=="256c", ATTRS{idProduct}=="006d", ENV{LIBINPUT_IGNORE_DEVICE}="1"
# '';
# };
}; };
#+end_src #+end_src
@ -960,11 +951,11 @@ systemd.services = {
wantedBy = [ "default.target" ]; wantedBy = [ "default.target" ];
path = [ path = [
pkgs.bash pkgs.bash
nextcloud_scrapsync jawz_nextcloud_scrapsync
]; ];
serviceConfig = { serviceConfig = {
RestartSec = 30; RestartSec = 30;
ExecStart = "${nextcloud_scrapsync}/bin/nextcloud_scrapsync"; ExecStart = "${jawz_nextcloud_scrapsync}/bin/nextcloud_scrapsync";
}; };
}; };
}; };
@ -1008,12 +999,40 @@ systemd.user.services = {
wantedBy = [ "default.target" ]; wantedBy = [ "default.target" ];
path = [ path = [
pkgs.bash pkgs.bash
manage_library pkgs.nix
jawz_manage_library
]; ];
serviceConfig = { serviceConfig = {
Restart = "on-failure"; Restart = "on-failure";
RestartSec = 30; RestartSec = 30;
ExecStart = "${manage_library}/bin/manage_library"; ExecStart = "${jawz_manage_library}/bin/manage_library";
};
};
"tasks" = {
restartIfChanged = true;
description = "Run a tasks script which keeps a lot of things organized";
wantedBy = [ "default.target" ];
path = [
pkgs.bash
pkgs.nix
jawz_tasks
];
serviceConfig = {
Restart = "on-failure";
RestartSec = 30;
ExecStart = "${jawz_tasks}/bin/tasks";
};
};
};
systemd.user.timers = {
"tasks" = {
enable = true;
description = "Run a tasks script which keeps a lot of things organized";
wantedBy = [ "timers.target" ];
timerConfig = {
OnBootSec = "1min";
OnUnitActivateSec = "5m";
Persistent = true;
}; };
}; };
}; };