mirror of
https://github.com/sadan4/dotfiles.git
synced 2025-06-22 12:17:00 -04:00
pray
This commit is contained in:
parent
59ee516926
commit
5a3af882ec
61 changed files with 705 additions and 562 deletions
62
common/users/homeModules/scripts/default.nix
Normal file
62
common/users/homeModules/scripts/default.nix
Normal file
|
@ -0,0 +1,62 @@
|
|||
{pkgs, lib, inputs, ...}:
|
||||
let
|
||||
cpkg = import ../../../customPackages { inherit pkgs inputs; };
|
||||
# https://discourse.nixos.org/t/how-to-create-a-script-with-dependencies/7970/6
|
||||
mkScript = { name, version ? "0.0.1", file, env ? [ ] }:
|
||||
pkgs.writeTextFile {
|
||||
name = "${name}-${version}";
|
||||
executable = true;
|
||||
destination = "/bin/${name}";
|
||||
text = ''
|
||||
for i in ${lib.concatStringsSep " " env}; do
|
||||
export PATH="$i/bin:$PATH"
|
||||
done
|
||||
|
||||
exec ${bash}/bin/bash ${file} $@
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
home = {
|
||||
packages = with pkgs; [
|
||||
# env for clipboard command will be required by their respective environemnts
|
||||
(mkScript {
|
||||
name = "paste";
|
||||
file = ./paste.sh;
|
||||
})
|
||||
(mkScript {
|
||||
name = "copy";
|
||||
file = ./copy.sh;
|
||||
})
|
||||
(mkScript {
|
||||
name = "http2ssh";
|
||||
file = ./http2ssh.sh;
|
||||
env = [git];
|
||||
})
|
||||
(mkScript {
|
||||
name = "git_fetchAll";
|
||||
file = ./git_fetchAll.sh;
|
||||
env = [git];
|
||||
})
|
||||
(mkScript {
|
||||
name = "install_eslint";
|
||||
file = ./install_eslint.sh;
|
||||
})
|
||||
(mkScript {
|
||||
name = "math";
|
||||
file = ./math.sh;
|
||||
env = [python3];
|
||||
})
|
||||
(mkScript {
|
||||
name = "hashi18n";
|
||||
file = ./hashi18n.sh;
|
||||
})
|
||||
];
|
||||
file = {
|
||||
scripts = {
|
||||
source = "${cpkg.scripts}";
|
||||
target = ".scripts";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue