Let's try xonsh

This commit is contained in:
Artemis Tosini 2024-05-14 19:46:39 +00:00
parent 8ba428b047
commit 7d7db5df0d
Signed by: artemist
SSH key fingerprint: SHA256:EsuWCwx6fjxxExxf65rX+ocQJJAdw4R1KarpFue6Uwc
5 changed files with 46 additions and 21 deletions

View file

@ -8,7 +8,6 @@
home-manager.users.artemis = {
imports = [
./dirs.nix
./fish.nix
./git.nix
./gpg.nix
./gtk.nix

View file

@ -1,16 +0,0 @@
{ pkgs, ... }:
{
programs.fish = {
enable = true;
interactiveShellInit = "set -g -x GPG_TTY (tty)";
shellAliases = {
cat = "bat";
ls = "eza";
nix-fish = "nix-shell --command fish";
};
};
home.packages = with pkgs; [
bat
eza
];
}

View file

@ -1,6 +1,5 @@
{
config,
pkgs,
lib,
inputs,
...
@ -11,6 +10,7 @@
inputs.lix-module.nixosModules.default
inputs.private.nixosModules.base
inputs.private.nixosModules.substituter
./xonsh.nix
];
nix = {
@ -85,7 +85,6 @@
time.timeZone = "Etc/UTC";
environment.shellAliases.cp = "cp --reflink=auto --sparse=always";
networking.firewall.enable = false;
programs.fish.enable = true;
users = {
users.artemis = {
@ -96,7 +95,6 @@
"wheel"
"artemis"
];
shell = pkgs.fish;
# hashedPassword set in private
};
groups.artemis.gid = config.users.users.artemis.uid;

View file

@ -50,7 +50,6 @@ lib.setAttrByPath setPath (
};
extraPlugins = with pkgs.vimPlugins; [
vim-fetch
vim-fish
vim-flatbuffers
vim-nftables
vim-protobuf

45
sets/xonsh.nix Normal file
View file

@ -0,0 +1,45 @@
{ pkgs, ... }:
let
xonsh-direnv =
ps:
ps.buildPythonPackage rec {
pname = "xonsh-direnv";
version = "1.6.1";
src = pkgs.fetchPypi {
inherit pname version;
hash = "sha256-Nt8Da1EtMVWZ9mbBDjys7HDutLYifwoQ1HVmI5CN2Ww=";
};
};
xontrib-fish-completer =
ps:
ps.buildPythonPackage rec {
pname = "xontrib-fish-completer";
version = "0.0.1";
src = pkgs.fetchPypi {
inherit pname version;
hash = "sha256-Kr1iolx6DxqgxVNtXwwfggkLrbH9BlilGAYZahvR+3Y=";
};
patchPhase = "sed -i -e 's/^dependencies.*$/dependencies = []/' pyproject.toml";
};
in
{
# We need fish for fish completions
programs.fish.enable = true;
users.users.artemis.shell = "/run/current-system/sw/bin/xonsh";
programs.xonsh = {
enable = true;
config = ''
$UPDATE_OS_ENVIRON = True
xontrib load direnv fish_completer
'';
package = pkgs.xonsh.override {
extraPackages = ps: [
(xonsh-direnv ps)
(xontrib-fish-completer ps)
];
};
};
}