Merge branch 'main' of ssh://forge.katzen.cafe:2222/schrottkatze/nix-configs

This commit is contained in:
Schrottkatze 2024-07-28 20:45:43 +02:00
commit 737bdba912
Signed by: schrottkatze
SSH key fingerprint: SHA256:hXb3t1vINBFCiDCmhRABHX5ocdbLiKyCdKI4HK2Rbbc
21 changed files with 403 additions and 211 deletions

87
Cargo.lock generated
View file

@ -127,6 +127,12 @@ version = "3.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c"
[[package]]
name = "byteorder"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
[[package]]
name = "cassowary"
version = "0.3.0"
@ -233,6 +239,22 @@ version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f"
[[package]]
name = "crossterm"
version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e64e6c0fbe2c17357405f7c758c1ef960fce08bdfb2c03d88d2a18d7e09c4b67"
dependencies = [
"bitflags 1.3.2",
"crossterm_winapi",
"libc",
"mio",
"parking_lot",
"signal-hook",
"signal-hook-mio",
"winapi 0.3.9",
]
[[package]]
name = "crossterm"
version = "0.27.0"
@ -279,6 +301,12 @@ dependencies = [
"windows-sys 0.48.0",
]
[[package]]
name = "dyn-clone"
version = "1.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125"
[[package]]
name = "ego-tree"
version = "0.6.2"
@ -303,6 +331,24 @@ version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80"
[[package]]
name = "fuzzy-matcher"
version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "54614a3312934d066701a80f20f15fa3b56d67ac7722b39eea5b4c9dd1d66c94"
dependencies = [
"thread_local",
]
[[package]]
name = "fxhash"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c"
dependencies = [
"byteorder",
]
[[package]]
name = "getrandom"
version = "0.2.14"
@ -384,6 +430,23 @@ version = "2.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5"
[[package]]
name = "inquire"
version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fddf93031af70e75410a2511ec04d49e758ed2f26dad3404a934e0fb45cc12a"
dependencies = [
"bitflags 2.5.0",
"crossterm 0.25.0",
"dyn-clone",
"fuzzy-matcher",
"fxhash",
"newline-converter",
"once_cell",
"unicode-segmentation",
"unicode-width",
]
[[package]]
name = "itertools"
version = "0.12.1"
@ -400,7 +463,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
[[package]]
name = "jrnl"
name = "j"
version = "0.1.0"
dependencies = [
"chrono",
@ -408,6 +471,7 @@ dependencies = [
"dirs",
"ego-tree",
"indexmap",
"inquire",
"markdown",
"owo-colors",
"petgraph",
@ -511,6 +575,15 @@ dependencies = [
"windows-sys 0.48.0",
]
[[package]]
name = "newline-converter"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "47b6b097ecb1cbfed438542d16e84fd7ad9b0c76c8a65b7f9039212a3d14dc7f"
dependencies = [
"unicode-segmentation",
]
[[package]]
name = "num-traits"
version = "0.2.18"
@ -616,7 +689,7 @@ dependencies = [
"bitflags 2.5.0",
"cassowary",
"compact_str",
"crossterm",
"crossterm 0.27.0",
"indoc",
"itertools",
"lru",
@ -851,6 +924,16 @@ dependencies = [
"syn",
]
[[package]]
name = "thread_local"
version = "1.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c"
dependencies = [
"cfg-if",
"once_cell",
]
[[package]]
name = "unicode-ident"
version = "1.0.12"

View file

@ -5,13 +5,23 @@
config,
pkgs,
lib,
lix-module,
rs-programs,
...
}:
with lib;
with builtins; {
imports = [lix-module.nixosModules.default];
nix = {
package = pkgs.nixVersions.stable;
settings = {
extra-substituters = [
"https://cache.lix.systems"
];
trusted-public-keys = [
"cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o="
];
};
extraOptions = ''
experimental-features = nix-command flakes
keep-outputs = true
@ -105,6 +115,8 @@ with builtins; {
mtr.enable = true;
};
hardware.gpgSmartcards.enable = true;
time.timeZone = "Europe/Berlin";
home-manager.users.jade = {
@ -145,5 +157,5 @@ with builtins; {
algorithm = "zstd";
};
users.defaultUserShell = pkgs.nushellFull;
users.defaultUserShell = pkgs.nushell;
}

View file

@ -1,170 +0,0 @@
{
"nodes": {
"crane": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1713979152,
"narHash": "sha256-apdecPuh8SOQnkEET/kW/UcfjCRb8JbV5BKjoH+DcP4=",
"owner": "ipetkov",
"repo": "crane",
"rev": "a5eca68a2cf11adb32787fc141cddd29ac8eb79c",
"type": "github"
},
"original": {
"owner": "ipetkov",
"repo": "crane",
"type": "github"
}
},
"fenix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1714285404,
"narHash": "sha256-MmoQIO+KRiH3UnH0myAp2Fgi84rmpROMfw9VIbqrjHA=",
"owner": "nix-community",
"repo": "fenix",
"rev": "94be183087845937b0fd77281c37d0796572b899",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "fenix",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1714203603,
"narHash": "sha256-eT7DENhYy7EPLOqHI9zkIMD9RvMCXcqh6gGqOK5BWYQ=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "c1609d584a6b5e9e6a02010f51bd368cb4782f8e",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"mac-brcm-fw": {
"flake": false,
"locked": {
"lastModified": 1701030348,
"narHash": "sha256-+kW8ogc6DykjMVlrr+3vWKs9ZUdJ9EW72LbY7k/Qvh4=",
"path": "/home/jade/nix-configs/mac-brcm-fw",
"type": "path"
},
"original": {
"path": "/home/jade/nix-configs/mac-brcm-fw",
"type": "path"
}
},
"nixos-hardware": {
"locked": {
"lastModified": 1687903496,
"narHash": "sha256-4PPwbFM4dNqso3zBya5rgfRvnBoIbN2J7qZ2ZpRyOUc=",
"owner": "networkException",
"repo": "nixos-hardware",
"rev": "8e28b9ee431b265d1fc74b8b819ea0816344c4a1",
"type": "github"
},
"original": {
"owner": "networkException",
"ref": "apple-t2-init",
"repo": "nixos-hardware",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1714076141,
"narHash": "sha256-Drmja/f5MRHZCskS6mvzFqxEaZMeciScCTFxWVLqWEY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7bb2ccd8cdc44c91edba16c48d2c8f331fb3d856",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1714272655,
"narHash": "sha256-3/ghIWCve93ngkx5eNPdHIKJP/pMzSr5Wc4rNKE1wOc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "12430e43bd9b81a6b4e79e64f87c624ade701eaf",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-23.11",
"type": "indirect"
}
},
"nixpkgs-unstable-small": {
"locked": {
"lastModified": 1714290118,
"narHash": "sha256-6PzUtOvU7hMQxZV579B04CHE1HXSq/loh9E+d/4fKZY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "30ddacc06345a478f9528fa29e2c8857b90381b2",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable-small",
"type": "indirect"
}
},
"root": {
"inputs": {
"crane": "crane",
"fenix": "fenix",
"home-manager": "home-manager",
"mac-brcm-fw": "mac-brcm-fw",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs",
"nixpkgs-stable": "nixpkgs-stable",
"nixpkgs-unstable-small": "nixpkgs-unstable-small"
}
},
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1714217560,
"narHash": "sha256-zttBYGaoHpZfqWHQ8OI5f9OkGHCHb8tDBMySwsYNa2U=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "f216be4a0746142c5f30835b254871256a7637b8",
"type": "github"
},
"original": {
"owner": "rust-lang",
"ref": "nightly",
"repo": "rust-analyzer",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View file

@ -5,6 +5,22 @@
nixpkgs.url = "nixpkgs/nixos-unstable";
nixpkgs-stable.url = "nixpkgs/nixos-23.11";
nixpkgs-unstable-small.url = "nixpkgs/nixos-unstable-small";
helix-inline-diags = {
url = "github:pascalkuthe/helix/inline-diagnostics";
inputs = {
crane.follows = "crane";
nixpkgs.follows = "nixpkgs";
};
};
lix = {
url = "git+https://git@git.lix.systems/lix-project/lix?ref=refs/tags/2.90-beta.1";
flake = false;
};
lix-module = {
url = "git+https://git.lix.systems/lix-project/nixos-module";
inputs.lix.follows = "lix";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
@ -17,7 +33,6 @@
crane = {
url = "github:ipetkov/crane";
inputs = {
flake-utils.follows = "flake-utils";
nixpkgs.follows = "nixpkgs";
};
};
@ -32,6 +47,8 @@
nixpkgs,
nixpkgs-stable,
nixpkgs-unstable-small,
helix-inline-diags,
lix-module,
home-manager,
nixos-hardware,
mac-brcm-fw,
@ -61,6 +78,8 @@
# cargoLock.lockFile = ./programs/jrnl/Cargo.lock;
# };
s10e-jrnl = crane-lib.buildPackage {
pname = "s10e-bs";
version = "0.0.1";
src = crane-lib.cleanCargoSource (crane-lib.path ./.);
};
};
@ -82,7 +101,7 @@
nixosConfigurations = {
monosodium-glutamate-g = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs pkgs-unstable-small pkgs-stable rs-programs;
inherit inputs pkgs-unstable-small pkgs-stable rs-programs lix-module helix-inline-diags;
};
system = "x86_64-linux";
modules = [
@ -107,7 +126,7 @@
};
catbook-j = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs pkgs-unstable-small pkgs-stable rs-programs;
inherit inputs pkgs-unstable-small pkgs-stable rs-programs lix-module helix-inline-diags;
};
system = "x86_64-linux";
modules = [
@ -132,7 +151,7 @@
};
potatobook-g = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs pkgs-unstable-small rs-programs;
inherit inputs pkgs-unstable-small rs-programs lix-module helix-inline-diags;
};
system = "x86_64-linux";
modules = [

View file

@ -28,6 +28,8 @@
};
};
security.pam.services.swaylock = {};
hardware.usb-modeswitch.enable = true;
systemd.services."ModemManager".enable = true;
systemd.services."ModemManager".wants = ["NetworkManager.service"];
@ -78,7 +80,7 @@
};
boot.kernelPackages = pkgs.linuxPackages_zen;
services.xserver.displayManager.autoLogin = {
services.displayManager.autoLogin = {
enable = true;
user = "jade";
};

View file

@ -23,5 +23,5 @@
sensitivity = 256;
};
services.xserver.libinput.touchpad.tapping = false;
services.libinput.touchpad.tapping = false;
}

View file

@ -65,9 +65,10 @@
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
services.xserver.libinput.touchpad.disableWhileTyping = true;
services.xserver.libinput.touchpad.tapping = false;
services.libinput.touchpad = {
disableWhileTyping = true;
tapping = false;
};
networking.networkmanager.enable = true;
networking.hostName = "potatobook-g";

View file

@ -6,6 +6,13 @@
./compositing.nix
./panels
./xmonad
./sway
];
services.gpg-agent = {
enable = true;
enableNushellIntegration = true;
enableSshSupport = true;
};
};
}

View file

@ -0,0 +1,176 @@
{
pkgs,
lib,
config,
...
}: {
programs.wofi.enable = true;
programs.swaylock.enable = true;
wayland.windowManager.sway = {
enable = true;
systemd = {
enable = true;
};
wrapperFeatures = {
base = true;
gtk = true;
};
config = {
modes = {
resize = {
Down = "resize grow height 10 px";
Escape = "mode default";
Left = "resize shrink width 10 px";
Return = "mode default";
Right = "resize grow width 10 px";
Up = "resize shrink height 10 px";
h = "resize shrink width 10 px";
j = "resize grow height 10 px";
k = "resize shrink height 10 px";
l = "resize grow width 10 px";
};
};
terminal = "kitty";
output = {
"*" = {
bg = "${../xmonad/wallpaper/wallpaper.jpg} fill";
};
};
input = {
"*" = {
xkb_layout = "us";
xkb_variant = "altgr-intl";
};
};
menu = "wofi -d";
modifier = "Mod4";
keybindings = with {
#mod = config.xsession.windowManager.i3.config.modifier;
# mod = "Mod1";
mod = config.wayland.windowManager.sway.config.modifier;
};
lib.mkOptionDefault {
# switch window focus
"${mod}+h" = "focus left";
"${mod}+j" = "focus down";
"${mod}+k" = "focus up";
"${mod}+l" = "focus right";
# move windows
"${mod}+Shift+h" = "move left";
"${mod}+Shift+j" = "move down";
"${mod}+Shift+k" = "move up";
"${mod}+Shift+l" = "move right";
# layout shit
"${mod}+shift+semicolon" = "split h";
"${mod}+semicolon" = "split v";
"${mod}+f" = "fullscreen toggle";
"${mod}+Shift+w" = "layout tabbed";
"${mod}+e" = "layout toggle split";
"${mod}+Shift+space" = "floating toggle";
# focus parents/children
# "${mod}+Shift+a" = "focus parent";
# "${mod}+Shift+c" = "focus child";
# screenshot
# "${mod}+w" = "exec window-screenshot.sh";
# "${mod}+s" = "exec flameshot gui -c -p $HOME/Pictures/screenshots";
# "${mod}+a" = "exec flameshot screen -c -p $HOME/Pictures/screenshots";
# "${mod}+t" = "exec ocr-screenshot.sh";
# rofi fuckery
"${mod}+d" = "exec wofi -S drun --allow-images";
"${mod}+i" = "exec rofimoji --selector wofi -f alchemical_symbols anatolian_hieroglyphs emojis braille_patterns box_drawing chess_symbols emoticons geometric_shapes gothic greek_extended math mathematical_alphanumeric_symbols mathematical_operators miscellaneous_symbols miscellaneous_mathematical_symbols-a miscellaneous_mathematical_symbols-b miscellaneous_symbols_and_arrows miscellaneous_symbols_and_pictographs miscellaneous_technical modi modifier_tone_letters musical_symbols nerd_font number_forms shorthand_format_controls specials variation_selectors vertical_forms -a copy";
# TODO: wayland
# "${mod}+d" = "exec --no-startup-id rofi -show drun -theme ${../../other/rofi-themes/applauncher.rasi}";
# "${mod}+space" = "exec --no-startup-id rofi -show combi -combi-show window#run -modes combi -theme ${../../other/rofi-themes/applauncher.rasi}";
# "${mod}+i" = "exec --no-startup-id rofimoji -f alchemical_symbols anatolian_hieroglyphs emojis braille_patterns box_drawing chess_symbols emoticons geometric_shapes gothic greek_extended math mathematical_alphanumeric_symbols mathematical_operators miscellaneous_symbols miscellaneous_mathematical_symbols-a miscellaneous_mathematical_symbols-b miscellaneous_symbols_and_arrows miscellaneous_symbols_and_pictographs miscellaneous_technical modi modifier_tone_letters musical_symbols nerd_font number_forms shorthand_format_controls specials variation_selectors vertical_forms -a copy";
# "${mod}+Shift+e" = "exec --no-startup-id rofi -show \"desktopctl\" -modes \"desktopctl:${desktop-ctl.outPath}/bin/desktopctl\" -theme ${../../other/rofi-themes/applauncher.rasi}";
# "${mod}+m" = "exec --no-startup-id menu-qalc";
# "${mod}+o" = "exec --no-startup-id rofi -show searchwolf -modes \"searchwolf:${searchwolf.outPath}/bin/searchwolf\"";
# audio
"XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status";
"XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status";
"XF86AudioMute" = "exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status";
"XF86AudioMicMute" = "exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status";
"XF86AudioNext" = "exec playerctl next";
"XF86AudioPrev" = "exec playerctl previous";
"XF86AudioPause" = "exec playerctl pause";
"XF86AudioPlay" = "exec playerctl play";
"XF86AudioStop" = "exec playerctl stop";
"XF86MonBrightnessUp" = "exec brightnessctl set 5%+";
"XF86MonBrightnessDown" = "exec brightnessctl set 5%-";
"XF86KbdBrightnessUp" = "exec brillo -kA 10.0";
"XF86KbdBrightnessDown" = "exec brillo -kU 10.0";
# macros
# "${mod}+q" = "exec em-record.sh";
# "${mod}+p" = "exec em-play.sh";
# "${mod}+Shift+p" = "exec em-play-loop.sh";
# permaclip
# "${mod}+c" = "exec rofi -show register -modes \"register:${pc-set.outPath}/bin/pc-set.sh\" -theme gruvbox-dark";
# "${mod}+v" = "exec rofi -show register -modes \"register:${pc-get.outPath}/bin/pc-get.sh\" -theme gruvbox-dark";
};
fonts = {
names = ["Atkinson Hyperlegible"];
style = "Regular";
size = 9.0;
};
gaps = {
#top = 24;
inner = 15;
outer = 0;
smartGaps = true;
smartBorders = "on";
};
colors = {
background = "#1d2021";
focused = {
background = "#282828";
border = "#504945";
childBorder = "#7c6f64";
indicator = "#504945";
text = "#ebdbb2";
};
focusedInactive = {
background = "#1d2021";
border = "#504945";
childBorder = "#665c54";
indicator = "#664c54";
text = "#d5c4a1";
};
placeholder = {
background = "#1d2021";
border = "#00ff00";
childBorder = "#504945";
indicator = "#504945";
text = "#928374";
};
unfocused = {
background = "#1d2021";
border = "#3c3836";
childBorder = "#504945";
indicator = "#504945";
text = "#bdae93";
};
urgent = {
background = "#9d0006";
border = "#cc241d";
childBorder = "#3c3836";
indicator = "#fb4943";
text = "#ebdbb2";
};
};
window = {
border = 2;
titlebar = true;
};
};
};
}

View file

@ -1,4 +1,8 @@
{pkgs, ...}: {
{
pkgs,
pkgs-stable,
...
}: {
home-manager.users.jade = {pkgs, ...}: {
home.packages = with pkgs; [
audacity
@ -18,6 +22,7 @@
openscad-unstable
openscad-lsp
pkgs-stable.font-manager
fontforge-gtk
onlyoffice-bin_latest

View file

@ -67,7 +67,7 @@ in
services.illum.enable = true;
services.avahi = {
enable = true;
nssmdns = true;
nssmdns4 = true;
openFirewall = true;
};
services.smartd = {
@ -124,7 +124,6 @@ in
jellyfin-media-player
# from environment.systemPackages cleanup
font-manager
xdotool
xorg.xwininfo
gparted
@ -170,6 +169,8 @@ in
mupdf
inotify-tools
logseq
];
xsession = {
enable = true;

View file

@ -82,12 +82,16 @@
"Home manager Options" = {
urls = [
{
template = "https://mipmip.github.io/home-manager-option-search/";
template = "https://home-manager-options.extranix.com/";
params = [
{
name = "query";
value = "{searchTerms}";
}
{
name = "release";
value = "master";
}
];
}
];

View file

@ -37,7 +37,7 @@
};
qt = {
enable = true;
platformTheme = "gtk";
platformTheme.name = "gtk";
};
};
};

View file

@ -1,4 +1,4 @@
{...}: {
{pkgs, ...}: {
services.xserver = {
enable = true;
@ -7,12 +7,21 @@
};
displayManager = {
defaultSession = "none+xmonad";
gdm.enable = true;
sessionPackages = [
pkgs.sway
];
gdm.autoLogin.delay = 5;
};
windowManager.xmonad = {
enable = true;
};
};
security.polkit.enable = true;
programs.sway.enable = true;
# services.displayManager.defaultSession = "none+xmonad";
services.displayManager.defaultSession = "sway";
}

View file

@ -2,14 +2,15 @@
imports = [
./evremap.nix
];
services.xserver = {
xkb = {
layout = "us";
variant = "altgr-intl";
};
services = {
libinput = {
enable = true;
};
xserver = {
xkb = {
layout = "us";
variant = "altgr-intl";
};
};
};
}

View file

@ -1,4 +1,8 @@
{config, ...}: {
{
config,
helix-inline-diags,
...
}: {
home-manager.users.jade = {pkgs, ...}: {
home = {
sessionVariables.EDITOR = "hx";
@ -12,7 +16,7 @@
};
programs.helix = {
enable = true;
package = pkgs.helix;
package = helix-inline-diags.outputs.packages."x86_64-linux".default;
settings = {
theme = "gruvbox";
editor = {
@ -22,6 +26,11 @@
cursorline = true;
auto-save = true;
auto-format = true;
end-of-line-diagnostics = "hint";
inline-diagnostics = {
cursor-line = "hint";
other-lines = "error";
};
lsp = {
display-messages = true;
display-inlay-hints = true;
@ -48,7 +57,7 @@
"file-encoding"
"file-type"
];
idle-timeout = 30;
idle-timeout = 50;
indent-guides = {
render = true;
character = "";

View file

@ -11,6 +11,11 @@
};
home.packages = [
pkgs.pueue
pkgs.nushellPlugins.net
pkgs.nushellPlugins.query
pkgs.nushellPlugins.gstat
pkgs.nushellPlugins.polars
pkgs.nushellPlugins.formats
];
programs.nushell = {
enable = true;

View file

@ -42,6 +42,7 @@ let dark_theme = {
shape_directory: cyan
shape_external: cyan
shape_externalarg: green_bold
shape_external_resolved: light_cyan_bold
shape_filepath: cyan
shape_flag: blue_bold
shape_float: purple_bold
@ -238,7 +239,36 @@ $env.config = {
use_ansi_coloring: true
bracketed_paste: true # enable bracketed paste, currently useless on windows
edit_mode: vi # emacs, vi
shell_integration: true # enables terminal shell integration. Off by default, as some terminals have issues with this.
shell_integration: {
# osc2 abbreviates the path if in the home_dir, sets the tab/window title, shows the running command in the tab/window title
osc2: true
# osc7 is a way to communicate the path to the terminal, this is helpful for spawning new tabs in the same directory
osc7: true
# osc8 is also implemented as the deprecated setting ls.show_clickable_links, it shows clickable links in ls output if your terminal supports it. show_clickable_links is deprecated in favor of osc8
osc8: true
# osc9_9 is from ConEmu and is starting to get wider support. It's similar to osc7 in that it communicates the path to the terminal
osc9_9: false
# osc133 is several escapes invented by Final Term which include the supported ones below.
# 133;A - Mark prompt start
# 133;B - Mark prompt end
# 133;C - Mark pre-execution
# 133;D;exit - Mark execution finished with exit code
# This is used to enable terminals to know where the prompt is, the command is, where the command finishes, and where the output of the command is
osc133: true
# osc633 is closely related to osc133 but only exists in visual studio code (vscode) and supports their shell integration features
# 633;A - Mark prompt start
# 633;B - Mark prompt end
# 633;C - Mark pre-execution
# 633;D;exit - Mark execution finished with exit code
# 633;E - NOT IMPLEMENTED - Explicitly set the command line with an optional nonce
# 633;P;Cwd=<path> - Mark the current working directory and communicate it to the terminal
# and also helps with the run recent menu in vscode
osc633: false
# reset_application_mode is escape \x1b[?1l and was added to help ssh work better
reset_application_mode: true
}
use_kitty_protocol: false
highlight_resolved_externals: true
render_right_prompt_on_last_line: false # true or false to enable or disable right prompt to be rendered on last line of the prompt.
hooks: {
@ -781,6 +811,12 @@ def start_zellij [] {
start_zellij
# plugin add nu_plugin_net
# plugin add nu_plugin_gstat
# plugin add nu_plugin_query
# plugin add nu_plugin_polars
# plugin add nu_plugin_formats
def nsp [
...programs: string
] {

View file

@ -1,5 +1,5 @@
[package]
name = "jrnl"
name = "j"
version = "0.1.0"
edition = "2021"
@ -15,3 +15,4 @@ petgraph = "0.6.4"
ratatui = "0.26.2"
temp-file = "0.1.8"
termsize = "0.1.6"
inquire = "0.7.5"

View file

@ -6,6 +6,7 @@ use std::{
process::Command,
};
use inquire::Text;
use temp_file::{TempFile, TempFileBuilder};
use crate::md::{Entry, ToMd};
@ -17,7 +18,7 @@ pub fn add_entry(path: PathBuf, title: Option<String>) -> io::Result<()> {
std::process::exit(1);
}
let title = prompt("Title")?;
let title = Text::new("Title").prompt().unwrap();
let tmp = TempFileBuilder::new()
.suffix(".jrnl-entry.md")
@ -57,12 +58,3 @@ pub fn add_entry(path: PathBuf, title: Option<String>) -> io::Result<()> {
Ok(())
}
fn prompt(title: &str) -> io::Result<String> {
print!("{}: ", title);
let _ = io::stdout().flush();
let mut buf = String::new();
let stdin = io::stdin();
stdin.read_line(&mut buf)?;
Ok(buf)
}

View file

@ -1,5 +1,4 @@
use chrono::{DateTime, FixedOffset};
use markdown::{Block, Span};
use std::convert::identity;
pub trait ToMd {