mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
fix[work]: fix aws,cdr commands, easier git switch in emacs
This commit is contained in:
parent
40e1adc402
commit
568350df9c
52 changed files with 4610 additions and 1364 deletions
8
pkgs/flake/bak/default.nix
Normal file
8
pkgs/flake/bak/default.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{ name, writeShellApplication, ... }:
|
||||
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
text = ''
|
||||
cp -r "$1"{,.bak}
|
||||
'';
|
||||
}
|
||||
9
pkgs/flake/cdb/default.nix
Normal file
9
pkgs/flake/cdb/default.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{ name, writeShellApplication, fzf, ... }:
|
||||
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
runtimeInputs = [ fzf ];
|
||||
text = ''
|
||||
git checkout "$(git branch --list | grep -v "^\*" | fzf | awk '{print $1}')"
|
||||
'';
|
||||
}
|
||||
9
pkgs/flake/cdw/default.nix
Normal file
9
pkgs/flake/cdw/default.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{ name, writeShellApplication, fzf, ... }:
|
||||
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
runtimeInputs = [ fzf ];
|
||||
text = ''
|
||||
cd "$(git worktree list | fzf | awk '{print $1}')"
|
||||
'';
|
||||
}
|
||||
29
pkgs/flake/cura5/default.nix
Normal file
29
pkgs/flake/cura5/default.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# taken from https://github.com/NixOS/nixpkgs/issues/186570#issuecomment-1627797219
|
||||
{ appimageTools, fetchurl, writeScriptBin, pkgs, ... }:
|
||||
|
||||
|
||||
let
|
||||
cura5 = appimageTools.wrapType2 rec {
|
||||
pname = "cura5";
|
||||
version = "5.9.0";
|
||||
src = fetchurl {
|
||||
url = "https://github.com/Ultimaker/Cura/releases/download/${version}/UltiMaker-Cura-${version}-linux-X64.AppImage";
|
||||
hash = "sha256-STtVeM4Zs+PVSRO3cI0LxnjRDhOxSlttZF+2RIXnAp4=";
|
||||
};
|
||||
extraPkgs = pkgs: with pkgs; [ ];
|
||||
};
|
||||
in
|
||||
writeScriptBin "cura" ''
|
||||
#! ${pkgs.bash}/bin/bash
|
||||
# AppImage version of Cura loses current working directory and treats all paths relative to $HOME.
|
||||
# So we convert each of the files passed as argument to an absolute path.
|
||||
# This fixes use cases like `cd /path/to/my/files; cura mymodel.stl anothermodel.stl`.
|
||||
args=()
|
||||
for a in "$@"; do
|
||||
if [ -e "$a" ]; then
|
||||
a="$(realpath "$a")"
|
||||
fi
|
||||
args+=("$a")
|
||||
done
|
||||
exec "${cura5}/bin/cura5" "''${args[@]}"
|
||||
''
|
||||
11
pkgs/flake/default.nix
Normal file
11
pkgs/flake/default.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{ self, lib, pkgs, ... }:
|
||||
let
|
||||
mkPackages = names: pkgs: builtins.listToAttrs (map
|
||||
(name: {
|
||||
inherit name;
|
||||
value = pkgs.callPackage "${self}/pkgs/flake/${name}" { inherit self name; };
|
||||
})
|
||||
names);
|
||||
packageNames = lib.swarselsystems.readNix "pkgs/flake";
|
||||
in
|
||||
mkPackages packageNames pkgs
|
||||
6
pkgs/flake/e/default.nix
Normal file
6
pkgs/flake/e/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ self, name, writeShellApplication, emacs30-pgtk, sway, jq }:
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
runtimeInputs = [ emacs30-pgtk sway jq ];
|
||||
text = builtins.readFile "${self}/files/scripts/${name}.sh";
|
||||
}
|
||||
9
pkgs/flake/endme/default.nix
Normal file
9
pkgs/flake/endme/default.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{ name, writeShellApplication, ... }:
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
text = ''
|
||||
set -euo pipefail
|
||||
systemctl --user stop graphical-session.target
|
||||
systemctl --user stop graphical-session-pre.target
|
||||
'';
|
||||
}
|
||||
95
pkgs/flake/eontimer/default.nix
Normal file
95
pkgs/flake/eontimer/default.nix
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
{ lib
|
||||
, python3
|
||||
, fetchFromGitHub
|
||||
, makeDesktopItem
|
||||
, writeShellScript
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
wrapper = writeShellScript "eontimer-wrapper" ''
|
||||
export QT_QPA_PLATFORM=xcb
|
||||
exec @out@/bin/EonTimer
|
||||
'';
|
||||
in
|
||||
python3.pkgs.buildPythonApplication rec {
|
||||
pname = "eontimer";
|
||||
version = "3.0.0-rc.6";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "DasAmpharos";
|
||||
repo = "EonTimer";
|
||||
rev = version;
|
||||
hash = "sha256-+XN/VGGlEg2gVncRZrWDOZ2bfxt8xyIu22F2wHlG6YI=";
|
||||
};
|
||||
|
||||
build-system = [
|
||||
python3.pkgs.setuptools
|
||||
python3.pkgs.wheel
|
||||
];
|
||||
|
||||
dependencies = with python3.pkgs; [
|
||||
altgraph
|
||||
certifi
|
||||
charset-normalizer
|
||||
idna
|
||||
libsass
|
||||
macholib
|
||||
packaging
|
||||
pillow
|
||||
pipdeptree
|
||||
platformdirs
|
||||
pyinstaller
|
||||
pyinstaller-hooks-contrib
|
||||
pyside6
|
||||
requests
|
||||
setuptools
|
||||
shiboken6
|
||||
urllib3
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
python3.pkgs.pyinstaller
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
pyinstaller --clean --noconfirm EonTimer.spec
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/bin
|
||||
mkdir -p $out/share/applications
|
||||
cp dist/EonTimer $out/bin/
|
||||
install -Dm755 -T ${wrapper} $out/bin/eontimer
|
||||
substituteInPlace $out/bin/eontimer --subst-var out
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
install -Dm755 -t $out/share/applications ${
|
||||
makeDesktopItem {
|
||||
name = "eontimer";
|
||||
desktopName = "EonTimer";
|
||||
comment = "Start EonTimer";
|
||||
exec = "eontimer";
|
||||
}
|
||||
}/share/applications/eontimer.desktop
|
||||
'';
|
||||
|
||||
|
||||
|
||||
meta = {
|
||||
description = "Pokémon RNG Timer";
|
||||
homepage = "https://github.com/DasAmpharos/EonTimer";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ ];
|
||||
mainProgram = "eon-timer";
|
||||
};
|
||||
}
|
||||
11
pkgs/flake/fhs/default.nix
Normal file
11
pkgs/flake/fhs/default.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{ name, pkgs, ... }:
|
||||
let
|
||||
base = pkgs.appimageTools.defaultFhsEnvArgs;
|
||||
in
|
||||
pkgs.buildFHSEnv (base // {
|
||||
inherit name;
|
||||
targetPkgs = pkgs: (base.targetPkgs pkgs) ++ [ pkgs.pkg-config ];
|
||||
profile = "export FHS=1";
|
||||
runScript = "zsh";
|
||||
extraOutputsToInstall = [ "dev" ];
|
||||
})
|
||||
5
pkgs/flake/fs-diff/default.nix
Normal file
5
pkgs/flake/fs-diff/default.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{ self, name, writeShellApplication }:
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
text = builtins.readFile "${self}/files/scripts/${name}.sh";
|
||||
}
|
||||
63
pkgs/flake/git-replace/default.nix
Normal file
63
pkgs/flake/git-replace/default.nix
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
{ name, writeShellApplication, git, gnugrep, findutils, ... }:
|
||||
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
runtimeInputs = [ git gnugrep findutils ];
|
||||
text = ''
|
||||
|
||||
function help_and_exit() {
|
||||
echo
|
||||
echo "Remotely installs SwarselSystem on a target machine including secret deployment."
|
||||
echo
|
||||
echo "USAGE: $0 [-f/-t} <from> <to>"
|
||||
echo
|
||||
echo "ARGS:"
|
||||
echo " -f | --filenames Replace in filenames."
|
||||
echo " -d | --directory Replace text in files within this directory."
|
||||
echo " -r | --repo Replace text in files in the entire git repo."
|
||||
echo " -h | --help Print this help."
|
||||
exit 0
|
||||
}
|
||||
|
||||
target_files=false
|
||||
target_repo=false
|
||||
target_dirs=false
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
-f | --filenames)
|
||||
shift
|
||||
target_files=true
|
||||
;;
|
||||
-r | --repo)
|
||||
shift
|
||||
target_repo=rue
|
||||
;;
|
||||
-d | --directory)
|
||||
shift
|
||||
target_dirs=rue
|
||||
;;
|
||||
-h | --help) help_and_exit ;;
|
||||
*)
|
||||
echo "Invalid option detected."
|
||||
help_and_exit
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
|
||||
if [[ $target_files == "true" ]]; then
|
||||
for file in $(git ls-files | grep "$1" | sed -e "s/\($1[^/]*\).*/\1/" | uniq); do
|
||||
git mv "$file" "''${file//$1/$2}"
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ $target_repo == "true" ]]; then
|
||||
git grep -l "$1" | xargs sed -i "s/$1/$2/g"
|
||||
fi
|
||||
|
||||
if [[ $target_dirs == "true" ]]; then
|
||||
grep -rl "$1" . | xargs sed -i "s/$1/$2/g"
|
||||
fi
|
||||
'';
|
||||
}
|
||||
13
pkgs/flake/github-notifications/default.nix
Normal file
13
pkgs/flake/github-notifications/default.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ name, writeShellApplication, jq, ... }:
|
||||
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
runtimeInputs = [ jq ];
|
||||
text = ''
|
||||
count=$(curl -u Swarsel:"$(cat "$GITHUB_NOTIFICATION_TOKEN_PATH")" https://api.github.com/notifications | jq '. | length')
|
||||
|
||||
if [[ "$count" != "0" ]]; then
|
||||
echo "{\"text\":\"$count\"}"
|
||||
fi
|
||||
'';
|
||||
}
|
||||
11
pkgs/flake/hm-specialisation/default.nix
Normal file
11
pkgs/flake/hm-specialisation/default.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{ name, writeShellApplication, fzf, findutils, home-manager, ... }:
|
||||
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
runtimeInputs = [ fzf findutils home-manager ];
|
||||
text = ''
|
||||
genpath=$(home-manager generations | head -1 | awk '{print $7}')
|
||||
dirs=$(find "$genpath/specialisation" -type l 2>/dev/null; [ -d "$genpath" ] && echo "$genpath")
|
||||
"$(echo "$dirs" | fzf --prompt="Choose home-manager specialisation to activate")"/activate
|
||||
'';
|
||||
}
|
||||
11
pkgs/flake/kanshare/default.nix
Normal file
11
pkgs/flake/kanshare/default.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{ name, writeShellApplication, wlr-randr, busybox, wl-mirror, mako, ... }:
|
||||
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
runtimeInputs = [ wlr-randr busybox wl-mirror mako ];
|
||||
text = ''
|
||||
makoctl mode -a do-not-disturb
|
||||
wlr-randr | grep "$2" | cut -d" " -f1 | xargs -I{} wl-present mirror "$1" --fullscreen-output {}
|
||||
makoctl mode -r do-not-disturb
|
||||
'';
|
||||
}
|
||||
6
pkgs/flake/opacitytoggle/default.nix
Normal file
6
pkgs/flake/opacitytoggle/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ self, name, writeShellApplication, sway }:
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
runtimeInputs = [ sway ];
|
||||
text = builtins.readFile "${self}/files/scripts/${name}.sh";
|
||||
}
|
||||
6
pkgs/flake/pass-fuzzel/default.nix
Normal file
6
pkgs/flake/pass-fuzzel/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ self, name, writeShellApplication, libnotify, pass, fuzzel, wtype }:
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
runtimeInputs = [ libnotify (pass.withExtensions (exts: [ exts.pass-otp ])) fuzzel wtype ];
|
||||
text = builtins.readFile "${self}/files/scripts/${name}.sh";
|
||||
}
|
||||
5
pkgs/flake/project/default.nix
Normal file
5
pkgs/flake/project/default.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{ self, name, writeShellApplication }:
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
text = builtins.readFile "${self}/files/scripts/${name}.sh";
|
||||
}
|
||||
6
pkgs/flake/quickpass/default.nix
Normal file
6
pkgs/flake/quickpass/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ self, name, writeShellApplication, libnotify, pass, wtype }:
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
runtimeInputs = [ libnotify pass wtype ];
|
||||
text = builtins.readFile "${self}/files/scripts/${name}.sh";
|
||||
}
|
||||
6
pkgs/flake/sshrm/default.nix
Normal file
6
pkgs/flake/sshrm/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ self, name, writeShellApplication, openssh }:
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
runtimeInputs = [ openssh ];
|
||||
text = builtins.readFile "${self}/files/scripts/${name}.sh";
|
||||
}
|
||||
6
pkgs/flake/swarsel-bootstrap/default.nix
Normal file
6
pkgs/flake/swarsel-bootstrap/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ self, name, writeShellApplication, openssh }:
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
runtimeInputs = [ openssh ];
|
||||
text = builtins.readFile "${self}/files/scripts/${name}.sh";
|
||||
}
|
||||
15
pkgs/flake/swarsel-build/default.nix
Normal file
15
pkgs/flake/swarsel-build/default.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ name, nix-output-monitor, writeShellApplication, ... }:
|
||||
writeShellApplication {
|
||||
runtimeInputs = [ nix-output-monitor ];
|
||||
inherit name;
|
||||
text = ''
|
||||
set -euo pipefail
|
||||
[[ "$#" -ge 1 ]] \
|
||||
|| { echo "usage: build <HOST>..." >&2; exit 1; }
|
||||
HOSTS=()
|
||||
for h in "$@"; do
|
||||
HOSTS+=(".#nixosConfigurations.$h.config.system.build.toplevel")
|
||||
done
|
||||
nom build --no-link --print-out-paths --show-trace "''${HOSTS[@]}"
|
||||
'';
|
||||
}
|
||||
123
pkgs/flake/swarsel-deploy/default.nix
Normal file
123
pkgs/flake/swarsel-deploy/default.nix
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
# heavily inspired from https://github.com/oddlama/nix-config/blob/d42cbde676001a7ad8a3cace156e050933a4dcc3/pkgs/deploy.nix
|
||||
{ name, bc, nix-output-monitor, writeShellApplication, ... }:
|
||||
writeShellApplication {
|
||||
runtimeInputs = [ bc nix-output-monitor ];
|
||||
inherit name;
|
||||
text = ''
|
||||
set -euo pipefail
|
||||
shopt -s lastpipe # allow cmd | readarray
|
||||
|
||||
function die() {
|
||||
echo "error: $*" >&2
|
||||
exit 1
|
||||
}
|
||||
function show_help() {
|
||||
echo 'Usage: deploy [OPTIONS] <host,...> [ACTION]'
|
||||
echo "Builds, pushes and activates nixosConfigurations on target systems."
|
||||
echo ""
|
||||
echo 'ACTION:'
|
||||
echo ' switch [default] Switch immediately to the new configuration and make it the boot default'
|
||||
echo ' boot Make the configuration the new boot default'
|
||||
echo " test Activate the configuration but don't make it the boot default"
|
||||
echo " dry-activate Don't activate, just show what would be done"
|
||||
echo ""
|
||||
echo 'OPTIONS: [passed to nix build]'
|
||||
}
|
||||
|
||||
function time_start() {
|
||||
T_START=$(date +%s.%N)
|
||||
}
|
||||
|
||||
function time_next() {
|
||||
T_END=$(date +%s.%N)
|
||||
T_LAST=$(${bc}/bin/bc <<< "scale=1; ($T_END - $T_START)/1")
|
||||
T_START="$T_END"
|
||||
}
|
||||
|
||||
USER_FLAKE_DIR=$(git rev-parse --show-toplevel 2> /dev/null || pwd) ||
|
||||
die "Could not determine current working directory. Something went very wrong."
|
||||
[[ -e "$USER_FLAKE_DIR/flake.nix" ]] ||
|
||||
die "Could not determine location of your project's flake.nix. Please run this at or below your main directory containing the flake.nix."
|
||||
cd "$USER_FLAKE_DIR"
|
||||
|
||||
[[ $# -gt 0 ]] || {
|
||||
show_help
|
||||
exit 1
|
||||
}
|
||||
|
||||
OPTIONS=()
|
||||
POSITIONAL_ARGS=()
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
"help" | "--help" | "-help" | "-h")
|
||||
show_help
|
||||
exit 1
|
||||
;;
|
||||
|
||||
-*) OPTIONS+=("$1") ;;
|
||||
*) POSITIONAL_ARGS+=("$1") ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
[[ ''${#POSITIONAL_ARGS[@]} -ge 1 ]] ||
|
||||
die "Missing argument: <hosts...>"
|
||||
[[ ''${#POSITIONAL_ARGS[@]} -le 2 ]] ||
|
||||
die "Too many arguments given."
|
||||
|
||||
tr , '\n' <<< "''${POSITIONAL_ARGS[0]}" | sort -u | readarray -t HOSTS
|
||||
ACTION="''${POSITIONAL_ARGS[1]-switch}"
|
||||
|
||||
# Expand flake paths for hosts definitions
|
||||
declare -A TOPLEVEL_FLAKE_PATHS
|
||||
for host in "''${HOSTS[@]}"; do
|
||||
TOPLEVEL_FLAKE_PATHS["$host"]=".#nixosConfigurations.$host.config.system.build.toplevel"
|
||||
done
|
||||
|
||||
time_start
|
||||
|
||||
# Get outputs of all derivations (should be cached)
|
||||
declare -A TOPLEVEL_STORE_PATHS
|
||||
for host in "''${HOSTS[@]}"; do
|
||||
toplevel="''${TOPLEVEL_FLAKE_PATHS["$host"]}"
|
||||
# Make sudo call to get prompt out of the way
|
||||
sudo echo "[1;36m Building [m📦 [34m$host[m"
|
||||
nix build --no-link "''${OPTIONS[@]}" --show-trace --log-format internal-json -v "$toplevel" |& ${nix-output-monitor}/bin/nom --json ||
|
||||
die "Failed to get derivation path for $host from ''${TOPLEVEL_FLAKE_PATHS["$host"]}"
|
||||
TOPLEVEL_STORE_PATHS["$host"]=$(nix build --no-link --print-out-paths "''${OPTIONS[@]}" "$toplevel")
|
||||
time_next
|
||||
echo "[1;32m Built [m✅ [34m$host[m [33m''${TOPLEVEL_STORE_PATHS["$host"]}[m [90min ''${T_LAST}s[m"
|
||||
done
|
||||
|
||||
current_host=$(hostname)
|
||||
|
||||
for host in "''${HOSTS[@]}"; do
|
||||
store_path="''${TOPLEVEL_STORE_PATHS["$host"]}"
|
||||
|
||||
if [ "$host" = "$current_host" ]; then
|
||||
echo -e "\033[1;36m Running locally for $host... \033[m"
|
||||
ssh_prefix="sudo"
|
||||
else
|
||||
echo -e "\033[1;36m Copying \033[m➡️ \033[34m$host\033[m"
|
||||
nix copy --to "ssh://$host" "$store_path"
|
||||
time_next
|
||||
echo -e "\033[1;32m Copied \033[m✅ \033[34m$host\033[m \033[90min ''${T_LAST}s\033[m"
|
||||
ssh_prefix="ssh $host --"
|
||||
fi
|
||||
|
||||
echo -e "\033[1;36m Applying \033[m⚙️ \033[34m$host\033[m"
|
||||
prev_system=$($ssh_prefix readlink -e /nix/var/nix/profiles/system)
|
||||
$ssh_prefix /run/current-system/sw/bin/nix-env --profile /nix/var/nix/profiles/system --set "$store_path" ||
|
||||
die "Failed to set system profile"
|
||||
$ssh_prefix "$store_path"/bin/switch-to-configuration "$ACTION" ||
|
||||
echo "Error while activating new system" >&2
|
||||
|
||||
if [[ -n $prev_system ]]; then
|
||||
$ssh_prefix nvd --color always diff "$prev_system" "$store_path" || true
|
||||
fi
|
||||
|
||||
time_next
|
||||
echo -e "\033[1;32m Applied \033[m✅ \033[34m$host\033[m \033[90min ''${T_LAST}s\033[m"
|
||||
done
|
||||
'';
|
||||
}
|
||||
6
pkgs/flake/swarsel-displaypower/default.nix
Normal file
6
pkgs/flake/swarsel-displaypower/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ self, name, writeShellApplication, sway }:
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
runtimeInputs = [ sway ];
|
||||
text = builtins.readFile "${self}/files/scripts/${name}.sh";
|
||||
}
|
||||
6
pkgs/flake/swarsel-install/default.nix
Normal file
6
pkgs/flake/swarsel-install/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ self, name, writeShellApplication, git }:
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
runtimeInputs = [ git ];
|
||||
text = builtins.readFile "${self}/files/scripts/${name}.sh";
|
||||
}
|
||||
8
pkgs/flake/swarsel-instantiate/default.nix
Normal file
8
pkgs/flake/swarsel-instantiate/default.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{ name, writeShellApplication, ... }:
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
text = ''
|
||||
set -euo pipefail
|
||||
nix-instantiate --strict --eval --expr "let lib = import <nixpkgs/lib>; in $*"
|
||||
'';
|
||||
}
|
||||
20
pkgs/flake/swarsel-mgba/default.nix
Normal file
20
pkgs/flake/swarsel-mgba/default.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{ appimageTools, fetchurl, ... }:
|
||||
let
|
||||
pname = "mgba";
|
||||
version = "0.10.4";
|
||||
src = fetchurl {
|
||||
url = "https://github.com/mgba-emu/mgba/releases/download/${version}/mGBA-${version}-appimage-x64.appimage";
|
||||
hash = "sha256-rDihDfuA8DqxvCe6UeavCzpjeU+fSqUbFnyTNC2dc1I=";
|
||||
};
|
||||
appimageContents = appimageTools.extractType2 { inherit pname version src; };
|
||||
in
|
||||
appimageTools.wrapType2 {
|
||||
inherit pname version src;
|
||||
extraInstallCommands = ''
|
||||
install -Dm444 ${appimageContents}/io.mgba.mGBA.desktop -t $out/share/applications
|
||||
substituteInPlace $out/share/applications/io.mgba.mGBA.desktop \
|
||||
--replace-fail 'Exec=mgba-qt %f' 'Exec=mgba'
|
||||
cp -r ${appimageContents}/usr/share/icons $out/share
|
||||
'';
|
||||
|
||||
}
|
||||
6
pkgs/flake/swarsel-postinstall/default.nix
Normal file
6
pkgs/flake/swarsel-postinstall/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ self, name, writeShellApplication, git }:
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
runtimeInputs = [ git ];
|
||||
text = builtins.readFile "${self}/files/scripts/${name}.sh";
|
||||
}
|
||||
6
pkgs/flake/swarsel-rebuild/default.nix
Normal file
6
pkgs/flake/swarsel-rebuild/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ self, name, writeShellApplication, git }:
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
runtimeInputs = [ git ];
|
||||
text = builtins.readFile "${self}/files/scripts/${name}.sh";
|
||||
}
|
||||
6
pkgs/flake/swarselcheck-niri/default.nix
Normal file
6
pkgs/flake/swarselcheck-niri/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ self, name, writeShellApplication, kitty, element-desktop, vesktop, spotify-player, jq }:
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
runtimeInputs = [ kitty element-desktop vesktop spotify-player jq ];
|
||||
text = builtins.readFile "${self}/files/scripts/${name}.sh";
|
||||
}
|
||||
6
pkgs/flake/swarselcheck/default.nix
Normal file
6
pkgs/flake/swarselcheck/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ self, name, writeShellApplication, kitty, element-desktop, vesktop, spotify-player, jq }:
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
runtimeInputs = [ kitty element-desktop vesktop spotify-player jq ];
|
||||
text = builtins.readFile "${self}/files/scripts/${name}.sh";
|
||||
}
|
||||
6
pkgs/flake/swarselzellij/default.nix
Normal file
6
pkgs/flake/swarselzellij/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ self, name, writeShellApplication, kitty }:
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
runtimeInputs = [ kitty ];
|
||||
text = builtins.readFile "${self}/files/scripts/${name}.sh";
|
||||
}
|
||||
9
pkgs/flake/t2ts/default.nix
Normal file
9
pkgs/flake/t2ts/default.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{ name, writeShellApplication, ... }:
|
||||
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
runtimeInputs = [ ];
|
||||
text = ''
|
||||
date -d"$1" +%s
|
||||
'';
|
||||
}
|
||||
9
pkgs/flake/timer/default.nix
Normal file
9
pkgs/flake/timer/default.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{ name, writeShellApplication, speechd, ... }:
|
||||
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
runtimeInputs = [ speechd ];
|
||||
text = ''
|
||||
sleep "$1"; while true; do spd-say "$2"; sleep 0.5; done;
|
||||
'';
|
||||
}
|
||||
9
pkgs/flake/ts2t/default.nix
Normal file
9
pkgs/flake/ts2t/default.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{ name, writeShellApplication, ... }:
|
||||
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
runtimeInputs = [ ];
|
||||
text = ''
|
||||
date -d @"$1" 2>/dev/null || date -r "$1"
|
||||
'';
|
||||
}
|
||||
9
pkgs/flake/vershell/default.nix
Normal file
9
pkgs/flake/vershell/default.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{ name, writeShellApplication, ... }:
|
||||
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
runtimeInputs = [ ];
|
||||
text = ''
|
||||
nix shell github:nixos/nixpkgs/"$1"#"$2";
|
||||
'';
|
||||
}
|
||||
6
pkgs/flake/waybarupdate/default.nix
Normal file
6
pkgs/flake/waybarupdate/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ self, name, writeShellApplication, git }:
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
runtimeInputs = [ git ];
|
||||
text = builtins.readFile "${self}/files/scripts/${name}.sh";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue