refactor: inherit name from mkPackages

This commit is contained in:
Leon Schwarzäugl 2024-12-29 00:36:04 +01:00
parent d397be861b
commit d538762c7e
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
23 changed files with 81 additions and 147 deletions

View file

@ -1,7 +1,7 @@
{ writeShellApplication, ... }:
{ name, writeShellApplication, ... }:
writeShellApplication {
name = "bak";
inherit name;
text = ''
cp -r "$1"{,.bak}
'';

View file

@ -1,7 +1,7 @@
{ writeShellApplication, fzf, ... }:
{ name, writeShellApplication, fzf, ... }:
writeShellApplication {
name = "cdb";
inherit name;
runtimeInputs = [ fzf ];
text = ''
git checkout "$(git branch --list | grep -v "^\*" | fzf | awk '{print $1}')"

View file

@ -1,7 +1,7 @@
{ writeShellApplication, fzf, ... }:
{ name, writeShellApplication, fzf, ... }:
writeShellApplication {
name = "cdw";
inherit name;
runtimeInputs = [ fzf ];
text = ''
cd "$(git worktree list | fzf | awk '{print $1}')"

View file

@ -1,7 +1,4 @@
{ self, writeShellApplication, emacs30-pgtk, sway, jq }:
let
name = "e";
in
{ self, name, writeShellApplication, emacs30-pgtk, sway, jq }:
writeShellApplication {
inherit name;
runtimeInputs = [ emacs30-pgtk sway jq ];

View file

@ -1,7 +1,4 @@
{ self, writeShellApplication }:
let
name = "fs-diff";
in
{ self, name, writeShellApplication }:
writeShellApplication {
inherit name;
text = builtins.readFile "${self}/scripts/${name}.sh";

View file

@ -1,7 +1,7 @@
{ writeShellApplication, jq, ... }:
{ name, writeShellApplication, jq, ... }:
writeShellApplication {
name = "github-notifications";
inherit name;
runtimeInputs = [ jq ];
text = ''
count=$(curl -u Swarsel:"$(cat /run/user/1000/secrets/github_notif)" https://api.github.com/notifications | jq '. | length')

View file

@ -1,7 +1,7 @@
{ writeShellApplication, fzf, findutils, home-manager, ... }:
{ name, writeShellApplication, fzf, findutils, home-manager, ... }:
writeShellApplication {
name = "hm-specialisation";
inherit name;
runtimeInputs = [ fzf findutils home-manager ];
text = ''
genpath=$(home-manager generations | head -1 | awk '{print $7}')

View file

@ -1,7 +1,4 @@
{ self, writeShellApplication, sway }:
let
name = "opacitytoggle";
in
{ self, name, writeShellApplication, sway }:
writeShellApplication {
inherit name;
runtimeInputs = [ sway ];

View file

@ -1,7 +1,4 @@
{ self, writeShellApplication, libnotify, pass, fuzzel, wtype }:
let
name = "pass-fuzzel";
in
{ self, name, writeShellApplication, libnotify, pass, fuzzel, wtype }:
writeShellApplication {
inherit name;
runtimeInputs = [ libnotify (pass.withExtensions (exts: [ exts.pass-otp ])) fuzzel wtype ];

View file

@ -1,7 +1,4 @@
{ self, writeShellApplication, sway }:
let
name = "screenshare";
in
{ self, name, writeShellApplication, sway }:
writeShellApplication {
inherit name;
runtimeInputs = [ sway ];

View file

@ -1,7 +1,4 @@
{ self, writeShellApplication, openssh }:
let
name = "swarsel-bootstrap";
in
{ self, name, writeShellApplication, openssh }:
writeShellApplication {
inherit name;
runtimeInputs = [ openssh ];

View file

@ -1,7 +1,4 @@
{ self, writeShellApplication, git }:
let
name = "swarsel-install";
in
{ self, name, writeShellApplication, git }:
writeShellApplication {
inherit name;
runtimeInputs = [ git ];

View file

@ -1,7 +1,4 @@
{ self, writeShellApplication, git }:
let
name = "swarsel-postinstall";
in
{ self, name, writeShellApplication, git }:
writeShellApplication {
inherit name;
runtimeInputs = [ git ];

View file

@ -1,7 +1,4 @@
{ self, writeShellApplication, git }:
let
name = "swarsel-rebuild";
in
{ self, name, writeShellApplication, git }:
writeShellApplication {
inherit name;
runtimeInputs = [ git ];

View file

@ -1,7 +1,4 @@
{ self, writeShellApplication, kitty, element-desktop-wayland, vesktop, spotify-player, jq }:
let
name = "swarselcheck";
in
{ self, name, writeShellApplication, kitty, element-desktop-wayland, vesktop, spotify-player, jq }:
writeShellApplication {
inherit name;
runtimeInputs = [ kitty element-desktop-wayland vesktop spotify-player jq ];

View file

@ -1,7 +1,7 @@
{ writeShellApplication, ... }:
{ name, writeShellApplication, ... }:
writeShellApplication {
name = "t2ts";
inherit name;
runtimeInputs = [ ];
text = ''
date -d"$1" +%s

View file

@ -1,7 +1,7 @@
{ writeShellApplication, speechd, ... }:
{ name, writeShellApplication, speechd, ... }:
writeShellApplication {
name = "timer";
inherit name;
runtimeInputs = [ speechd ];
text = ''
sleep "$1"; while true; do spd-say "$2"; sleep 0.5; done;

View file

@ -1,7 +1,7 @@
{ writeShellApplication, ... }:
{ name, writeShellApplication, ... }:
writeShellApplication {
name = "ts2t";
inherit name;
runtimeInputs = [ ];
text = ''
date -d @"$1" 2>/dev/null || date -r "$1"

View file

@ -1,7 +1,4 @@
{ self, writeShellApplication, nvd }:
let
name = "update-checker";
in
{ self, name, writeShellApplication, nvd }:
writeShellApplication {
inherit name;
runtimeInputs = [ nvd ];

View file

@ -1,7 +1,7 @@
{ writeShellApplication, ... }:
{ name, writeShellApplication, ... }:
writeShellApplication {
name = "vershell";
inherit name;
runtimeInputs = [ ];
text = ''
nix shell github:nixos/nixpkgs/"$1"#"$2";

View file

@ -1,7 +1,4 @@
{ self, writeShellApplication, git }:
let
name = "waybarupdate";
in
{ self, name, writeShellApplication, git }:
writeShellApplication {
inherit name;
runtimeInputs = [ git ];