Changes to streamline Home Core, and added ms-edit

This commit is contained in:
Chris Toph 2025-05-31 14:27:31 -04:00
parent 3216e68456
commit 13a4a648fd
9 changed files with 107 additions and 81 deletions

36
flake.lock generated
View file

@ -333,11 +333,11 @@
}, },
"hardware": { "hardware": {
"locked": { "locked": {
"lastModified": 1747900541, "lastModified": 1748634340,
"narHash": "sha256-dn64Pg9xLETjblwZs9Euu/SsjW80pd6lr5qSiyLY1pg=", "narHash": "sha256-pZH4bqbOd8S+si6UcfjHovWDiWKiIGRNRMpmRWaDIms=",
"owner": "nixos", "owner": "nixos",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "11f2d9ea49c3e964315215d6baa73a8d42672f06", "rev": "daa628a725ab4948e0e2b795e8fb6f4c3e289a7a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -374,11 +374,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1748570847, "lastModified": 1748668774,
"narHash": "sha256-XU1a6wFctd+s3ZvBIFB6s4GhPJ+Oc6pkeOrEsbA2fMo=", "narHash": "sha256-fYk/vk4ClmvHIgnGv/5GNRiDLtNCwXo9aLq36L/x+P4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "4e9efaa68b0be7e19127dad4f0506a9b89e28ef4", "rev": "60e4624302d956fe94d3f7d96a560d14d70591b9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -460,11 +460,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1748570315, "lastModified": 1748656608,
"narHash": "sha256-laTKC6M+ciljWgUpzhLHyoz1+iRaMBWbQoycX0hhbe8=", "narHash": "sha256-VU+8/kZ57Y7XTmgMBpybGMxO/elvUn/4yMndZji2pY8=",
"owner": "fufexan", "owner": "fufexan",
"repo": "nix-gaming", "repo": "nix-gaming",
"rev": "f85768830fdaee114ea6d18dee80737c74a8dcc9", "rev": "b585487bb87faec1c7a09aada7cfe77dd7b3c5fe",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -545,11 +545,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1748370509, "lastModified": 1748460289,
"narHash": "sha256-QlL8slIgc16W5UaI3w7xHQEP+Qmv/6vSNTpoZrrSlbk=", "narHash": "sha256-7doLyJBzCllvqX4gszYtmZUToxKvMUrg45EUWaUYmBg=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "4faa5f5321320e49a78ae7848582f684d64783e9", "rev": "96ec055edbe5ee227f28cdbc3f1ddf1df5965102",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -561,11 +561,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1748370509, "lastModified": 1748460289,
"narHash": "sha256-QlL8slIgc16W5UaI3w7xHQEP+Qmv/6vSNTpoZrrSlbk=", "narHash": "sha256-7doLyJBzCllvqX4gszYtmZUToxKvMUrg45EUWaUYmBg=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "4faa5f5321320e49a78ae7848582f684d64783e9", "rev": "96ec055edbe5ee227f28cdbc3f1ddf1df5965102",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -768,11 +768,11 @@
"tinted-zed": "tinted-zed" "tinted-zed": "tinted-zed"
}, },
"locked": { "locked": {
"lastModified": 1748572239, "lastModified": 1748699906,
"narHash": "sha256-Of7bmWQUEVILpx1GJz0gLHmRoGrEP/G7q9RnidxW5Go=", "narHash": "sha256-pu2UKagKKysJ7EYeOcm8vWoZq1lcxfwfu3/C1Y3OFz8=",
"owner": "danth", "owner": "danth",
"repo": "stylix", "repo": "stylix",
"rev": "0512b0f685ab2ac0586c897460c247f49670460b", "rev": "8762da957b8b04b8b73248144f1c0ff7a88924b5",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -9,4 +9,13 @@ in
enable = true; enable = true;
package = pkgs.vscode.fhsWithPackages (_: [ patched-openssh ]); package = pkgs.vscode.fhsWithPackages (_: [ patched-openssh ]);
}; };
# Pkgs used with vscode regularly
home.packages = builtins.attrValues {
inherit (pkgs)
nixfmt-rfc-style # nix formatter
nixpkgs-review # nix review tool
biome
;
};
} }

View file

@ -1,33 +0,0 @@
# https://github.com/sharkdp/bat
# https://github.com/eth-p/bat-extras
{ pkgs, ... }:
{
programs.bat = {
enable = true;
config = {
# Git modifications and file header (but no grid)
style = "changes,header";
# theme = "gruvbox-dark";
};
extraPackages = builtins.attrValues {
inherit (pkgs.bat-extras)
batgrep # search through and highlight files using ripgrep
batdiff # Diff a file against the current git index, or display the diff between to files
batman # read manpages using bat as the formatter
;
};
};
# Avoid [bat error]: The binary caches for the user-customized syntaxes and themes in
# '/home/<user>/.cache/bat' are not compatible with this version of bat (0.25.0).
home.activation.batCacheRebuild = {
after = [ "linkGeneration" ];
before = [ ];
data = ''
${pkgs.bat}/bin/bat cache --build
'';
};
}

10
home/global/core/btop.nix Normal file
View file

@ -0,0 +1,10 @@
{
# Processes and system monitor
programs.btop = {
enable = true;
settings = {
color_theme = "stylix";
theme_background = false;
};
};
}

View file

@ -30,10 +30,9 @@ in
]; ];
sessionVariables = { sessionVariables = {
EDITOR = "micro"; EDITOR = "micro";
FLAKE = lib.mkDefault "${homeDir}/git/Nix/dot.nix";
MANPAGER = "batman";
SHELL = lib.getExe shell;
VISUAL = "micro"; VISUAL = "micro";
FLAKE = lib.mkDefault "${homeDir}/git/Nix/dot.nix";
SHELL = lib.getExe shell;
}; };
preferXdgDirectories = true; # whether to make programs use XDG directories whenever supported preferXdgDirectories = true; # whether to make programs use XDG directories whenever supported
@ -57,27 +56,16 @@ in
# Core pkgs with no configs # Core pkgs with no configs
home.packages = builtins.attrValues { home.packages = builtins.attrValues {
inherit (pkgs) inherit (pkgs)
btop # resource monitor
coreutils # basic gnu utils coreutils # basic gnu utils
delta # diffing
difftastic # diffing
direnv # environment per directory direnv # environment per directory
dust # disk usage dust # disk usage
eza # ls replacement eza # ls replacement
gh # github cli
jq # json parser
man-pages
man-pages-posix
nixfmt-rfc-style # nix formatter
nixpkgs-review # nix review tool
nmap # network scanner nmap # network scanner
pre-commit # git hooks
trashy # trash cli trashy # trash cli
unrar # rar extraction unrar # rar extraction
unzip # zip extraction unzip # zip extraction
xdg-user-dirs
xdg-utils # provide cli tools such as `xdg-mime` and `xdg-open`
zip # zip compression zip # zip compression
microsoft-edit
; ;
}; };

View file

@ -2,10 +2,6 @@ set fish_greeting # Disable greeting
## Aliases and Overrides ## ## Aliases and Overrides ##
function cd
zoxide $argv
end
function ls function ls
eza $argv eza $argv
end end

View file

@ -1,10 +0,0 @@
{
programs.zoxide = {
enable = true;
enableBashIntegration = true;
enableFishIntegration = true;
options = [
"--cmd cd" # replace cd with z and zi (via cdi)
];
};
}

View file

@ -0,0 +1,51 @@
{
lib,
rustPlatform,
fetchFromGitHub,
versionCheckHook,
nix-update-script,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "microsoft-edit";
version = "1.0.0";
src = fetchFromGitHub {
owner = "microsoft";
repo = "edit";
tag = "v${finalAttrs.version}";
hash = "sha256-5GUAHa0/7k4uVNWEjn0hd1YvkRnUk6AdxTQhw5z95BY=";
};
useFetchCargoVendor = true;
cargoHash = "sha256-DEzjfrXSmum/GJdYanaRDKxG4+eNPWf5echLhStxcIg=";
# Requires nightly features
env.RUSTC_BOOTSTRAP = 1;
# Add a patch to fix the write_filled error
patches = [
./write-filled-fix.patch
];
# Disabled for now, microsoft/edit#194
doInstallCheck = false;
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgram = "${placeholder "out"}/bin/edit";
versionCheckProgramArg = "--version";
passthru.updateScript = nix-update-script { };
meta = {
description = "Simple editor for simple needs";
longDescription = ''
This editor pays homage to the classic MS-DOS Editor,
but with a modern interface and input controls similar to VS Code.
The goal is to provide an accessible editor that even users largely
unfamiliar with terminals can easily use.
'';
mainProgram = "edit";
homepage = "https://github.com/microsoft/edit";
changelog = "https://github.com/microsoft/edit/releases/tag/v${finalAttrs.version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ RossSmyth ]; # https://github.com/NixOS/nixpkgs/pull/409075
};
})

View file

@ -0,0 +1,15 @@
--- a/src/tui.rs
+++ b/src/tui.rs
@@ -3529,7 +3529,11 @@ impl<'a> NodeMap<'a> {
let shift = 64 - width;
let mask = (slots - 1) as u64;
- let slots = arena.alloc_uninit_slice(slots).write_filled(None);
+ let uninit_slots = arena.alloc_uninit_slice(slots);
+ for slot in uninit_slots.iter_mut() {
+ slot.write(None);
+ }
+ let slots = unsafe { std::mem::transmute::<&mut [std::mem::MaybeUninit<Option<&'a NodeCell<'a>>>], &mut [Option<&'a NodeCell<'a>>]>(uninit_slots) };
let mut node = tree.root_first;
loop {