summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormediocregopher <mediocregopher@gmail.com>2021-10-05 21:57:22 -0600
committermediocregopher <mediocregopher@gmail.com>2021-10-05 21:57:22 -0600
commit0cd135b57dddc5264d6214867f2b86670112968d (patch)
tree8f47daede67c38e8899ae1ce9f80cedd3e24d3b4
parent07ab3a77b44944a1ac234fbd717391f36370416e (diff)
got AppImage build working on my desktop
On my desktop the AppImage build kept picking up the `Htop.desktop` file, whereas on my laptop it would pick up the `medicore-loadout.desktop` file as expected. I'm not sure of why the discrepancy, maybe some difference in the directory listing order. In any case, I fixed it by deleting all desktop files, except the loadout's, from the AppDir.
-rw-r--r--README.md30
-rw-r--r--default.nix57
2 files changed, 41 insertions, 46 deletions
diff --git a/README.md b/README.md
index ffee234..137a104 100644
--- a/README.md
+++ b/README.md
@@ -73,31 +73,33 @@ binary:
./Mediocre_Loadout-x86_64.AppImage nvim
```
+NOTE that the AppImage doesn't like working with files within `/tmp`. I don't
+know of a workaround for this at the moment.
+
# Available Components
Components of the loadout can be run separate from the others, depending on what
you're trying to do. The following components are available to be run:
-* `zsh` (`shell` in the AppImage): My terminal shell. There's some customization
+* `zsh`: My terminal shell. There's some customization
to it but it should be pretty self-explanatory to "just use".
-* `nvim` (`editor` in the AppImage): My neovim development environment, plus all
- plugins I use. I mostly work in golang, so it's most tuned for that, but it
- does fine for general dev work. `Ctrl-N` will open NerdTree, `<backslash>tn`
- will open a terminal tab, and `<backslash>th`/`<backslash>tl` can be used to
- navigate tabs. There's a lot more customization that's been done, see the
- `nvim/init.vim` file.
+* `nvim`: My neovim development environment, plus all plugins I use. I mostly
+ work in golang, so it's most tuned for that, but it does fine for general dev
+ work. `Ctrl-N` will open NerdTree, `<backslash>tn` will open a terminal tab,
+ and `<backslash>th`/`<backslash>tl` can be used to navigate tabs. There's a
+ lot more customization that's been done, see the `nvim/init.vim` file.
-* `alacritty` (`gui` in the AppImage, might be broken): Terminal which I use.
- Yes, I always use a light-mode theme, because I work in well lit spaces
- generally. There's not much else to this.
+* `alacritty`: Terminal GUI which I use. Yes, I always use a light-mode theme,
+ because I work in well lit spaces generally. There's not much else to this.
-* `awesome` (`wm` in the AppImage, almost definitely broken): My window manager.
- There's so much customization I couldn't begin to start. `Meta+Enter` should
- open a terminal, where `Meta` is probably the windows key on your keyboard.
+* `awesome`: My window manager. There's so much customization I couldn't begin
+ to start. `Meta+Enter` should open a terminal, where `Meta` is probably the
+ windows key on your keyboard.
# Status
This configuration is still fairly new, and so expect it to be fairly broken.
I'll be updating it as I go though, so it should stabalize into something
-functional.
+functional. I don't test the AppImage build very much, it's more of a gimick,
+but the shell and dev environment should work well from it at least.
diff --git a/default.nix b/default.nix
index 950dee0..bec01b7 100644
--- a/default.nix
+++ b/default.nix
@@ -69,62 +69,55 @@
];
};
- appimageEntrypoint = pkgs.writeScriptBin "mediocre-loadout" ''
+ appimageEntrypoint = pkgs.writeScript "mediocre-loadout" ''
#!${pkgs.bash}/bin/bash
cmd="$1"; shift;
- if [ "$cmd" = "editor" ]; then exec nvim "$@"; fi
- if [ "$cmd" = "shell" ]; then exec zsh "$@"; fi
- if [ "$cmd" = "gui" ]; then exec alacritty "$@"; fi
- if [ "$cmd" = "wm" ]; then exec awesome "$@"; fi
+ if [ "$cmd" = "nvim" ]; then exec nvim "$@"; fi
+ if [ "$cmd" = "zsh" ]; then exec zsh "$@"; fi
+ if [ "$cmd" = "alacritty" ]; then exec alacritty "$@"; fi
+ if [ "$cmd" = "awesome" ]; then exec awesome "$@"; fi
- echo "USAGE: $0 [editor|shell|gui|wm] [passthrough args...]"
+ echo "USAGE: $0 [nvim|zsh|alacritty|awesome] [passthrough args...]"
exit 1
'';
- appimageIcon = pkgs.stdenv.mkDerivation {
- name = "mediocre-loadout-icon";
- src = ./bonzi.png;
- builder = builtins.toFile "builder.sh" ''
- source $stdenv/setup
- dir=share/icons/hicolor/256x256/apps
- mkdir -p "$out"/$dir
- cp $src "$out"/$dir/mediocre-loadout.png
- '';
- };
-
- appimageDesktopFile = pkgs.writeTextDir "share/applications/mediocre-loadout.desktop" ''
+ appimageDesktopFile = builtins.toFile "mediocre-loadout.desktop" ''
[Desktop Entry]
Name=Mediocre Loadout
- Exec=mediocre-loadout gui
+ Exec=mediocre-loadout alacritty
Icon=mediocre-loadout
Type=Application
Categories=Utility;
'';
- appimageTarget = pkgs.buildEnv {
- name = "mediocre-loadout-target";
- paths = [
- loadout
- appimageEntrypoint
- appimageIcon
- appimageDesktopFile
- ];
- };
-
- appimageTargetFlat = pkgs.stdenv.mkDerivation {
+ appdir = pkgs.stdenv.mkDerivation {
name = "mediocre-loadout-target-flat";
- src = appimageTarget;
+
+ inherit appimageEntrypoint appimageDesktopFile;
+ appimageIcon = ./bonzi.png;
+ src = loadout;
+
builder = builtins.toFile "builder.sh" ''
source $stdenv/setup
+
cp -rL "$src" "$out"
+ chmod -R +w "$out"
+
+ rm -rf "$out"/share/applications/*
+ cp "$appimageDesktopFile" "$out"/share/applications/mediocre-loadout.desktop
+ cp "$appimageEntrypoint" "$out"/bin/mediocre-loadout
+
+ icondir=share/icons/hicolor/256x256/apps
+ mkdir -p "$out"/$icondir
+ cp "$appimageIcon" "$out"/$icondir/mediocre-loadout.png
'';
};
appimage = ((import ./appimage.nix) { pkgsSrc = pkgsSrc; }) {
name = "mediocre-loadout";
- target = appimageTargetFlat;
+ target = appdir;
};
}