~kaction/config

b94256227f7b8fcab6710cf306c8a767b4f63858 — Dmitry Bogatov a month ago 15099e3
Move some environment variables from posixrc to uenv

This change is step to make it possible to try exotic, and even non-posix
shells.
M universe/posixrc/default.nix => universe/posixrc/default.nix +2 -17
@@ 1,20 1,5 @@
{ stdenv, runCommandLocal, fetchFromGitHub }:
let
  ls-colors = stdenv.mkDerivation {
    name = "ls-colors";
    src = fetchFromGitHub {
      owner = "trapd00r";
      repo = "LS_COLORS";
      rev = "e91cc9cc69f6c4780f03b121bc633569742de7cd";
      hash = "sha256-6DnZgWXlQ1+focJGvhlVvgo97owDCj5w2zydF2ZiV8Q";
    };
    installPhase = ''
      sed -i '/^LINK/ d' LS_COLORS
      dircolors LS_COLORS > $out
    '';
  };
in runCommandLocal "posixrc" { } ''
{ runCommandLocal }:
runCommandLocal "posixrc" { } ''
  mkdir -p $out
  cat ${ls-colors} >> $out/posixrc
  cat ${./init.sh} >> $out/posixrc
''

M universe/posixrc/init.sh => universe/posixrc/init.sh +0 -3
@@ 1,9 1,6 @@
alias ls='ls --color=auto'
alias cd-root='cd "$(git root)"'
alias gh='GITHUB_TOKEN=${GITHUB_TOKEN} command gh'
export VIDIR_EDITOR_ARGS='-c :set nolist | :set ft=vidir-ls'
export REALNAME='Dmitry Bogatov'
export EMAIL='pgp#v1@kaction.cc'

vidir() {
	if [ $# = 0 ] ; then

M universe/uenv/default.nix => universe/uenv/default.nix +18 -1
@@ 1,12 1,29 @@
{ substituteAll, glibcLocales, execline, busybox }:
{ substituteAll, glibcLocales, execline, busybox, stdenv, fetchFromGitHub }:
let
  home = "/proc/self/fd/42";
  shm = "/proc/self/fd/91";
  ls-colors = stdenv.mkDerivation {
    name = "ls-colors";
    src = fetchFromGitHub {
      owner = "trapd00r";
      repo = "LS_COLORS";
      rev = "e91cc9cc69f6c4780f03b121bc633569742de7cd";
      hash = "sha256-6DnZgWXlQ1+focJGvhlVvgo97owDCj5w2zydF2ZiV8Q";
    };
    installPhase = ''
      sed -i '/^LINK/ d' LS_COLORS
      eval "$(dircolors LS_COLORS)"
      echo "$LS_COLORS" > $out
    '';
  };

  envfile = substituteAll {
    src = ./env.conf;
    inputrc = ./inputrc;
    inherit home shm glibcLocales;
    lscolors = builtins.readFile ls-colors;
  };

  uenv = substituteAll {
    src = ./uenv.exec;
    name = "uenv";

M universe/uenv/env.conf => universe/uenv/env.conf +4 -0
@@ 10,3 10,7 @@ ABDUCO_SOCKET_DIR = @shm@
SURFRAW_browser = w3m
GITHUB_USER = kaction
GITHUB_PROTOCOL = https
VIDIR_EDITOR_ARGS = -c :set nolist | :set ft=vidir-ls
REALNAME = Dmitry Bogatov
EMAIL = pgp#v1@kaction.cc
LS_COLORS = @lscolors@