Merge branch 'master' of ssh://git.giugl.io/peperunas/nixos
This commit is contained in:
commit
85f4ea2314
@ -4,7 +4,15 @@
|
|||||||
imports = [ ./zsh.nix ./git.nix ./helix.nix ];
|
imports = [ ./zsh.nix ./git.nix ./helix.nix ];
|
||||||
|
|
||||||
home = {
|
home = {
|
||||||
packages = with pkgs; [ rizin sshfs victor-mono home-manager ];
|
packages = with pkgs; [
|
||||||
|
rizin
|
||||||
|
sshfs
|
||||||
|
victor-mono
|
||||||
|
home-manager
|
||||||
|
ripgrep
|
||||||
|
]
|
||||||
|
++ lib.optional (!stdenv.isDarwin) [ pastebinit ];
|
||||||
|
|
||||||
stateVersion = "22.11";
|
stateVersion = "22.11";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,41 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, optionalString, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (pkgs.lib) optionalString;
|
||||||
|
|
||||||
|
# not having the attribute users means
|
||||||
|
# we cannot change the default shell (e.g. this is not a NixOS host)
|
||||||
|
exec_zsh = ''
|
||||||
|
if [ -f "$HOME/.bashrc" ]; then
|
||||||
|
. "$HOME/.bashrc"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec ${pkgs.zsh}/bin/zsh
|
||||||
|
'';
|
||||||
|
|
||||||
|
nix_run_fn = ''
|
||||||
|
function _nr {
|
||||||
|
if [ "$#" -lt 1 ]; then
|
||||||
|
echo "Usage: _nr <pkg>"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
quoted_args=()
|
||||||
|
local pkg=$1
|
||||||
|
shift 1
|
||||||
|
|
||||||
|
for a in "$@"; do
|
||||||
|
quoted_args+=("\"$a\"")
|
||||||
|
done
|
||||||
|
|
||||||
|
echo ''${quoted_args[@]}
|
||||||
|
|
||||||
|
# `nix run nixpkgs#$pkg -- ''${quoted_args[@]}`
|
||||||
|
exec nix run nixpkgs#$pkg "$@"
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
{
|
||||||
programs.zsh = {
|
programs.zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
@ -9,14 +46,12 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
home.file.".bash_profile".text =
|
home.file.".bashrc".text = ''
|
||||||
# not having the attribute users means
|
${nix_run_fn}
|
||||||
# we cannot change the default shell (e.g. this is not a NixOS host)
|
|
||||||
if ! builtins.hasAttr "users" config then ''
|
${optionalString (!builtins.hasAttr "users" config) "${exec_zsh}"}
|
||||||
if [ -f "$HOME/.bashrc" ]; then
|
'';
|
||||||
. "$HOME/.bashrc"
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec ${pkgs.zsh}/bin/zsh
|
home.file.".zshrc".text = nix_run_fn;
|
||||||
'' else null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user