From e99fd13de5c7e7cd286d53b4a8ae0acc143aa9c6 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Wed, 10 Mar 2021 18:38:59 +0800 Subject: [PATCH] fish-nix-shell -> any-nix-shell --- nixops/any-nix-shell.nix | 27 ++++++++++ nixops/desktop.nix | 4 +- nixops/fish-nix-shell/LICENSE | 21 -------- nixops/fish-nix-shell/README.md | 50 ------------------- nixops/fish-nix-shell/bin/fish-nix-shell | 34 ------------- .../fish-nix-shell/bin/fish-nix-shell-wrapper | 22 -------- nixops/fish-nix-shell/bin/nix-shell-info | 21 -------- nixops/fish-nix-shell/default.nix | 16 ------ nixops/light.nix | 4 +- 9 files changed, 31 insertions(+), 168 deletions(-) create mode 100644 nixops/any-nix-shell.nix delete mode 100644 nixops/fish-nix-shell/LICENSE delete mode 100644 nixops/fish-nix-shell/README.md delete mode 100755 nixops/fish-nix-shell/bin/fish-nix-shell delete mode 100755 nixops/fish-nix-shell/bin/fish-nix-shell-wrapper delete mode 100755 nixops/fish-nix-shell/bin/nix-shell-info delete mode 100644 nixops/fish-nix-shell/default.nix diff --git a/nixops/any-nix-shell.nix b/nixops/any-nix-shell.nix new file mode 100644 index 00000000..3bd41a53 --- /dev/null +++ b/nixops/any-nix-shell.nix @@ -0,0 +1,27 @@ +{ lib, stdenv, fetchFromGitHub, makeWrapper }: + +stdenv.mkDerivation rec { + pname = "any-nix-shell"; + version = "1.2.1"; + + src = fetchFromGitHub { + owner = "haslersn"; + repo = "any-nix-shell"; + rev = "v${version}"; + sha256 = "0q27rhjhh7k0qgcdcfm8ly5za6wm4rckh633d0sjz87faffkp90k"; + }; + + nativeBuildInputs = [ makeWrapper ]; + installPhase = '' + mkdir -p $out/bin + cp -r bin $out + wrapProgram $out/bin/any-nix-shell --prefix PATH ":" $out/bin + ''; + + meta = with lib; { + description = "fish and zsh support for nix-shell"; + license = licenses.mit; + homepage = "https://github.com/haslersn/any-nix-shell"; + maintainers = with maintainers; [ haslersn ]; + }; +} diff --git a/nixops/desktop.nix b/nixops/desktop.nix index 80b437d0..1a45f999 100644 --- a/nixops/desktop.nix +++ b/nixops/desktop.nix @@ -50,7 +50,7 @@ in ]; }) virt-manager spice-gtk - (import ./fish-nix-shell) + (callPackage ./any-nix-shell.nix {}) ]; programs.wireshark.enable = true; programs.wireshark.package = pkgs.wireshark; @@ -128,7 +128,7 @@ in programs.fish.enable = true; programs.fish.promptInit = '' - fish-nix-shell --info-right | source + any-nix-shell fish --info-right | source ''; users.mutableUsers = false; users.defaultUserShell = pkgs.fish; diff --git a/nixops/fish-nix-shell/LICENSE b/nixops/fish-nix-shell/LICENSE deleted file mode 100644 index d8940bea..00000000 --- a/nixops/fish-nix-shell/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 haslersn - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/nixops/fish-nix-shell/README.md b/nixops/fish-nix-shell/README.md deleted file mode 100644 index 5db8dfd1..00000000 --- a/nixops/fish-nix-shell/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# fish-nix-shell -fish support for the *nix-shell* environment of the Nix package manager. - -## Installation - -### Installation in the user environment - -Execute - -``` -nix-env -if https://github.com/haslersn/fish-nix-shell/archive/master.tar.gz -``` - -and add the following to your *~/.config/fish/config.fish*. Create it if it doesn't exist. - -``` -fish-nix-shell --info-right | source -``` - -### System-wide installation - -Add the package to your */etc/nixos/configuration.nix*: - -``` - environment.systemPackages = with pkgs; [ - # - # Other packages here ... - # - (import (fetchGit "https://github.com/haslersn/fish-nix-shell")) - ]; -``` - -and then execute: `sudo nixos-rebuild switch` - -If you want to configure it system-wide, also add: - -``` - programs.fish.enable = true; - programs.fish.promptInit = '' - fish-nix-shell --info-right | source - ''; -``` - -## Flags - -The `fish-nix-shell` command **optionally** takes the following flags: - -| Flag | Meaning | -| - | - | -| `--info-right` | While in a *fish-nix-shell*, display information about the loaded packages at the right. diff --git a/nixops/fish-nix-shell/bin/fish-nix-shell b/nixops/fish-nix-shell/bin/fish-nix-shell deleted file mode 100755 index efe72a1f..00000000 --- a/nixops/fish-nix-shell/bin/fish-nix-shell +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -function init_fish () { - cat < {}; stdenv.mkDerivation rec { - name = "fish-nix-shell"; - src = fetchGit "https://github.com/haslersn/fish-nix-shell"; - nativeBuildInputs = [ makeWrapper ]; - installPhase = '' - mkdir -p $out - cp LICENSE $out - cp -r bin $out - wrapProgram $out/bin/fish-nix-shell - wrapProgram $out/bin/fish-nix-shell-wrapper --prefix PATH ":" ${fish}/bin - wrapProgram $out/bin/nix-shell-info - ''; - meta.description = "fish support for the nix-shell environment of the Nix package manager."; - meta.license = "MIT"; - meta.homepage = https://github.com/haslersn/fish-nix-shell; -} \ No newline at end of file diff --git a/nixops/light.nix b/nixops/light.nix index 7eae12eb..55a9f540 100644 --- a/nixops/light.nix +++ b/nixops/light.nix @@ -36,7 +36,7 @@ telnet unzip zip gnupg sublime3 rink tmux screen tigervnc - (import ./fish-nix-shell) + (callPackage ./any-nix-shell.nix {}) ]; programs.wireshark.enable = true; @@ -104,7 +104,7 @@ programs.fish.enable = true; programs.fish.promptInit = '' - fish-nix-shell --info-right | source + any-nix-shell fish --info-right | source ''; users.mutableUsers = false; users.defaultUserShell = pkgs.fish;