Major rework in progress

This commit is contained in:
2024-10-10 11:01:59 -05:00
parent 35d920744f
commit f11a6ab86e
26 changed files with 742 additions and 253 deletions

85
home/packages/default.nix Normal file
View File

@@ -0,0 +1,85 @@
{ pkgs, pkgs-us, self, ... }: {
imports = [
self.inputs.scripts.hmModule
self.inputs.external.hmModule
];
nixpkgs.config.allowUnfree = true;
home.packages = with pkgs; let
pypkgs = ps: with ps; [
numpy
pandas
torch
torchvision
torchaudio
transformers
datasets
pyaudio
faster-whisper
pyusb
];
in [
cava
gcc
android-tools
(pkgs.python311.withPackages pypkgs)
brightnessctl
libdbusmenu-gtk3
zulu
lmms
killall
youtube-music
#unfree {
geogebra
#}
blueberry
wl-clipboard
firefox-wayland
swaylock-effects
neofetch
pkgs-us.mpv
(ncmpcpp.override { visualizerSupport = true; clockSupport = true; })
playerctl
mpc-cli
xfce.thunar
vlc
zip
unzip
pavucontrol
yewtube
ytmdl
ffmpeg_5
lxqt.lxqt-policykit
rpi-imager
rsync
grim
slurp
tigervnc
keepassxc
httplz
#school?
#pkgs-us.digital
#3D modeling/printing
kicad
blender
freecad
cura
#productivity
libreoffice
super-productivity
#games
prismlauncher
];
}

15
home/packages/external/default.nix vendored Normal file
View File

@@ -0,0 +1,15 @@
{ config, lib, pkgs, self, ... }: {
options = {
externalPackages.enable = lib.options.mkOption {
type = lib.types.bool;
default = false;
};
};
config = lib.mkIf config.externalPackages.enable {
home.packages = [
self.packages.${pkgs.system}.digital
];
};
}

View File

@@ -14,7 +14,7 @@
outputs = { self, ... }@inputs: let
system = "x86_64-linux";
_pkgs = import inputs.nixpkgs { inherit system; };
in rec {
in {
packages.${system}.digital = _pkgs.stdenv.mkDerivation {
@@ -34,12 +34,7 @@
};
hmModule = { config, lib, pkgs, ... }: {
hmModule = import ./. { inherit self; };
home.packages = [
packages.${pkgs.system}.digital
];
};
};
}

View File

@@ -2,7 +2,6 @@
description = "Nathan user packages";
inputs = {
nixpkgs-old.url = "github:nixos/nixpkgs/nixos-23.11";
nixpkgs-us.url = "github:nixos/nixpkgs/nixos-unstable";
scripts.url = "./scripts";
@@ -14,103 +13,14 @@
outputs = { self, ... }@inputs: let
system = "x86_64-linux";
pkgs-old = import inputs.nixpkgs-old {
inherit system;
config.allowUnfree = true;
};
pkgs-us = import inputs.nixpkgs-us {
inherit system;
config.allowUnfree = true;
};
in {
in {
hmModule = { config, lib, pkgs, ... }: {
imports = [
inputs.scripts.hmModule
inputs.external.hmModule
];
nixpkgs.config.allowUnfree = true;
home.packages = with pkgs; let
pypkgs = ps: with ps; [
numpy
pandas
torch
torchvision
torchaudio
transformers
datasets
pyaudio
faster-whisper
pyusb
];
in [
cava
gcc
android-tools
(pkgs.python311.withPackages pypkgs)
brightnessctl
libdbusmenu-gtk3
zulu
lmms
killall
youtube-music
#unfree {
geogebra
#}
blueberry
wl-clipboard
firefox-wayland
swaylock-effects
neofetch
pkgs-us.mpv
(ncmpcpp.override { visualizerSupport = true; clockSupport = true; })
playerctl
mpc-cli
xfce.thunar
vlc
zip
unzip
pavucontrol
yewtube
ytmdl
ffmpeg_5
lxqt.lxqt-policykit
rpi-imager
rsync
grim
slurp
tigervnc
keepassxc
httplz
#school?
#pkgs-us.digital
#3D modeling/printing
kicad
blender
freecad
cura
#productivity
libreoffice
super-productivity
#games
prismlauncher
];
hmModule = import ./. { inherit pkgs-us self; };
};
};
}

View File

@@ -0,0 +1,104 @@
{ config, lib, pkgs, ... }: {
options = {
homeScripts.enable = lib.options.mkOption {
type = lib.types.bool;
default = true;
};
};
config = lib.mkIf config.homeScripts.enable {
home.packages = [
#scripts
(pkgs.writeShellScriptBin "_systemRebuild" ''
sudo nix flake lock /home/nathan/Projects/System --update-input nathan --update-input root --update-input system
${pkgs.nh}/bin/nh os switch --ask /home/nathan/Projects/System
echo //////Enter to close//////
read
'')
(pkgs.writeShellScriptBin "_homeRebuild" ''
sudo nix flake lock /home/nathan/Projects/System --update-input nathan
${pkgs.nh}/bin/nh home switch --ask /home/nathan/Projects/System
echo //////Enter to close//////
read
'')
(pkgs.writeShellScriptBin "addCoverArtMP3" ''
if [[ $# != 2 ]]
then echo "usage: addCoverArtMP3 song.mp3 image.jpg"
exit
fi
mv $1 copyof$1
ffmpeg -i copyof$1 -i $2 -map_metadata 0 -map 0 -map 1 -acodec copy $1
'')
(pkgs.writeShellScriptBin "randWallpaper" ''
file=$(ls /home/nathan/Pictures/Wallpaper/ | shuf -n 1)
setWallpaper /home/nathan/Pictures/Wallpaper/$file
'')
(pkgs.writeShellScriptBin "setWallpaper" ''
img=''$(realpath ''${1:-~/.cache/bg})
p=''$(ps -e | grep mpvpaper | sed -n -e "s/ *//" -e "s/ /\n/" -e "1 P")
${pkgs.mpvpaper}/bin/mpvpaper -f -o "loop" '*' $img && \
changeColors $img $2 && \
sleep 0.4 && \
kill $p
'')
(pkgs.writeShellScriptBin "changeColors" ''
if [[ $(ls ~/.cache/ | grep bga) != bga ]]; then
echo 100 > ~/.cache/bga
fi
alpha=''${2:-`cat ~/.cache/bga`}
img=''$(realpath ''${1:-~/.cache/bg})
if [[ $alpha -lt 0 ]]; then
$alpha=0
fi
if [[ $alpha -gt 100 ]]; then
$alpha=100
fi
wal -i $img -a $alpha --cols16 -n
echo $alpha > ~/.cache/bga
rm ~/.cache/bg
ln -s $img ~/.cache/bg
sleep 0.4
pywalfox update &
themecord > ~/.cache/_.txt && rm ~/.cache/_.txt
[[ $(pidof cava) != "" ]] && pkill -USR1 cava &
for i in $(ls /run/user/1000 | grep nvim); do nvr -s --servername /run/user/1000/$i --remote-send '<cmd>colorscheme pywal<CR>'; done
pkill -USR1 kitty
'')
(pkgs.writeShellScriptBin "onSystemStart" ''
ags &
pypr &
setWallpaper &
lxqt-policykit-agent &
nmcli device wifi connect EagleNet password '~?C#@ZiH' &
hyprctl setcursor Bibata-Modern-Classic 16 &
'')
(pkgs.writeShellScriptBin "colorPrefix" ''
exec -a "$0" "$@" &
sleep 0.4 && changeColors &
'')
];
};
}

View File

@@ -1,106 +1,12 @@
{
description = "Nathan user scripts";
description = "Nathan user scripts";
inputs = {
};
outputs = { self, ... }: {
hmModule = { config, lib, pkgs, ... }: {
home.packages = [
#scripts
(pkgs.writeShellScriptBin "_systemRebuild" ''
sudo nix flake lock /home/nathan/Projects/System --update-input nathan --update-input root --update-input system
${pkgs.nh}/bin/nh os switch --ask /home/nathan/Projects/System
echo //////Enter to close//////
read
'')
(pkgs.writeShellScriptBin "_homeRebuild" ''
sudo nix flake lock /home/nathan/Projects/System --update-input nathan
${pkgs.nh}/bin/nh home switch --ask /home/nathan/Projects/System
echo //////Enter to close//////
read
'')
(pkgs.writeShellScriptBin "addCoverArtMP3" ''
if [[ $# != 2 ]]
then echo "usage: addCoverArtMP3 song.mp3 image.jpg"
exit
fi
mv $1 copyof$1
ffmpeg -i copyof$1 -i $2 -map_metadata 0 -map 0 -map 1 -acodec copy $1
'')
(pkgs.writeShellScriptBin "randWallpaper" ''
file=$(ls /home/nathan/Pictures/Wallpaper/ | shuf -n 1)
setWallpaper /home/nathan/Pictures/Wallpaper/$file
'')
(pkgs.writeShellScriptBin "setWallpaper" ''
img=''$(realpath ''${1:-~/.cache/bg})
p=''$(ps -e | grep mpvpaper | sed -n -e "s/ *//" -e "s/ /\n/" -e "1 P")
${pkgs.mpvpaper}/bin/mpvpaper -f -o "loop" '*' $img && \
changeColors $img $2 && \
sleep 0.4 && \
kill $p
'')
(pkgs.writeShellScriptBin "changeColors" ''
if [[ $(ls ~/.cache/ | grep bga) != bga ]]; then
echo 100 > ~/.cache/bga
fi
alpha=''${2:-`cat ~/.cache/bga`}
img=''$(realpath ''${1:-~/.cache/bg})
if [[ $alpha -lt 0 ]]; then
$alpha=0
fi
if [[ $alpha -gt 100 ]]; then
$alpha=100
fi
wal -i $img -a $alpha --cols16 -n
echo $alpha > ~/.cache/bga
rm ~/.cache/bg
ln -s $img ~/.cache/bg
sleep 0.4
pywalfox update &
themecord > ~/.cache/_.txt && rm ~/.cache/_.txt
[[ $(pidof cava) != "" ]] && pkill -USR1 cava &
for i in $(ls /run/user/1000 | grep nvim); do nvr -s --servername /run/user/1000/$i --remote-send '<cmd>colorscheme pywal<CR>'; done
pkill -USR1 kitty
'')
(pkgs.writeShellScriptBin "onSystemStart" ''
ags &
pypr &
setWallpaper &
lxqt-policykit-agent &
nmcli device wifi connect EagleNet password '~?C#@ZiH' &
hyprctl setcursor Bibata-Modern-Classic 16 &
'')
(pkgs.writeShellScriptBin "colorPrefix" ''
exec -a "$0" "$@" &
sleep 0.4 && changeColors &
'')
];
inputs = {
};
};
outputs = { self, ... }: {
hmModule = import ./.;
};
}