diff --git a/packages/edit-config/default.nix b/packages/edit-config/default.nix deleted file mode 100644 index 5733587..0000000 --- a/packages/edit-config/default.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ -# Snowfall Lib provides a customized `lib` instance with access to your flake's library -# as well as the libraries available from your flake's inputs. -lib, -# You also have access to your flake's inputs. -inputs, - -# All other arguments come from NixPkgs. You can use `pkgs` to pull packages or helpers -# programmatically or you may add the named attributes as arguments here. -pkgs, stdenv, ... }: - -pkgs.writeShellApplication { - name = "edit-config"; - - runtimeInputs = with pkgs; [ fd fzf ]; - - text = '' - if [[ $# == 0 ]]; then - QUERY="" - else - QUERY="$1" - fi - - FILE=$(fd -H -t f . ~/.dotfiles | fzf --query "$QUERY") - if [[ "$FILE" != "" ]]; then - $EDITOR "$FILE" - else - exit 1 - fi - - read -rp 'Run "home-manager switch"? [Yn]: ' yn - case $yn in - Y | y | Yes | yes | "" ) home-manager switch;; - * ) echo "Not switching home-manager configuration";; - esac - ''; -} diff --git a/packages/open-messaging/default.nix b/packages/open-messaging/default.nix deleted file mode 100644 index edb6e37..0000000 --- a/packages/open-messaging/default.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ - # Snowfall Lib provides a customized `lib` instance with access to your flake's library - # as well as the libraries available from your flake's inputs. - lib, - # You also have access to your flake's inputs. - inputs, - - # All other arguments come from NixPkgs. You can use `pkgs` to pull packages or helpers - # programmatically or you may add the named attributes as arguments here. - pkgs, - stdenv, - ... -}: - -pkgs.writeShellApplication { - name = "open-messaging"; - - runtimeInputs = with pkgs; [ - nheko - telegram-desktop - thunderbird - ]; - - text = '' - thunderbird & - sleep 0.1 - nheko & - sleep 0.1 - telegram-desktop & - ''; -} diff --git a/packages/pob-dev-version/default.nix b/packages/pob-dev-version/default.nix deleted file mode 100644 index 759c55e..0000000 --- a/packages/pob-dev-version/default.nix +++ /dev/null @@ -1,89 +0,0 @@ -{ - pkgs, - stdenv, - lib, - fetchFromGitHub, - unzip, - ... -}: -let - data = stdenv.mkDerivation (finalAttrs: { - pname = "path-of-building-data"; - version = "dev-version"; - - src = fetchFromGitHub { - owner = "PathOfBuildingCommunity"; - repo = "PathOfBuilding"; - rev = "80dfb6f56bb41cad19f9904b3baacc15b8ecf0f7"; - hash = "sha256-apZYU0PrB3wehzJPNNH3aFKLMA/fK5vo+dtgbho6EiM="; - }; - - nativeBuildInputs = [ unzip ]; - - buildCommand = '' - # I have absolutely no idea how this file is generated - # and I don't think I want to know. The Flatpak also does this. - unzip -j -d $out $src/runtime-win32.zip lua/sha1.lua - - # Install the actual data - cp -r $src/src $src/runtime/lua/*.lua $src/manifest.xml $out - - # Pretend this is an official build so we don't get the ugly "dev mode" warning - substituteInPlace $out/manifest.xml --replace ' $out/src/UpdateCheck.lua - ''; - }); -in -stdenv.mkDerivation { - pname = "path-of-building"; - version = "${data.version}-unstable-2023-04-09"; - - src = fetchFromGitHub { - owner = "ernstp"; - repo = "pobfrontend"; - rev = "9faa19aa362f975737169824c1578d5011487c18"; - hash = "sha256-zhw2PZ6ZNMgZ2hG+a6AcYBkeg7kbBHNc2eSt4if17Wk="; - }; - - nativeBuildInputs = with pkgs; [ - meson - ninja - pkg-config - kdePackages.qttools - kdePackages.wrapQtAppsHook - ]; - buildInputs = with pkgs; [ - kdePackages.qtbase - luajit - luajit.pkgs.lua-curl - ]; - - installPhase = '' - runHook preInstall - install -Dm555 pobfrontend $out/bin/pobfrontend - runHook postInstall - ''; - - preFixup = '' - qtWrapperArgs+=( - --set LUA_PATH "$LUA_PATH" - --set LUA_CPATH "$LUA_CPATH" - --chdir "${data}" - ) - ''; - - passthru.data = data; - - meta = { - description = "Offline build planner for Path of Exile"; - homepage = "https://pathofbuilding.community/"; - license = lib.licenses.mit; - maintainers = [ lib.maintainers.k900 ]; - mainProgram = "pobfrontend"; - broken = stdenv.isDarwin; # doesn't find uic6 for some reason - }; -} diff --git a/packages/xwacomcalibrate/default.nix b/packages/xwacomcalibrate/default.nix deleted file mode 100644 index 2c48cef..0000000 --- a/packages/xwacomcalibrate/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ - # Snowfall Lib provides a customized `lib` instance with access to your flake's library - # as well as the libraries available from your flake's inputs. - lib, - # You also have access to your flake's inputs. - inputs, - - # All other arguments come from NixPkgs. You can use `pkgs` to pull packages or helpers - # programmatically or you may add the named attributes as arguments here. - pkgs, - stdenv, - ... -}: - -pkgs.writeShellApplication { - name = "xwacomcalibrate"; - - runtimeInputs = with pkgs; [ - xf86_input_wacom - xorg.xwininfo - xorg.xrandr - xdotool - bc - ]; - - text = ./xwacomcalibrate.sh; -} diff --git a/packages/conda-direnv/default.nix b/pkgs/conda-direnv/default.nix similarity index 57% rename from packages/conda-direnv/default.nix rename to pkgs/conda-direnv/default.nix index abbff74..04a8d35 100644 --- a/packages/conda-direnv/default.nix +++ b/pkgs/conda-direnv/default.nix @@ -1,21 +1,13 @@ { - # Snowfall Lib provides a customized `lib` instance with access to your flake's library - # as well as the libraries available from your flake's inputs. - lib, - # You also have access to your flake's inputs. - inputs, - - # All other arguments come from NixPkgs. You can use `pkgs` to pull packages or helpers - # programmatically or you may add the named attributes as arguments here. - pkgs, - stdenv, - ... + conda, + yq, + writeShellApplication, }: -pkgs.writeShellApplication { +writeShellApplication { name = "conda-direnv"; - runtimeInputs = with pkgs; [ + runtimeInputs = [ conda yq ]; @@ -26,7 +18,7 @@ pkgs.writeShellApplication { exit 1 fi - ENV_NAME=$(${pkgs.yq}/bin/yq ".name" environment.yml -r) + ENV_NAME=$(${yq}/bin/yq ".name" environment.yml -r) if [ "$ENV_NAME" == "" ] || [ "$ENV_NAME" == "null" ]; then echo "Property \"name\" not in environment.yml or empty! Exiting..." exit 1 @@ -39,7 +31,7 @@ pkgs.writeShellApplication { conda activate $ENV_NAME } - exec ${pkgs.conda}/bin/conda-shell + exec ${conda}/bin/conda-shell conda activate $ENV_NAME || condanew echo "Environment active! To update it, run:" diff --git a/pkgs/default.nix b/pkgs/default.nix new file mode 100644 index 0000000..47cb1da --- /dev/null +++ b/pkgs/default.nix @@ -0,0 +1,16 @@ +{ + pkgs ? import { }, + ... +}: +{ + conda-direnv = pkgs.callPackage ./conda-direnv { }; + deploy-to-pianopi = pkgs.callPackage ./deploy-to-pianopi { }; + edit-config = pkgs.callPackage ./edit-config { }; + hyprshot-gui = pkgs.callPackage ./hyprshot-gui { }; + install = pkgs.callPackage ./install { }; + lntocp = pkgs.callPackage ./lntocp { }; + open-messaging = pkgs.callPackage ./open-messaging { }; + pulseaudio-popup = pkgs.callPackage ./pulseaudio-popup { }; + sos = pkgs.callPackage ./sos { }; + xwacomcalibrate = pkgs.callPackage ./xwacomcalibrate { }; +} diff --git a/packages/deploy-to-pianopi/default.nix b/pkgs/deploy-to-pianopi/default.nix similarity index 54% rename from packages/deploy-to-pianopi/default.nix rename to pkgs/deploy-to-pianopi/default.nix index 4ef2a1b..7103820 100644 --- a/packages/deploy-to-pianopi/default.nix +++ b/pkgs/deploy-to-pianopi/default.nix @@ -1,18 +1,12 @@ { -# Snowfall Lib provides a customized `lib` instance with access to your flake's library -# as well as the libraries available from your flake's inputs. -lib, -# You also have access to your flake's inputs. -inputs, + rsync, + writeShellApplication, +}: -# All other arguments come from NixPkgs. You can use `pkgs` to pull packages or helpers -# programmatically or you may add the named attributes as arguments here. -pkgs, stdenv, ... }: - -pkgs.writeShellApplication { +writeShellApplication { name = "deploy-to-pianopi"; - runtimeInputs = with pkgs; [ rsync ]; + runtimeInputs = [ rsync ]; text = '' set -e diff --git a/pkgs/edit-config/default.nix b/pkgs/edit-config/default.nix new file mode 100644 index 0000000..ba36e5b --- /dev/null +++ b/pkgs/edit-config/default.nix @@ -0,0 +1,34 @@ +{ + writeShellApplication, + fd, + fzf, +}: +writeShellApplication { + name = "edit-config"; + + runtimeInputs = [ + fd + fzf + ]; + + text = '' + if [[ $# == 0 ]]; then + QUERY="" + else + QUERY="$1" + fi + + FILE=$(fd -H -t f . ~/.dotfiles | fzf --query "$QUERY") + if [[ "$FILE" != "" ]]; then + $EDITOR "$FILE" + else + exit 1 + fi + + read -rp 'Run "home-manager switch"? [Yn]: ' yn + case $yn in + Y | y | Yes | yes | "" ) home-manager switch;; + * ) echo "Not switching home-manager configuration";; + esac + ''; +} diff --git a/packages/hyprshot-gui/default.nix b/pkgs/hyprshot-gui/default.nix similarity index 88% rename from packages/hyprshot-gui/default.nix rename to pkgs/hyprshot-gui/default.nix index 725d086..e91f784 100644 --- a/packages/hyprshot-gui/default.nix +++ b/pkgs/hyprshot-gui/default.nix @@ -2,8 +2,10 @@ lib, stdenv, fetchFromGitHub, - pkgs, - ... + makeWrapper, + bash, + hyprshot, + zenity, }: stdenv.mkDerivation rec { @@ -17,9 +19,9 @@ stdenv.mkDerivation rec { sha256 = "sha256-XUy6+mFbNL+3zDfS4tWva4DiJeLnRM9S8ECRayTcPfI="; }; - nativeBuildInputs = with pkgs; [ makeWrapper ]; + nativeBuildInputs = [ makeWrapper ]; - buildInputs = with pkgs; [ + buildInputs = [ bash hyprshot zenity diff --git a/packages/install/default.nix b/pkgs/install/default.nix similarity index 100% rename from packages/install/default.nix rename to pkgs/install/default.nix diff --git a/packages/lntocp/default.nix b/pkgs/lntocp/default.nix similarity index 78% rename from packages/lntocp/default.nix rename to pkgs/lntocp/default.nix index 07aa03a..84c1a2c 100644 --- a/packages/lntocp/default.nix +++ b/pkgs/lntocp/default.nix @@ -1,21 +1,11 @@ { - # Snowfall Lib provides a customized `lib` instance with access to your flake's library - # as well as the libraries available from your flake's inputs. - lib, - # You also have access to your flake's inputs. - inputs, - - # All other arguments come from NixPkgs. You can use `pkgs` to pull packages or helpers - # programmatically or you may add the named attributes as arguments here. - pkgs, - stdenv, - ... + writeShellApplication, }: -pkgs.writeShellApplication { +writeShellApplication { name = "lntocp"; - runtimeInputs = with pkgs; [ ]; + runtimeInputs = [ ]; text = '' #!/bin/bash diff --git a/pkgs/open-messaging/default.nix b/pkgs/open-messaging/default.nix new file mode 100644 index 0000000..8373ce0 --- /dev/null +++ b/pkgs/open-messaging/default.nix @@ -0,0 +1,24 @@ +{ + writeShellApplication, + nheko, + telegram-desktop, + thunderbird, +}: + +writeShellApplication { + name = "open-messaging"; + + runtimeInputs = [ + nheko + telegram-desktop + thunderbird + ]; + + text = '' + thunderbird & + sleep 0.1 + nheko & + sleep 0.1 + telegram-desktop & + ''; +} diff --git a/packages/pulseaudio-popup/default.nix b/pkgs/pulseaudio-popup/default.nix similarity index 67% rename from packages/pulseaudio-popup/default.nix rename to pkgs/pulseaudio-popup/default.nix index a2b916e..a4679cf 100644 --- a/packages/pulseaudio-popup/default.nix +++ b/pkgs/pulseaudio-popup/default.nix @@ -1,21 +1,14 @@ { - # Snowfall Lib provides a customized `lib` instance with access to your flake's library - # as well as the libraries available from your flake's inputs. - lib, - # You also have access to your flake's inputs. - inputs, - - # All other arguments come from NixPkgs. You can use `pkgs` to pull packages or helpers - # programmatically or you may add the named attributes as arguments here. - pkgs, - stdenv, - ... + writeShellApplication, + pavucontrol, + jgmenu, + pulseaudio, }: -pkgs.writeShellApplication { +writeShellApplication { name = "pulseaudio-popup"; - runtimeInputs = with pkgs; [ + runtimeInputs = [ pavucontrol jgmenu pulseaudio diff --git a/packages/sos/default.nix b/pkgs/sos/default.nix similarity index 63% rename from packages/sos/default.nix rename to pkgs/sos/default.nix index 894de16..3e6622a 100644 --- a/packages/sos/default.nix +++ b/pkgs/sos/default.nix @@ -1,21 +1,13 @@ { - # Snowfall Lib provides a customized `lib` instance with access to your flake's library - # as well as the libraries available from your flake's inputs. - lib, - # You also have access to your flake's inputs. - inputs, - - # All other arguments come from NixPkgs. You can use `pkgs` to pull packages or helpers - # programmatically or you may add the named attributes as arguments here. - pkgs, - stdenv, - ... + writeShellApplication, + nix-output-monitor, + jq, }: -pkgs.writeShellApplication { +writeShellApplication { name = "sos"; - runtimeInputs = with pkgs; [ + runtimeInputs = [ nix-output-monitor jq ]; diff --git a/pkgs/xwacomcalibrate/default.nix b/pkgs/xwacomcalibrate/default.nix new file mode 100644 index 0000000..c58dcc1 --- /dev/null +++ b/pkgs/xwacomcalibrate/default.nix @@ -0,0 +1,21 @@ +{ + writeShellApplication, + xf86_input_wacom, + xorg, + xdotool, + bc, +}: + +writeShellApplication { + name = "xwacomcalibrate"; + + runtimeInputs = [ + xf86_input_wacom + xorg.xwininfo + xorg.xrandr + xdotool + bc + ]; + + text = ./xwacomcalibrate.sh; +} diff --git a/packages/xwacomcalibrate/xwacomcalibrate.sh b/pkgs/xwacomcalibrate/xwacomcalibrate.sh similarity index 100% rename from packages/xwacomcalibrate/xwacomcalibrate.sh rename to pkgs/xwacomcalibrate/xwacomcalibrate.sh