mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-11 23:09:22 +08:00
Compare commits
5 Commits
ac362289de
...
misskey
| Author | SHA1 | Date | |
|---|---|---|---|
| 4941582aec | |||
| 29fef229d8 | |||
| 303d67ca06 | |||
| 3732d19de0 | |||
| 26eec4d375 |
@@ -4,7 +4,7 @@
|
||||
vesta = callPackage ./vesta {};
|
||||
oneapi = callPackage ./oneapi {};
|
||||
rsshub = callPackage ./rsshub {};
|
||||
misskey = callPackage ./misskey {};
|
||||
misskey = callPackage ./misskey { nodejs = nodejs_21; };
|
||||
mk-meili-mgn = callPackage ./mk-meili-mgn {};
|
||||
# vasp = callPackage ./vasp
|
||||
# {
|
||||
|
||||
@@ -1,27 +1,26 @@
|
||||
{
|
||||
lib, stdenv, mkPnpmPackage, fetchFromGitHub, fetchurl, nodejs_20, writeShellScript, buildFHSEnv,
|
||||
lib, stdenv, mkPnpmPackage, fetchFromGitHub, fetchurl, nodejs, writeShellScript, buildFHSEnv,
|
||||
bash, cypress, vips, pkg-config
|
||||
}:
|
||||
let
|
||||
pname = "misskey";
|
||||
version = "2023.11.1";
|
||||
version = "2023.12.0";
|
||||
src = fetchFromGitHub
|
||||
{
|
||||
owner = "CHN-beta";
|
||||
repo = "misskey";
|
||||
rev = "1e5134816cc23600a0448a62b34aadfe573c3bbc";
|
||||
sha256 = "ihkFVTpwEELmxAw4Lw01pWr8j6u2oLpfcw3laVUFCO4=";
|
||||
rev = "bec1dc37598b71c377643ee77330d4d6f7eb31f2";
|
||||
sha256 = "sha256-svLpG4xQ2mtsJ6gm+Ap8fZKTOl5V68XybGDvymsV4F4=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
originalPnpmPackage = mkPnpmPackage
|
||||
{
|
||||
inherit pname version src;
|
||||
nodejs = nodejs_20;
|
||||
inherit pname version src nodejs;
|
||||
copyPnpmStore = true;
|
||||
};
|
||||
startScript = writeShellScript "misskey"
|
||||
''
|
||||
export PATH=${lib.makeBinPath [ bash nodejs_20 nodejs_20.pkgs.pnpm nodejs_20.pkgs.gulp cypress ]}:$PATH
|
||||
export PATH=${lib.makeBinPath [ bash nodejs nodejs.pkgs.pnpm nodejs.pkgs.gulp cypress ]}:$PATH
|
||||
export CYPRESS_RUN_BINARY="${cypress}/bin/Cypress"
|
||||
export NODE_ENV=production
|
||||
pnpm run migrateandstart
|
||||
@@ -79,7 +78,7 @@ in
|
||||
inherit version src pname;
|
||||
buildInputs =
|
||||
[
|
||||
bash nodejs_20 nodejs_20.pkgs.typescript nodejs_20.pkgs.pnpm nodejs_20.pkgs.gulp cypress vips pkg-config
|
||||
bash nodejs nodejs.pkgs.typescript nodejs.pkgs.pnpm nodejs.pkgs.gulp cypress vips pkg-config
|
||||
];
|
||||
nativeBuildInputs = buildInputs;
|
||||
CYPRESS_RUN_BINARY = "${cypress}/bin/Cypress";
|
||||
@@ -89,7 +88,7 @@ in
|
||||
configurePhase =
|
||||
''
|
||||
export HOME=$NIX_BUILD_TOP # Some packages need a writable HOME
|
||||
export npm_config_nodedir=${nodejs_20}
|
||||
export npm_config_nodedir=${nodejs}
|
||||
|
||||
runHook preConfigure
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ inputs:
|
||||
imports = inputs.localLib.mkModules
|
||||
[
|
||||
./ssh
|
||||
./zsh
|
||||
];
|
||||
config =
|
||||
let
|
||||
@@ -54,63 +55,6 @@ inputs:
|
||||
{
|
||||
config.programs =
|
||||
{
|
||||
zsh =
|
||||
{
|
||||
enable = true;
|
||||
initExtraBeforeCompInit =
|
||||
''
|
||||
# p10k instant prompt
|
||||
P10K_INSTANT_PROMPT="$XDG_CACHE_HOME/p10k-instant-prompt-''${(%):-%n}.zsh"
|
||||
[[ ! -r "$P10K_INSTANT_PROMPT" ]] || source "$P10K_INSTANT_PROMPT"
|
||||
HYPHEN_INSENSITIVE="true"
|
||||
export PATH=~/bin:$PATH
|
||||
function br
|
||||
{
|
||||
local cmd cmd_file code
|
||||
cmd_file=$(mktemp)
|
||||
if broot --outcmd "$cmd_file" "$@"; then
|
||||
cmd=$(<"$cmd_file")
|
||||
command rm -f "$cmd_file"
|
||||
eval "$cmd"
|
||||
else
|
||||
code=$?
|
||||
command rm -f "$cmd_file"
|
||||
return "$code"
|
||||
fi
|
||||
}
|
||||
alias todo="todo.sh"
|
||||
'';
|
||||
plugins =
|
||||
[
|
||||
{
|
||||
file = "powerlevel10k.zsh-theme";
|
||||
name = "powerlevel10k";
|
||||
src = "${inputs.pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k";
|
||||
}
|
||||
{
|
||||
file = "p10k.zsh";
|
||||
name = "powerlevel10k-config";
|
||||
src = ./p10k-config;
|
||||
}
|
||||
{
|
||||
name = "zsh-lsd";
|
||||
src = inputs.pkgs.fetchFromGitHub
|
||||
{
|
||||
owner = "z-shell";
|
||||
repo = "zsh-lsd";
|
||||
rev = "029a9cb0a9b39c9eb6c5b5100dd9182813332250";
|
||||
sha256 = "sha256-oWjWnhiimlGBMaZlZB+OM47jd9hporKlPNwCx6524Rk=";
|
||||
};
|
||||
}
|
||||
];
|
||||
history =
|
||||
{
|
||||
path = "${home-inputs.config.xdg.dataHome}/zsh/zsh_history";
|
||||
extended = true;
|
||||
save = 100000000;
|
||||
size = 100000000;
|
||||
};
|
||||
};
|
||||
direnv = { enable = true; nix-direnv.enable = true; };
|
||||
git =
|
||||
{
|
||||
@@ -163,19 +107,6 @@ inputs:
|
||||
{
|
||||
nix-index-database.comma.enable = true;
|
||||
nix-index.enable = true;
|
||||
zsh =
|
||||
{
|
||||
enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
autosuggestions.enable = true;
|
||||
enableCompletion = true;
|
||||
ohMyZsh =
|
||||
{
|
||||
enable = true;
|
||||
plugins = [ "git" "colored-man-pages" "extract" "history-substring-search" "autojump" ];
|
||||
customPkgs = with inputs.pkgs; [ zsh-nix-shell ];
|
||||
};
|
||||
};
|
||||
command-not-found.enable = false;
|
||||
gnupg.agent = { enable = true; enableSSHSupport = true; };
|
||||
autojump.enable = true;
|
||||
|
||||
@@ -97,7 +97,7 @@ inputs:
|
||||
))
|
||||
(attrsToList servers)));
|
||||
nixos.users.sharedModules =
|
||||
[{
|
||||
[(hmInputs: {
|
||||
config.programs.ssh =
|
||||
{
|
||||
enable = true;
|
||||
@@ -122,12 +122,27 @@ inputs:
|
||||
{
|
||||
PubkeyAcceptedAlgorithms = "+ssh-rsa";
|
||||
HostkeyAlgorithms = "+ssh-rsa";
|
||||
SetEnv = "TERM=chn_unset_ls_colors:xterm-256color";
|
||||
SetEnv =
|
||||
let
|
||||
usernameMap =
|
||||
{
|
||||
chn = "linwei/chn";
|
||||
};
|
||||
cdString =
|
||||
if host == "jykang" && (usernameMap ? ${hmInputs.config.home.username}) then
|
||||
":chn_cd:${usernameMap.${hmInputs.config.home.username}}"
|
||||
else "";
|
||||
in "TERM=chn_unset_ls_colors${cdString}:xterm-256color";
|
||||
# in .bash_profile:
|
||||
# if [[ $TERM == chn_unset_ls_colors* ]]; then
|
||||
# export TERM=${TERM#*:}
|
||||
# export CHN_LS_USE_COLOR=1
|
||||
# fi
|
||||
# if [[ $TERM == chn_cd* ]]; then
|
||||
# export TERM=${TERM#*:}
|
||||
# cd ~/${TERM%%:*}
|
||||
# export TERM=${TERM#*:}
|
||||
# fi
|
||||
# in .bashrc
|
||||
# [ -n "$CHN_LS_USE_COLOR" ] && alias ls="ls --color=auto"
|
||||
};
|
||||
@@ -141,6 +156,6 @@ inputs:
|
||||
gitea = { host = "gitea"; hostname = "ssh.git.chn.moe"; };
|
||||
};
|
||||
};
|
||||
}];
|
||||
})];
|
||||
};
|
||||
}
|
||||
|
||||
79
modules/packages/server/zsh/default.nix
Normal file
79
modules/packages/server/zsh/default.nix
Normal file
@@ -0,0 +1,79 @@
|
||||
inputs:
|
||||
{
|
||||
config =
|
||||
let
|
||||
inherit (inputs.lib) mkIf;
|
||||
in mkIf (builtins.elem "server" inputs.config.nixos.packages._packageSets)
|
||||
{
|
||||
nixos.users.sharedModules = [(home-inputs: { config.programs.zsh =
|
||||
{
|
||||
enable = true;
|
||||
initExtraBeforeCompInit =
|
||||
''
|
||||
# p10k instant prompt
|
||||
P10K_INSTANT_PROMPT="$XDG_CACHE_HOME/p10k-instant-prompt-''${(%):-%n}.zsh"
|
||||
[[ ! -r "$P10K_INSTANT_PROMPT" ]] || source "$P10K_INSTANT_PROMPT"
|
||||
HYPHEN_INSENSITIVE="true"
|
||||
export PATH=~/bin:$PATH
|
||||
function br
|
||||
{
|
||||
local cmd cmd_file code
|
||||
cmd_file=$(mktemp)
|
||||
if broot --outcmd "$cmd_file" "$@"; then
|
||||
cmd=$(<"$cmd_file")
|
||||
command rm -f "$cmd_file"
|
||||
eval "$cmd"
|
||||
else
|
||||
code=$?
|
||||
command rm -f "$cmd_file"
|
||||
return "$code"
|
||||
fi
|
||||
}
|
||||
alias todo="todo.sh"
|
||||
'';
|
||||
plugins =
|
||||
[
|
||||
{
|
||||
file = "powerlevel10k.zsh-theme";
|
||||
name = "powerlevel10k";
|
||||
src = "${inputs.pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k";
|
||||
}
|
||||
{
|
||||
file = "p10k.zsh";
|
||||
name = "powerlevel10k-config";
|
||||
src = ./p10k-config;
|
||||
}
|
||||
{
|
||||
name = "zsh-lsd";
|
||||
src = inputs.pkgs.fetchFromGitHub
|
||||
{
|
||||
owner = "z-shell";
|
||||
repo = "zsh-lsd";
|
||||
rev = "029a9cb0a9b39c9eb6c5b5100dd9182813332250";
|
||||
sha256 = "sha256-oWjWnhiimlGBMaZlZB+OM47jd9hporKlPNwCx6524Rk=";
|
||||
};
|
||||
}
|
||||
];
|
||||
history =
|
||||
{
|
||||
path = "${home-inputs.config.xdg.dataHome}/zsh/zsh_history";
|
||||
extended = true;
|
||||
save = 100000000;
|
||||
size = 100000000;
|
||||
};
|
||||
};})];
|
||||
programs.zsh =
|
||||
{
|
||||
enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
autosuggestions.enable = true;
|
||||
enableCompletion = true;
|
||||
ohMyZsh =
|
||||
{
|
||||
enable = true;
|
||||
plugins = [ "git" "colored-man-pages" "extract" "history-substring-search" "autojump" ];
|
||||
customPkgs = with inputs.pkgs; [ zsh-nix-shell ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user