switch to xonsh
and add virtual machine configurations
This commit is contained in:
parent
29a30637ca
commit
3c0916835a
10 changed files with 238 additions and 44 deletions
|
@ -45,11 +45,12 @@ let
|
|||
fontforge
|
||||
packwiz
|
||||
xclip
|
||||
starship
|
||||
|
||||
# for scripts
|
||||
python312
|
||||
python312Packages.requests
|
||||
python312Packages.pyperclip
|
||||
# for xonsh
|
||||
python311
|
||||
python311Packages.pip
|
||||
python311Packages.python-lsp-server
|
||||
];
|
||||
flakePackages = with inputs; [ compose2nix.packages.${system}.default ];
|
||||
in {
|
||||
|
|
112
nixos/shell.nix
Executable file → Normal file
112
nixos/shell.nix
Executable file → Normal file
|
@ -1,4 +1,9 @@
|
|||
{ pkgs, ... }: {
|
||||
{ config, pkgs, ... }: {
|
||||
#TODO: Submit a PR to nixpkgs to add xonsh support to the Starship module
|
||||
# After that, we can remove this import and the disabledModules line
|
||||
disabledModules = [ "programs/starship.nix" ];
|
||||
imports = [ /bulk/home/cswimr/Projects/nixpkgs/nixos/modules/programs/starship.nix ];
|
||||
|
||||
# starship - a customizable prompt for any shell
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
|
@ -57,52 +62,81 @@
|
|||
add_newline = false;
|
||||
};
|
||||
};
|
||||
users.defaultUserShell = pkgs.fish;
|
||||
programs.fish = {
|
||||
|
||||
# enable bash completions
|
||||
# even though we don't use bash as our shell, xonsh uses bash completion scripts
|
||||
programs.bash.completion.enable = true;
|
||||
|
||||
users.defaultUserShell = pkgs.xonsh;
|
||||
programs.xonsh = let bashcfg = config.programs.bash;
|
||||
in {
|
||||
enable = true;
|
||||
shellInit = ''
|
||||
export PATH="$PATH:$HOME/bin:$HOME/.local/bin:$HOME/go/bin"
|
||||
config = ''
|
||||
$BASH_COMPLETIONS = ('${bashcfg.completion.package}/etc/profile.d/bash_completion.sh')
|
||||
#execx($(starship init xonsh))
|
||||
#xontrib load cd
|
||||
xontrib load direnv
|
||||
xontrib load sh
|
||||
'';
|
||||
package = pkgs.xonsh.override {
|
||||
extraPackages = ps: [
|
||||
# (ps.buildPythonPackage rec {
|
||||
# name = "xontrib-cd";
|
||||
# version = "0.3.1";
|
||||
|
||||
shellAliases = let ezaArgs = "--time-style='+%Y-%m-%d %H:%M' --icons=auto";
|
||||
in {
|
||||
ff = "fastfetch";
|
||||
neofetch = "fastfetch";
|
||||
nf = "fastfetch";
|
||||
# src = pkgs.fetchFromGitHub {
|
||||
# owner = "eugenesvk";
|
||||
# repo = name;
|
||||
# rev = version;
|
||||
# sha256 = "XxSxjyCg7PeX1v3e2KKicvAPmNeq+qVqbW4fXTwAiic=";
|
||||
# };
|
||||
|
||||
lg = "lazygit";
|
||||
lad = "lazydocker";
|
||||
# meta = {
|
||||
# homepage = "https://github.com/eugenesvk/xontrib-cd";
|
||||
# description =
|
||||
# "`cd` to any path without escaping in xonsh shell: `cd ~/[te] st`";
|
||||
# license = pkgs.lib.licenses.mit;
|
||||
# maintainers = [ "cswimr" ];
|
||||
# };
|
||||
# })
|
||||
(ps.buildPythonPackage rec {
|
||||
name = "xonsh-direnv";
|
||||
version = "1.6.5";
|
||||
|
||||
clip = "wl-copy";
|
||||
paste = "wl-paste";
|
||||
cat = "bat";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "74th";
|
||||
repo = name;
|
||||
rev = version;
|
||||
sha256 = "huBJ7WknVCk+WgZaXHlL+Y1sqsn6TYqMP29/fsUPSyU=";
|
||||
};
|
||||
|
||||
l = "eza -lhg ${ezaArgs}";
|
||||
la = "eza -lAh ${ezaArgs}";
|
||||
ll = "eza -lhg ${ezaArgs}";
|
||||
ls = "eza ${ezaArgs}";
|
||||
lsa = "eza -lah ${ezaArgs}";
|
||||
tree = "eza --tree --git-ignore ${ezaArgs}";
|
||||
git = "hub";
|
||||
meta = {
|
||||
homepage = "https://github.com/74th/xonsh-direnv";
|
||||
description = "xonsh extension for using direnv";
|
||||
license = pkgs.lib.licenses.mit;
|
||||
maintainers = [ "cswimr" ];
|
||||
};
|
||||
})
|
||||
(ps.buildPythonPackage rec {
|
||||
name = "xontrib-sh";
|
||||
version = "0.3.1";
|
||||
|
||||
create-devenv = "nix flake init --template github:cachix/devenv && direnv allow";
|
||||
develop = "nix develop --no-pure-eval";
|
||||
nixpkgs-update = "nix run --option extra-substituters 'https://nix-community.cachix.org/' --option extra-trusted-public-keys 'nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=' github:ryantm/nixpkgs-update --";
|
||||
nixrc = "$EDITOR /etc/nixos";
|
||||
delete-vscode-settings-backup = "rm -rf ~/.config/Code/User/settings.json.bak";
|
||||
upd =
|
||||
"sudo nixos-generate-config --dir /etc/nixos/hosts && sudo rm /etc/nixos/hosts/configuration.nix && sudo mv /etc/nixos/hosts/hardware-configuration.nix /etc/nixos/hosts/$(hostname).nix && git -C /etc/nixos --git-dir=/etc/nixos/.git add /etc/nixos/hosts/$(hostname).nix && delete-vscode-settings-backup && sudo nixos-rebuild switch --flake /etc/nixos";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "anki-code";
|
||||
repo = name;
|
||||
rev = version;
|
||||
sha256 = "KL/AxcsvjxqxvjDlf1axitgME3T+iyuW6OFb1foRzN8=";
|
||||
};
|
||||
|
||||
taildrop = "tailscale file";
|
||||
|
||||
forgejo-runner = "act_runner";
|
||||
runactions =
|
||||
"act_runner exec --default-actions-url=https://www.coastalcommits.com --gitea-instance=https://www.coastalcommits.com";
|
||||
|
||||
c = "clear";
|
||||
# alias sudo to itself so user aliases can be sudoed
|
||||
sudo = "sudo ";
|
||||
s = "sudo ";
|
||||
meta = {
|
||||
homepage = "https://github.com/anki-code/xontrib-sh";
|
||||
description =
|
||||
"Paste and run commands from bash, zsh, fish, tcsh in xonsh shell.";
|
||||
license = pkgs.lib.licenses.mit;
|
||||
maintainers = [ "cswimr" ];
|
||||
};
|
||||
})
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
5
nixos/symlinks.nix
Normal file
5
nixos/symlinks.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
environment.etc = {
|
||||
"xonsh/rc.d".source = ../config/xonsh;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue