revamp of nix organization
This commit is contained in:
parent
01a48ac956
commit
4a4014bf59
20 changed files with 369 additions and 129 deletions
50
nix/home/programs/obsidianmd/default.nix
Normal file
50
nix/home/programs/obsidianmd/default.nix
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
{ stdenv, writeScript, gtk3, appimageTools }:
|
||||
|
||||
# run this function like so:
|
||||
# nix-shell --run obsidian -p "callPackage ./path/to/this/file.nix {}"
|
||||
|
||||
let
|
||||
inherit (appimageTools) extractType2 wrapType2;
|
||||
|
||||
name = "obsidian";
|
||||
src = ~/Downloads/Obsidian-0.6.7.AppImage;
|
||||
|
||||
# you can add more paths as required
|
||||
xdg_dirs = builtins.concatStringsSep ":" [
|
||||
"${gtk3}/share/gsettings-schemas/${gtk3.name}"
|
||||
];
|
||||
|
||||
# not necessary, here for debugging purposes
|
||||
# adapted from the original runScript of appimageTools
|
||||
extracted_source = extractType2 { inherit name src; };
|
||||
debugScript = writeScript "run" ''
|
||||
#!${stdenv.shell}
|
||||
|
||||
export APPDIR=${extracted_source}
|
||||
export APPIMAGE_SILENT_INSTALL=1
|
||||
|
||||
# >>> inspect the script running environment here <<<
|
||||
echo "INSPECT: ''${GIO_EXTRA_MODULES:-no extra modules!}"
|
||||
echo "INSPECT: ''${GSETTINGS_SCHEMA_DIR:-no schemas!}"
|
||||
echo "INSPECT: ''${XDG_DATA_DIRS:-no data dirs!}"
|
||||
|
||||
cd $APPDIR
|
||||
exec ./AppRun "$@"
|
||||
'';
|
||||
in wrapType2 {
|
||||
inherit name src;
|
||||
|
||||
# for debugging purposes only
|
||||
#runScript = debugScript;
|
||||
|
||||
extraPkgs = pkgs: with pkgs; [
|
||||
# put runtime dependencies if any here
|
||||
];
|
||||
|
||||
# the magic happens here
|
||||
# other potential variables of interest:
|
||||
# GIO_EXTRA_MODULES, GSETTINGS_SCHEMA_DIR
|
||||
profile = ''
|
||||
export XDG_DATA_DIRS="${xdg_dirs}''${XDG_DATA_DIRS:+:"''$XDG_DATA_DIRS"}"
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue