From 648803b90c4e4618828fdd15d1ba8d660ea0b335 Mon Sep 17 00:00:00 2001 From: alisceon Date: Thu, 4 Sep 2025 15:05:45 +0200 Subject: [PATCH] ey im xonshing here! --- flake.lock | 109 ++++++++++++++++++++--------------------- flake.nix | 16 ++++-- home/alisceon/base.nix | 3 -- home/conf/xonshrc | 16 ------ hosts/common/base.nix | 77 ++++++++++++++++++++++++----- 5 files changed, 129 insertions(+), 92 deletions(-) delete mode 100644 home/conf/xonshrc diff --git a/flake.lock b/flake.lock index b0c47c9..80d5d8b 100644 --- a/flake.lock +++ b/flake.lock @@ -21,6 +21,27 @@ "type": "github" } }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "nur-unstable", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733312601, + "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -92,54 +113,46 @@ "type": "github" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1756787288, - "narHash": "sha256-rw/PHa1cqiePdBxhF66V7R+WAP8WekQ0mCDG4CFqT8Y=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "d0fc30899600b9b3466ddb260fd83deb486c32f1", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { - "locked": { - "lastModified": 1712449641, - "narHash": "sha256-U9DDWMexN6o5Td2DznEgguh8TRIUnIl9levmit43GcI=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "600b15aea1b36eeb43833a50b0e96579147099ff", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nur": { "inputs": { "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs_2" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { - "lastModified": 1756935808, - "narHash": "sha256-Kozv7P1kPXC8M1k12Y3kmylLKptlk9G+GiJe5F1V4Xo=", + "lastModified": 1756986193, + "narHash": "sha256-YFCcCPTR6YajgpcoZSC0jtSPiG6qPukYpsdmQCEPIis=", "owner": "nix-community", "repo": "NUR", - "rev": "0951866da58eb749d4a25eb241ab4df65866db70", + "rev": "d7843c8e7bcd55ebc4ba26d4d618bafaa41268f6", "type": "github" }, "original": { - "id": "nur", - "type": "indirect" + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, + "nur-unstable": { + "inputs": { + "flake-parts": "flake-parts_2", + "nixpkgs": [ + "nixpkgs-unstable" + ] + }, + "locked": { + "lastModified": 1756986193, + "narHash": "sha256-YFCcCPTR6YajgpcoZSC0jtSPiG6qPukYpsdmQCEPIis=", + "owner": "nix-community", + "repo": "NUR", + "rev": "d7843c8e7bcd55ebc4ba26d4d618bafaa41268f6", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" } }, "root": { @@ -149,7 +162,7 @@ "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", "nur": "nur", - "xonsh-xontrib": "xonsh-xontrib" + "nur-unstable": "nur-unstable" } }, "systems": { @@ -166,24 +179,6 @@ "repo": "default", "type": "github" } - }, - "xonsh-xontrib": { - "inputs": { - "nixpkgs": "nixpkgs_3" - }, - "locked": { - "lastModified": 1752512286, - "narHash": "sha256-/G535cmjk8nyM/wuOGiqvZxyLet02atFC9QtLUR2HaE=", - "owner": "drmikecrowe", - "repo": "nur-packages", - "rev": "57096c1ad777d00c2bfbc5c2d77a8413bc9b41e2", - "type": "github" - }, - "original": { - "owner": "drmikecrowe", - "repo": "nur-packages", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 595fe4c..5df2328 100644 --- a/flake.nix +++ b/flake.nix @@ -4,7 +4,14 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; - xonsh-xontrib.url = "github:drmikecrowe/nur-packages"; + nur = { + url = "github:nix-community/NUR"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nur-unstable = { + url = "github:nix-community/NUR"; + inputs.nixpkgs.follows = "nixpkgs-unstable"; + }; flake-utils = { url = "github:numtide/flake-utils"; inputs.nixpkgs.follows = "nixpkgs"; @@ -15,21 +22,20 @@ }; }; - outputs = { self, nixpkgs, nixpkgs-unstable, nur, flake-utils, xonsh-xontrib, home-manager, ... }: + outputs = { self, nixpkgs, nixpkgs-unstable, nur, nur-unstable, flake-utils, home-manager, ... }: let system = "x86_64-linux"; pkgs = import nixpkgs { inherit system; config.allowUnfree = true; flake.setFlakeRegistry = true; + overlays = [ nur.overlays.default ]; }; pkgs-unstable = import nixpkgs-unstable { inherit system; config.allowUnfree = true; flake.setFlakeRegistry = true; - overlays = [ - xonsh-xontrib.overlays - ]; + overlays = [ nur-unstable.overlays.default ]; }; sharedSpecialArgs = { inherit pkgs-unstable; diff --git a/home/alisceon/base.nix b/home/alisceon/base.nix index 1911dcb..a50cf4e 100644 --- a/home/alisceon/base.nix +++ b/home/alisceon/base.nix @@ -110,9 +110,6 @@ }; # end programs # nixpkgs config xdg.configFile."nixpkgs/config.nix".source = ../conf/config.nix; - home.file.".xonshrc"= { - source = ../conf/xonshrc; - }; # Ensure fish exists for the completer backend home.packages = [ pkgs.fish ]; diff --git a/home/conf/xonshrc b/home/conf/xonshrc deleted file mode 100644 index 3aca5f4..0000000 --- a/home/conf/xonshrc +++ /dev/null @@ -1,16 +0,0 @@ -# XONSH WEBCONFIG START -$XONSH_COLOR_STYLE = 'default' -$PROMPT = '{YELLOW}{env_name}{RESET}{BOLD_GREEN}{user}@{hostname}{BOLD_BLUE} {cwd}{branch_color}{curr_branch: {}}{RESET} {RED}{last_return_code_if_nonzero:[{BOLD_INTENSE_RED}{}{RED}] }{RESET}{BOLD_BLUE}{prompt_end}{RESET} ' -xontrib load coreutils -xontrib load fish_completer -xontrib load direnv -xontrib load fzf-completions -xontrib load clp -xontrib load abbrevs - -from xonsh.built_ins import XSH -XSH.env['fzf_history_binding'] = "c-r" # Ctrl+R -XSH.env['fzf_ssh_binding'] = "c-s" # Ctrl+S -XSH.env['fzf_file_binding'] = "c-t" # Ctrl+T -XSH.env['fzf_dir_binding'] = "c-g" # Ctrl+G - diff --git a/hosts/common/base.nix b/hosts/common/base.nix index cb759c3..0009e52 100644 --- a/hosts/common/base.nix +++ b/hosts/common/base.nix @@ -89,10 +89,10 @@ nushell fish powershell - + # Languages python3 - + # Virtualization podman ]; # end systemPackages @@ -125,14 +125,69 @@ command-not-found.enable = true; xonsh = { enable = true; - extraPackages = ps: with ps; [ + extraPackages = ps: with ps; [ + pyperclip xonsh.xontribs.xonsh-direnv - pkgs-unstable.xonsh-xontrib.xontrib-abbrevs - pkgs-unstable.xonsh-xontrib.xontrib-fzf-completions - pkgs-unstable.xonsh-xontrib.xontrib-fish-completer - pkgs-unstable.xonsh-xontrib.xontrib-clp - pkgs-unstable.xonsh-xontrib.xontrib-bashisms - ]; - }; - }; + pkgs.nur.repos.xonsh-xontribs.xontrib-fish-completer + pkgs.nur.repos.xonsh-xontribs.xontrib-abbrevs + pkgs.nur.repos.xonsh-xontribs.xontrib-clp + pkgs.nur.repos.xonsh-xontribs.xontrib-bashisms + ( + ps.buildPythonPackage + rec { + name = "xontrib-fzf-completions"; + version = "v0.0.2"; + format = "pyproject"; + nativeBuildInputs = [ ps.setuptools ps.setuptools-scm ps.wheel ]; + propagatedBuildInputs = [ ps.xonsh ]; + src = pkgs.fetchFromGitHub { + owner = "doronz88"; + repo = "${name}"; + rev = "${version}"; + sha256 = "sha256-1z5xHX4Psevn8686QkwIzv/LOJ5IMJc2nQ5Hg/2svTc="; + }; + meta = { + homepage = "https://github.com/doronz88/xontrib-fzf-completions"; + description = "fuzzy completions for xonsh"; + license = pkgs.lib.licenses.mit; + maintainers = [ ]; + }; + } + ) + ]; # end extraPackages + config = '' + $XONSH_COLOR_STYLE = 'native' + $PROMPT = '{YELLOW}{env_name}{RESET}{BOLD_GREEN}{user}@{hostname}{BOLD_BLUE} {cwd}{branch_color}{curr_branch: {}}{RESET} {RED}{last_return_code_if_nonzero:[{BOLD_INTENSE_RED}{}{RED}] }{RESET}{BOLD_BLUE}{prompt_end}{RESET} ' + xontrib load coreutils + xontrib load fish_completer + xontrib load direnv + xontrib load fzf-completions + xontrib load clp + xontrib load bashisms + + #xontrib load abbrevs #relies on xonsh.ptk_shell which was deprecated in 0.13 + #from xonsh.built_ins import XSH + #XSH.env['fzf_history_binding'] = "c-r" # Ctrl+R + #XSH.env['fzf_ssh_binding'] = "c-s" # Ctrl+S + #XSH.env['fzf_file_binding'] = "c-t" # Ctrl+T + #XSH.env['fzf_dir_binding'] = "c-g" # Ctrl+G + + aliases["tsla-fan"] = "ipmitool -H 10.30.0.3 -U ADMIN -P ADMIN raw 0x30 0x70 0x66 0x01 0x0" + aliases["nixoss"] = "sudo nixos-rebuild switch --flake .#${config.networking.hostName}" + aliases["nixost"] = "sudo nixos-rebuild test --flake .#${config.networking.hostName}" + aliases["nixosdb"] = "sudo nixos-rebuild dry-build --flake .#${config.networking.hostName}" + aliases["devt"] = "devenv test" + aliases["devtas"] = "devenv tasks list" + aliases["devtar"] = "devenv tasks run" + aliases["devs"] = "devenv shell" + aliases["devi-python"] = "nix flake init -t templates#python" + aliases["weboot"] = "bash -c 'nix shell nixpkgs#efibootmgr -c sudo efibootmgr -n 0000 && reboot'" + aliases["ls"] = "exa" + aliases["ll"] = "exa -lah" + aliases["grep"] = "rg" + aliases["cat"] = "bat -p" + + ''; + }; # end xonsh + }; # end programs } #end file