concat: RIP

This commit is contained in:
tv 2017-06-20 19:30:14 +02:00
parent 57c6b890f9
commit a9f4ad7586
10 changed files with 164 additions and 159 deletions

View File

@ -1,32 +1,6 @@
pkgs: oldpkgs:
with import <stockholm/lib>;
{
# Combine a list of derivations using symlinks. Paths in later derivations
# take precedence over earlier ones.
#
# Example: create wrapper but retain all other files (man pages etc.)
#
# {
# nixpkgs.config.packageOverrides = super: {
# hello = pkgs.concat "hello" [
# super.hello
# (pkgs.writeDashBin "hello" ''
# echo OMG
# echo exec ${super.hello}/bin/hello "$@"
# '')
# ];
# };
# }
#
concat = name: xs: pkgs.runCommand name {} ''
mkdir $out
${flip concatMapStrings xs (x: ''
cp --remove-destination -vrs ${x}/* $out
find $out -type d -exec chmod -v u+rwx {} +
'')}
'';
execve = name: { filename, argv ? null, envp ? {}, destination ? "" }: let
in pkgs.writeC name { inherit destination; } /* c */ ''
#include <unistd.h>

View File

@ -17,7 +17,10 @@ with import <stockholm/lib>;
# my life sucks
nixpkgs.config.packageOverrides = super: {
irc-announce = super.callPackage <stockholm/krebs/5pkgs/simple/irc-announce> {
pkgs = pkgs // { coreutils = pkgs.concat "coreutils-hack" [
pkgs = pkgs // {
coreutils = pkgs.symlinkJoin {
name = "coreutils-hack";
paths = [
pkgs.coreutils
(pkgs.writeDashBin "tee" ''
if test "$1" = /dev/stderr; then
@ -29,7 +32,9 @@ with import <stockholm/lib>;
${super.coreutils}/bin/tee "$@"
fi
'')
];};
];
};
};
};
};
boot.kernelParams = [ "copytoram" ];

View File

@ -5,7 +5,9 @@ with import <stockholm/lib>;
{
security.hideProcessInformation = true;
nixpkgs.config.packageOverrides = super: {
htop = pkgs.concat "htop" [
htop = pkgs.symlinkJoin {
name = "htop";
paths = [
super.htop
(pkgs.writeDashBin "htop" ''
export HTOPRC=${pkgs.writeText "htoprc" ''
@ -38,4 +40,5 @@ with import <stockholm/lib>;
'')
];
};
};
}

View File

@ -113,12 +113,15 @@ let
macro index ~ ,@( 'Toggle sidebar' # toggle the sidebar
'';
mutt = pkgs.concat "mutt" [
mutt = pkgs.symlinkJoin {
name = "mutt";
paths = [
pkgs.neomutt
(pkgs.writeDashBin "mutt" ''
exec ${pkgs.neomutt}/bin/mutt -F ${muttrc} $@
'')
];
};
in {
environment.systemPackages = [

View File

@ -322,7 +322,9 @@ let
in {
environment.systemPackages = [
(pkgs.concat "mc" [
(pkgs.symlinkJoin {
name = "mc";
paths = [
pkgs.mc
(pkgs.writeDashBin "mc" ''
export MC_DATADIR=${pkgs.writeOut "mc-ext" {
@ -332,7 +334,8 @@ in {
export TERM=xterm-256color
exec ${pkgs.mc}/bin/mc -S xoria256 "$@"
'')
])
];
})
];
}

View File

@ -7,12 +7,15 @@ let
delete
];
mpv = pkgs.concat "mpv" [
mpv = pkgs.symlinkJoin {
name = "mpv";
paths = [
pkgs.mpv
(pkgs.writeDashBin "mpv" ''
exec ${pkgs.mpv}/bin/mpv --no-config --script=${scripts} "$@"
'')
];
};
moveToDir = key: dir: pkgs.writeText "move-with-${key}.lua" ''
tmp_dir = "${dir}"

View File

@ -207,7 +207,9 @@ let
alldirs = attrValues dirs ++ map dirOf (attrValues files);
in unique (sort lessThan alldirs);
vim = pkgs.concat "vim" [
vim = pkgs.symlinkJoin {
name = "vim";
paths = [
pkgs.vim
(pkgs.writeDashBin "vim" ''
set -efu
@ -215,6 +217,7 @@ let
exec ${pkgs.vim}/bin/vim "$@"
'')
];
};
hs.vim = pkgs.writeText "hs.vim" ''
syn region String start=+\[[[:alnum:]]*|+ end=+|]+

View File

@ -32,7 +32,10 @@ with import <stockholm/lib>;
# hack `tee` behavior
nixpkgs.config.packageOverrides = super: {
irc-announce = super.callPackage <stockholm/krebs/5pkgs/simple/irc-announce> {
pkgs = pkgs // { coreutils = pkgs.concat "coreutils-hack" [
pkgs = pkgs // {
coreutils = pkgs.symlinkJoin {
name = "coreutils-hack";
paths = [
pkgs.coreutils
(pkgs.writeDashBin "tee" ''
if test "$1" = /dev/stderr; then
@ -44,7 +47,9 @@ with import <stockholm/lib>;
${super.coreutils}/bin/tee "$@"
fi
'')
];};
];
};
};
};
};
}

View File

@ -4,7 +4,9 @@ with import <stockholm/lib>;
{
nixpkgs.config.packageOverrides = super: {
htop = pkgs.concat "htop" [
htop = pkgs.symlinkJoin {
name = "htop";
paths = [
super.htop
(pkgs.writeDashBin "htop" ''
export HTOPRC=${pkgs.writeText "htoprc" ''
@ -37,4 +39,5 @@ with import <stockholm/lib>;
'')
];
};
};
}

View File

@ -297,7 +297,9 @@ let {
alldirs = attrValues dirs ++ map dirOf (attrValues files);
in unique (sort lessThan alldirs);
vim-wrapper = pkgs.concat "vim" [
vim-wrapper = pkgs.symlinkJoin {
name = "vim";
paths = [
pkgs.vim_configurable
(pkgs.writeDashBin "vim" ''
set -efu
@ -309,6 +311,7 @@ let {
exec ${pkgs.vim_configurable}/bin/vim "$@"
'')
];
};
vimrc = pkgs.writeText "vimrc" ''
set nocompatible