crea shenvs, añade infrastructura para paquetes
This commit is contained in:
parent
5016c4f3d9
commit
a2209c4f8e
|
@ -23,5 +23,7 @@
|
|||
homeDirectory = "/home/fabian";
|
||||
stateVersion = "21.11";
|
||||
};
|
||||
|
||||
packages.x86_64-linux = import ./pkgs nixpkgs.legacyPackages.x86_64-linux;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -76,7 +76,6 @@
|
|||
alias x='killall --ignore-case --user=$(whoami) --interactive'
|
||||
alias sc='${maim}/bin/maim -s -u | xclip -selection clipboard -t image/png -i'
|
||||
alias tree='tree -CF'
|
||||
alias spawn="xdg-open"
|
||||
alias lock="betterlockscreen -l"
|
||||
alias nightmode="${redshift}/bin/redshift -P -O 1000"
|
||||
alias lightmode="${redshift}/bin/redshift -P -O 6500"
|
||||
|
@ -86,6 +85,21 @@
|
|||
bindkey ";5C" forward-word
|
||||
bindkey "\e[3~" delete-char
|
||||
|
||||
|
||||
function shenv() {
|
||||
nix shell 'system#shenvs.'"$1"
|
||||
}
|
||||
|
||||
function spawn () {
|
||||
if [ ! -x "$(command -v $1)" ]
|
||||
then
|
||||
echo "spawn: no such program: $1" >&2
|
||||
return 1
|
||||
fi
|
||||
$@ > /dev/null 0>&1 2>&1 &
|
||||
disown
|
||||
}
|
||||
|
||||
autoload -Uz up-line-or-beginning-search
|
||||
zle -N up-line-or-beginning-search
|
||||
autoload -Uz down-line-or-beginning-search
|
||||
|
|
32
pkgs/default.nix
Normal file
32
pkgs/default.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
pkgs:
|
||||
with pkgs.lib; let
|
||||
inherit (pkgs) buildEnv callPackage writeTextDir;
|
||||
|
||||
importAll = { root, exclude ? [] }:
|
||||
|
||||
# adapted from http://chriswarbo.net/projects/nixos/useful_hacks.html
|
||||
let
|
||||
basename = removeSuffix ".nix";
|
||||
|
||||
isMatch = name: type: (hasSuffix ".nix" name || type == "directory")
|
||||
&& ! elem name (map basename exclude);
|
||||
|
||||
entry = name: _: {
|
||||
name = basename name;
|
||||
value = import (root + "/${name}");
|
||||
};
|
||||
in
|
||||
mapAttrs' entry (filterAttrs isMatch (readDir root))
|
||||
|
||||
in {
|
||||
shenvs = let
|
||||
build = name: { paths, enter ? null }: buildEnv {
|
||||
name = "shenv-${name}";
|
||||
paths = (optional (enter != null) (writeTextDir "lib/shenv/enter" enter))
|
||||
++ paths;
|
||||
};
|
||||
in mapAttrs (name: shenv: build name (shenv pkgs)) (importAll {
|
||||
root = ../shenvs;
|
||||
exclude = [ "config" ];
|
||||
});
|
||||
}
|
5
shenvs/armasm.nix
Normal file
5
shenvs/armasm.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
pkgs: {
|
||||
paths = with pkgs; [
|
||||
gcc-arm-embedded
|
||||
];
|
||||
}
|
Loading…
Reference in a new issue