Add support for non-nixos systems

I run Debian on my Thinkpad and wanted to take advantage of nix on there
without also installing NixOS there, so here is added support for it.
This commit is contained in:
caem 2024-06-06 12:41:31 +02:00
parent c2ba41fd36
commit 62a2c850ae
Signed by: caem
GPG key ID: 69A830D03203405F
11 changed files with 103 additions and 21 deletions

View file

@ -1,15 +1,36 @@
{ pkgs, ... }:
{ config, pkgs, ... }:
{
home.file."/home/hu/.config/zsh/conf.d" = {
home.packages = with pkgs; [
fzf
zsh-fzf-tab
zsh-completions
zsh-autosuggestions
zsh-syntax-highlighting
nix-zsh-completions
thefuck
];
home.file."${config.xdg.configHome}/zsh/conf.d" = {
source = ./config/conf.d;
recursive = true;
};
home.file."/home/hu/.config/zsh/.zshrc" = {
home.file."${config.xdg.configHome}/zsh/.zshrc" = {
text = ''
#!/usr/bin/env zsh
SYNTAX_FILE="${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
FZF_TAB_FILE="${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh"
# On systems that are not on glibc 2.38, loading fzf-tab will fail. This prevents that.
if [ -f "/lib/x86_64-linux-gnu/libc.so.6" ]; then
GLIBC_VERSION="$(/lib/x86_64-linux-gnu/libc.so.6 | head -n1 | sed -e 's/.* //g' | rev | cut -c2- | rev)"
if [ "$GLIBC_VERSION" = "2.38" ]; then
FZF_TAB_FILE="${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh"
fi
else
FZF_TAB_FILE="${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh"
fi
AUTOSUGGEST_FILE="${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
'' + (builtins.readFile config/.zshrc);
};