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 ];
|
||||
|
||||
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";
|
||||
};
|
||||
}
|
||||
|
@ -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 = {
|
||||
enable = true;
|
||||
|
||||
@ -9,14 +46,12 @@
|
||||
};
|
||||
};
|
||||
|
||||
home.file.".bash_profile".text =
|
||||
# not having the attribute users means
|
||||
# we cannot change the default shell (e.g. this is not a NixOS host)
|
||||
if ! builtins.hasAttr "users" config then ''
|
||||
if [ -f "$HOME/.bashrc" ]; then
|
||||
. "$HOME/.bashrc"
|
||||
fi
|
||||
home.file.".bashrc".text = ''
|
||||
${nix_run_fn}
|
||||
|
||||
${optionalString (!builtins.hasAttr "users" config) "${exec_zsh}"}
|
||||
'';
|
||||
|
||||
exec ${pkgs.zsh}/bin/zsh
|
||||
'' else null;
|
||||
home.file.".zshrc".text = nix_run_fn;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user