removed scripts for adding and removing packages from config files, and also removed the nixcommit/nixpush commands
This commit is contained in:
@@ -44,26 +44,10 @@
|
||||
self = self;
|
||||
pkgs = pkgs;
|
||||
};
|
||||
homep = import ./nix/homep.nix {
|
||||
self = self;
|
||||
pkgs = pkgs;
|
||||
};
|
||||
homer = import ./nix/homer.nix {
|
||||
self = self;
|
||||
pkgs = pkgs;
|
||||
};
|
||||
nsp = import ./nix/nsp.nix {
|
||||
self = self;
|
||||
pkgs = pkgs;
|
||||
};
|
||||
nixr = import ./nix/nixr.nix {
|
||||
self = self;
|
||||
pkgs = pkgs;
|
||||
};
|
||||
nixp = import ./nix/nixp.nix {
|
||||
self = self;
|
||||
pkgs = pkgs;
|
||||
};
|
||||
hyprland = import ./wm-controls/hyprland.nix {pkgs = pkgs;};
|
||||
lofi = import ./wm-controls/lofi.nix {
|
||||
self = self;
|
||||
@@ -105,15 +89,6 @@
|
||||
chscheme = import ./nix/chscheme.nix {
|
||||
pkgs = pkgs;
|
||||
};
|
||||
nixcommit = import ./nix/nixcommit.nix {
|
||||
host = host;
|
||||
self = self;
|
||||
pkgs = pkgs;
|
||||
};
|
||||
nixpush = import ./nix/nixpush.nix {
|
||||
self = self;
|
||||
pkgs = pkgs;
|
||||
};
|
||||
in {
|
||||
home.packages = [
|
||||
compress
|
||||
@@ -122,17 +97,11 @@ in {
|
||||
crs
|
||||
extract
|
||||
garbage-collect
|
||||
homep
|
||||
homer
|
||||
hyprland
|
||||
invoke
|
||||
lofi
|
||||
mcd
|
||||
music
|
||||
nixcommit
|
||||
nixp
|
||||
nixpush
|
||||
nixr
|
||||
rebuild
|
||||
nsp
|
||||
runbg
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
{
|
||||
self,
|
||||
pkgs,
|
||||
}:
|
||||
pkgs.writeShellScriptBin "homep" ''
|
||||
#!/run/current-system/sw/bin/bash
|
||||
|
||||
# Ensure the package manifest is generated or updated
|
||||
if [ ! -f "/tmp/nixpkgs_manifest.txt" ]; then
|
||||
echo "Generating Nixpkgs manifest..."
|
||||
nix-env -qaP 2>/dev/null | awk '{print $1}' | sed 's/nixos\.//' > /tmp/nixpkgs_manifest.txt
|
||||
fi
|
||||
|
||||
# Select packages using fzf with multi-select enabled
|
||||
selected_packages=$(cat /tmp/nixpkgs_manifest.txt | fzf -m)
|
||||
|
||||
# Check if any packages were selected
|
||||
if [ -n "$selected_packages" ]; then
|
||||
echo "$selected_packages" | while read -r package; do
|
||||
# Append each selected package to the Nix config file
|
||||
sed -i "/^\t]/i \ \t\t$package" "${self}/modules/home/userpkgs.nix"
|
||||
echo "Added $package to the Home Manager configuration."
|
||||
done
|
||||
|
||||
echo "Packages added successfully. Rebuild system config?"
|
||||
select yn in "Yes" "No"; do
|
||||
case $yn in
|
||||
"Yes" ) nixswitch;break;;
|
||||
"No" ) exit;;
|
||||
esac
|
||||
done
|
||||
|
||||
else
|
||||
echo "No packages selected."
|
||||
fi
|
||||
''
|
||||
@@ -1,30 +0,0 @@
|
||||
{
|
||||
self,
|
||||
pkgs,
|
||||
}:
|
||||
pkgs.writeShellScriptBin "homer" ''
|
||||
#!/run/current-system/sw/bin/bash
|
||||
|
||||
selected_packages=$(sed -n '/\[/,/\]/p' "${self}/modules/home/userpkgs.nix" | sed '1d;$d' | fzf -m)
|
||||
|
||||
if [ -n "$selected_packages" ]; then
|
||||
echo "$selected_packages" | while read -r package; do
|
||||
sed -i "/\b$package\b/d" "${self}/modules/home/userpkgs.nix"
|
||||
echo "Removed $package from the Home Manager configuration."
|
||||
done
|
||||
|
||||
echo "Removed packages. Rebuild system config?"
|
||||
select yn in "Yes" "No"; do
|
||||
case $yn in
|
||||
"Yes" ) nixswitch;break;;
|
||||
"No" ) exit;;
|
||||
esac
|
||||
done
|
||||
|
||||
else
|
||||
echo "No packages removed."
|
||||
fi
|
||||
|
||||
|
||||
|
||||
''
|
||||
@@ -1,48 +0,0 @@
|
||||
{
|
||||
self,
|
||||
pkgs,
|
||||
host,
|
||||
}:
|
||||
pkgs.writeShellScriptBin "nixcommit" ''
|
||||
#!/run/current-system/sw/bin/bash
|
||||
|
||||
scheck && runbg aplay ${self}/media/sound/nixswitch-start.wav
|
||||
pushd "${self}" || exit
|
||||
|
||||
if [ -n "$2" ]; then
|
||||
echo "too many arguments"
|
||||
exit
|
||||
fi
|
||||
|
||||
diffcheck=$(git status | grep "working tree clean")
|
||||
if [ -n "$diffcheck" ]; then
|
||||
scheck && runbg aplay ${self}/media/sound/warning.wav
|
||||
echo "Nothing to commit"
|
||||
exit
|
||||
fi
|
||||
|
||||
alejandra . &> /dev/null
|
||||
git add .
|
||||
|
||||
# Automatic fixup commit to the most recent commit (HEAD~1)
|
||||
if [ -z "$1" ]; then
|
||||
commits=$(git log origin/$(git rev-parse --abbrev-ref HEAD)..HEAD --oneline)
|
||||
if [ -n "$commits" ]; then
|
||||
git commit --fixup HEAD
|
||||
echo "No commit message given"
|
||||
echo "Squashing into most recent commit"
|
||||
git rebase --autosquash master
|
||||
else
|
||||
echo "No prior local commits to squash into, please provide a commit message"
|
||||
exit
|
||||
fi
|
||||
else
|
||||
# Generate the system generation number
|
||||
gen=$(readlink /nix/var/nix/profiles/system | sed 's/.*system-\([0-9]*\)-link/\1/')
|
||||
gen=$((gen + 1))
|
||||
git commit -m "(${host}) Gen $gen: $1"
|
||||
fi
|
||||
|
||||
scheck && runbg aplay ${self}/media/sound/gitcommit.wav
|
||||
popd || exit
|
||||
''
|
||||
@@ -1,36 +0,0 @@
|
||||
{
|
||||
self,
|
||||
pkgs,
|
||||
}:
|
||||
pkgs.writeShellScriptBin "nixp" ''
|
||||
#!/run/current-system/sw/bin/bash
|
||||
|
||||
# Ensure the package manifest is generated or updated
|
||||
if [ ! -f "/tmp/nixpkgs_manifest.txt" ]; then
|
||||
echo "Generating Nixpkgs manifest..."
|
||||
nix-env -qaP 2>/dev/null | awk '{print $1}' | sed 's/nixos\.//' > /tmp/nixpkgs_manifest.txt
|
||||
fi
|
||||
|
||||
# Select packages using fzf with multi-select enabled
|
||||
selected_packages=$(cat /tmp/nixpkgs_manifest.txt | fzf -m)
|
||||
|
||||
# Check if any packages were selected
|
||||
if [ -n "$selected_packages" ]; then
|
||||
echo "$selected_packages" | while read -r package; do
|
||||
# Append each selected package to the Nix config file
|
||||
sed -i "/^\t]/i \ \t\t$package" "${self}/modules/sys/packages.nix"
|
||||
echo "Added $package to the Nix configuration."
|
||||
done
|
||||
|
||||
echo "Packages added successfully. Rebuild system config?"
|
||||
select yn in "Yes" "No"; do
|
||||
case $yn in
|
||||
"Yes" ) nixswitch;break;;
|
||||
"No" ) exit;;
|
||||
esac
|
||||
done
|
||||
|
||||
else
|
||||
echo "No packages selected."
|
||||
fi
|
||||
''
|
||||
@@ -1,25 +0,0 @@
|
||||
{
|
||||
self,
|
||||
pkgs,
|
||||
}:
|
||||
pkgs.writeShellScriptBin "nixpush" ''
|
||||
#!/run/current-system/sw/bin/bash
|
||||
|
||||
scheck && runbg aplay ${self}/media/sound/nixswitch-start.wav
|
||||
set -e
|
||||
pushd "${self}"
|
||||
|
||||
commits=$(git log origin/$(git rev-parse --abbrev-ref HEAD)..HEAD --oneline)
|
||||
if [ -z "$commits" ]; then
|
||||
scheck && runbg aplay ${self}/media/sound/warning.wav
|
||||
echo "Nothing to push"
|
||||
exit
|
||||
fi
|
||||
|
||||
echo "Pushing the following commits upstream on branch '$(git branch | rg "\*" | awk '{print $2}')'"
|
||||
echo "$commits"
|
||||
|
||||
git push
|
||||
scheck && runbg aplay ${self}/media/sound/gitpush.wav
|
||||
popd
|
||||
''
|
||||
@@ -1,30 +0,0 @@
|
||||
{
|
||||
self,
|
||||
pkgs,
|
||||
}:
|
||||
pkgs.writeShellScriptBin "nixr" ''
|
||||
#!/run/current-system/sw/bin/bash
|
||||
|
||||
selected_packages=$(sed -n '/\[/,/\]/p' "${self}/modules/sys/packages.nix" | sed '1d;$d' | fzf -m)
|
||||
|
||||
if [ -n "$selected_packages" ]; then
|
||||
echo "$selected_packages" | while read -r package; do
|
||||
sed -i "/\b$package\b/d" "${self}/modules/sys/packages.nix"
|
||||
echo "Removed $package from the Nix configuration."
|
||||
done
|
||||
|
||||
echo "Removed packages. Rebuild system config?"
|
||||
select yn in "Yes" "No"; do
|
||||
case $yn in
|
||||
"Yes" ) nixswitch;break;;
|
||||
"No" ) exit;;
|
||||
esac
|
||||
done
|
||||
|
||||
else
|
||||
echo "No packages removed."
|
||||
fi
|
||||
|
||||
|
||||
|
||||
''
|
||||
Reference in New Issue
Block a user