feat: add custom scripts.
This commit is contained in:
parent
84bf820b93
commit
f1c37c598f
@ -12,6 +12,7 @@
|
|||||||
./hyprland.nix
|
./hyprland.nix
|
||||||
./browsers
|
./browsers
|
||||||
./shell.nix
|
./shell.nix
|
||||||
|
./scripts.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
crony.mangohud.enable = lib.mkDefault true;
|
crony.mangohud.enable = lib.mkDefault true;
|
||||||
@ -26,4 +27,5 @@
|
|||||||
crony.hyprland.enable = lib.mkDefault true;
|
crony.hyprland.enable = lib.mkDefault true;
|
||||||
crony.browsers.enable = lib.mkDefault true;
|
crony.browsers.enable = lib.mkDefault true;
|
||||||
crony.shell.enable = lib.mkDefault true;
|
crony.shell.enable = lib.mkDefault true;
|
||||||
|
crony.scripts.enable = lib.mkDefault true;
|
||||||
}
|
}
|
||||||
|
16
modules/home-manager/scripts.nix
Normal file
16
modules/home-manager/scripts.nix
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
options = {
|
||||||
|
crony.scripts.enable = lib.mkEnableOption "Enable my custom scripts";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.crony.scripts.enable {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
(callPackage ./scripts {inherit pkgs;})
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
7
modules/home-manager/scripts/bin/cue2chd
Executable file
7
modules/home-manager/scripts/bin/cue2chd
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
for File in *.cue; do
|
||||||
|
[ -f "$File" ] || continue
|
||||||
|
chdman createcd -i "$File" -o "${File%.cue}.chd"
|
||||||
|
rm -v "$File" "${File%.cue}"*.bin
|
||||||
|
done
|
23
modules/home-manager/scripts/default.nix
Normal file
23
modules/home-manager/scripts/default.nix
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{pkgs, ...}:
|
||||||
|
with pkgs;
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
pname = "scripts";
|
||||||
|
version = "1";
|
||||||
|
src = ./bin;
|
||||||
|
|
||||||
|
nativeBuildInputs = [makeWrapper];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
|
||||||
|
# move scripts to bin
|
||||||
|
mv ./* $out/bin
|
||||||
|
|
||||||
|
# Fix shebangs for scripts
|
||||||
|
patchShebangs $out/bin
|
||||||
|
|
||||||
|
# Add dependencies to the runtime for my cue2chd script
|
||||||
|
wrapProgram $out/bin/cue2chd \
|
||||||
|
--prefix PATH : ${lib.makeBinPath [mame-tools]}
|
||||||
|
'';
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user