diff --git a/hosts/nixdesk/default.nix b/hosts/nixdesk/default.nix index 7fc15cd..d0cd579 100644 --- a/hosts/nixdesk/default.nix +++ b/hosts/nixdesk/default.nix @@ -10,6 +10,7 @@ [ ./hardware.nix ./profiles/hibernate-boot.nix + ./profiles/devshells.nix ./profiles/samba-mount.nix ./profiles/wireguard.nix ./profiles/restic-server.nix @@ -130,6 +131,7 @@ "discord-ptb" "obsidian" "rider" + "clion" "idea-ultimate" "android-studio-stable" "krunker" diff --git a/hosts/nixdesk/home.nix b/hosts/nixdesk/home.nix index 101795b..1e0737a 100644 --- a/hosts/nixdesk/home.nix +++ b/hosts/nixdesk/home.nix @@ -121,11 +121,7 @@ vscodium-fhs android-studio jetbrains.rider - (pkgs.buildFHSEnv { - name = "silk-fhs"; - runScript = "bash"; - targetPkgs = pkgs: with pkgs; [glfw assimp]; - }) + jetbrains.clion # jetbrains.idea-ultimate # communication diff --git a/hosts/nixdesk/profiles/devshells.nix b/hosts/nixdesk/profiles/devshells.nix new file mode 100644 index 0000000..d174caf --- /dev/null +++ b/hosts/nixdesk/profiles/devshells.nix @@ -0,0 +1,44 @@ +{ + pkgs, + lib, + ... +}: let + shells = { + silk-fhs = "with pkgs; [glfw libGL assimp wgpu-native]"; + }; +in { + environment.systemPackages = [ + (pkgs.writeShellApplication { + name = "runsh"; + + runtimeInputs = [pkgs.nix]; + + text = '' + ${lib.concatMapAttrsStringSep "\n" (name: value: '' + runshell-${name}() { + # shellcheck disable=SC2016 + nix shell --impure --expr '(import {}).buildFHSEnv { + name = "devshell"; + runScript = "$SHELL"; + targetPkgs = pkgs: ${value}; + }' --command devshell + } + '') + shells} + if [ -z "''${1:-}" ]; then + echo "available shells:" + ${lib.concatMapAttrsStringSep "\n" (name: _: "echo ${name}") shells} + exit + fi + + case $1 in + ${lib.concatMapAttrsStringSep "\n" (name: _: '' + "${name}") runshell-${name} ;; + '') + shells} + *) echo no such shell ;; + esac + ''; + }) + ]; +} diff --git a/sys/profiles/programs/tools.nix b/sys/profiles/programs/tools.nix index 127fc34..22b32b3 100644 --- a/sys/profiles/programs/tools.nix +++ b/sys/profiles/programs/tools.nix @@ -14,6 +14,7 @@ fd # find replacement graphviz-nox p7zip + zip unar jq openssl # for generating passwords