feat(home-manager): service defs and fmt
fmt: reformatted using nixpkgs-fmt prettifier mpd: created configuration hypr: add window rules commons: add usingMusicPlayerDaemon variable
This commit is contained in:
parent
2d4b39c72f
commit
7d88765f5d
67 changed files with 633 additions and 573 deletions
|
@ -1,10 +1,9 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
{ config
|
||||
, pkgs
|
||||
, ...
|
||||
}: {
|
||||
home.packages = [
|
||||
(import ./heic-to-jpg.script.nix {inherit pkgs;})
|
||||
(import ./heic-to-jpg.script.nix { inherit pkgs; })
|
||||
(import ./tmux-default.script.nix {
|
||||
inherit pkgs;
|
||||
inherit config;
|
||||
|
|
|
@ -1,54 +1,55 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
}: let
|
||||
{ pkgs
|
||||
, config
|
||||
,
|
||||
}:
|
||||
let
|
||||
git = config.programs.git.package;
|
||||
# checks for any Git repositories with uncommitted changes
|
||||
# used because I am too lazy
|
||||
in
|
||||
pkgs.writeShellScriptBin "git-check" ''
|
||||
#!${pkgs.bash}/bin/bash
|
||||
cd_err() {
|
||||
echo "change-directory occurred error. interrupting..."
|
||||
}
|
||||
git_check() {
|
||||
prev=$1
|
||||
repo_dir=$2
|
||||
#echo "Checking git-cleanliness at $repo_dir, working in $PWD"
|
||||
cd "$repo_dir" || return
|
||||
inside_git_repo="$(${git}/bin/git rev-parse --is-inside-work-tree 2>/dev/null)"
|
||||
result=256
|
||||
default_skip=false
|
||||
if [ "$inside_git_repo" ]; then
|
||||
if [ "$(${git}/bin/git status --porcelain)" ]; then
|
||||
result=0
|
||||
else
|
||||
result=1
|
||||
fi
|
||||
#echo "not a git repository"
|
||||
fi
|
||||
if [[ $result -eq 0 ]]; then
|
||||
echo "DIRTY $PWD"
|
||||
if $default_skip; then return; fi
|
||||
read -rp "Enter dirty directory? [y/n/N(skip others)] " userinput
|
||||
if [[ "$userinput" = "y" ]]; then
|
||||
$SHELL
|
||||
fi
|
||||
if [[ "$userinput" = "N" ]]; then
|
||||
default_skip=true
|
||||
fi
|
||||
fi
|
||||
#echo "going back to $prev"
|
||||
cd "$prev" || return
|
||||
}
|
||||
path=$PWD
|
||||
scan_path=$PWD
|
||||
if [ -z "$1" ]; then
|
||||
scan_path=$PWD
|
||||
pkgs.writeShellScriptBin "git-check" ''
|
||||
#!${pkgs.bash}/bin/bash
|
||||
cd_err() {
|
||||
echo "change-directory occurred error. interrupting..."
|
||||
}
|
||||
git_check() {
|
||||
prev=$1
|
||||
repo_dir=$2
|
||||
#echo "Checking git-cleanliness at $repo_dir, working in $PWD"
|
||||
cd "$repo_dir" || return
|
||||
inside_git_repo="$(${git}/bin/git rev-parse --is-inside-work-tree 2>/dev/null)"
|
||||
result=256
|
||||
default_skip=false
|
||||
if [ "$inside_git_repo" ]; then
|
||||
if [ "$(${git}/bin/git status --porcelain)" ]; then
|
||||
result=0
|
||||
else
|
||||
scan_path=$1
|
||||
result=1
|
||||
fi
|
||||
#echo "not a git repository"
|
||||
fi
|
||||
for item in $(find $scan_path -maxdepth 1 -type d); do
|
||||
git_check "$path" "$item"
|
||||
done
|
||||
''
|
||||
if [[ $result -eq 0 ]]; then
|
||||
echo "DIRTY $PWD"
|
||||
if $default_skip; then return; fi
|
||||
read -rp "Enter dirty directory? [y/n/N(skip others)] " userinput
|
||||
if [[ "$userinput" = "y" ]]; then
|
||||
$SHELL
|
||||
fi
|
||||
if [[ "$userinput" = "N" ]]; then
|
||||
default_skip=true
|
||||
fi
|
||||
fi
|
||||
#echo "going back to $prev"
|
||||
cd "$prev" || return
|
||||
}
|
||||
path=$PWD
|
||||
scan_path=$PWD
|
||||
if [ -z "$1" ]; then
|
||||
scan_path=$PWD
|
||||
else
|
||||
scan_path=$1
|
||||
fi
|
||||
for item in $(find $scan_path -maxdepth 1 -type d); do
|
||||
git_check "$path" "$item"
|
||||
done
|
||||
''
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{pkgs}:
|
||||
{ pkgs }:
|
||||
pkgs.writeShellScriptBin "heic-to-jpg" ''
|
||||
mkdir -p ./heic-to-jpg-out
|
||||
${pkgs.findutils}/bin/find . -type f -print0 | ${pkgs.findutils}/bin/xargs -0 -I "{}" ${pkgs.imagemagick}/bin/magick "{}" -quality 100% ./jpg-out/"{}.conv.jpg"
|
||||
|
|
|
@ -1,18 +1,19 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
}: let
|
||||
{ pkgs
|
||||
, config
|
||||
,
|
||||
}:
|
||||
let
|
||||
tmux = config.programs.tmux.package;
|
||||
windowName = "code-mode";
|
||||
in
|
||||
pkgs.writeShellScriptBin "tmux-code" ''
|
||||
#!${pkgs.bash}/bin/bash
|
||||
${tmux}/bin/tmux has-session -t ${windowName} 2>/dev/null
|
||||
if [ $? != 0 ]; then
|
||||
# setting up session
|
||||
${tmux}/bin/tmux new -s ${windowName} -d
|
||||
${tmux}/bin/tmux send-keys -t ${windowName} 'nvim' Enter
|
||||
${tmux}/bin/tmux split-window -h
|
||||
fi
|
||||
${tmux}/bin/tmux attach -t ${windowName}
|
||||
''
|
||||
pkgs.writeShellScriptBin "tmux-code" ''
|
||||
#!${pkgs.bash}/bin/bash
|
||||
${tmux}/bin/tmux has-session -t ${windowName} 2>/dev/null
|
||||
if [ $? != 0 ]; then
|
||||
# setting up session
|
||||
${tmux}/bin/tmux new -s ${windowName} -d
|
||||
${tmux}/bin/tmux send-keys -t ${windowName} 'nvim' Enter
|
||||
${tmux}/bin/tmux split-window -h
|
||||
fi
|
||||
${tmux}/bin/tmux attach -t ${windowName}
|
||||
''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue