Compare commits

..

No commits in common. "acd7def6ed93fe5aceb84e1119a7d6ebc52cde85" and "8ebf4b74e6f2d12f42a26cfe075c3c9f0038f9cb" have entirely different histories.

29 changed files with 97 additions and 5157 deletions

View file

@ -9,7 +9,7 @@
# inputs.home-manager.nixosModules.home-manager
];
system.stateVersion = "26.05";
system.stateVersion = "25.05";
services.resolved.enable = false;
# Enable SSH
@ -38,9 +38,6 @@
atuin
rcon
lix
nix-output-monitor
wget
comma
];
# Set up direnv
@ -128,5 +125,10 @@
nixos.enable = lib.mkForce false;
};
security.polkit.enable = true;
# home-manager = {
# useGlobalPkgs = true;
# useUserPackages = true;
# verbose = true;
# extraSpecialArgs = { inherit inputs; };
# };
}

View file

@ -35,12 +35,4 @@ _: {
# secrets
sops.age.keyFile = "/sops/sops-key.txt";
sops.defaultSopsFormat = "dotenv";
users.extraUsers.jana.extraGroups = [
"storage"
"syncthing"
"jellyfin"
"media"
"nginx"
];
}

1554
flake.lock generated

File diff suppressed because it is too large Load diff

100
flake.nix
View file

@ -1,19 +1,11 @@
{
description = "jana's server infrastructure";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
nixpkgs.url = "github:NixOS/nixpkgs/release-25.11";
colmena.url = "github:zhaofengli/colmena";
flake-utils.url = "github:numtide/flake-utils";
sops-nix.url = "github:Mic92/sops-nix";
vpn-confinement.url = "github:Maroka-chan/VPN-Confinement";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
firefox-addons = {
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
inputs.nixpkgs.follows = "nixpkgs";
};
# websites
@ -26,50 +18,6 @@
mifg.url = "git+ssh://forgejo@git.donsz.nl/jana/money.is.fckn.gay.git";
secrets.url = "git+ssh://forgejo@git.donsz.nl/jana/server-secrets.git";
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
t.url = "github:jdonszelmann/t-rs";
dumpasm.url = "github:jdonszelmann/dumpasm";
kitty-search = {
url = "github:trygveaa/kitty-kitten-search";
flake = false;
};
jujutsu = {
url = "github:martinvonz/jj";
inputs.nixpkgs.follows = "nixpkgs";
};
p1n3appl3 = {
url = "github:p1n3appl3/config";
inputs.rahul-config.follows = "rahul-config";
};
rahul-config.url = "github:jdonszelmann/nix-config";
niri-unstable.url = "github:YaLTeR/niri";
niri = {
url = "github:sodiboo/niri-flake";
inputs.niri-unstable.follows = "niri-unstable";
};
matugen = {
url = "github:/InioX/matugen/main";
inputs.nixpkgs.follows = "nixpkgs";
};
noctalia = {
url = "github:noctalia-dev/noctalia-shell";
inputs.nixpkgs.follows = "nixpkgs";
};
pipethon.url = "git+ssh://forgejo@git.donsz.nl/jana/pipethon.git";
firefox-sidebar-css = {
url = "github:drannex/FirefoxSidebar";
flake = false;
};
raw-data.url = "git+ssh://forgejo@git.donsz.nl/jana/raw-data.git";
};
outputs =
{
@ -79,19 +27,7 @@
flake-utils,
sops-nix,
vpn-confinement,
home-manager,
mapf,
nixvim,
t,
dumpasm,
jujutsu,
pipethon,
niri,
niri-unstable,
matugen,
noctalia,
firefox-addons,
raw-data,
...
}@inputs:
let
@ -100,19 +36,7 @@
import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [
(_: _: {
custom = {
t = t.packages.${system}.default;
inherit (dumpasm.packages.${system}) dumpasm;
inherit (jujutsu.packages.${system}) jujutsu;
pipethon = pipethon.packages.${system}.python;
niri = niri-unstable.packages.${system}.niri;
raw-data = raw-data.packages.${system}.default;
};
p1n3appl3 = inputs.p1n3appl3.packages.${system};
})
];
overlays = [ ];
};
in
{
@ -127,7 +51,6 @@
nixpkgs = pkgsForSystem system;
specialArgs.flakes = inputs;
specialArgs.inputs = inputs;
specialArgs.secrets = inputs.secrets.packages.${system}.secrets;
};
@ -149,22 +72,6 @@
vpn-confinement.nixosModules.default
];
};
kili = {
deployment = {
allowLocalDeployment = true;
targetHost = null;
replaceUnknownProfiles = false;
tags = [ "laptop" ];
# buildOnTarget = true;
targetUser = "jana";
};
imports = [
home-manager.nixosModules.home-manager
./kili/configuration.nix
./users/users.nix
];
};
};
}
// flake-utils.lib.eachDefaultSystem (
@ -180,9 +87,6 @@
(pkgs.writeShellScriptBin "apply" ''
colmena apply --no-substitute
'')
(pkgs.writeShellScriptBin "apply-local" ''
colmena apply-local --sudo
'')
];
shellHook = "exec $NIX_BUILD_SHELL";
};

View file

@ -1,167 +0,0 @@
{
pkgs,
flakes,
config,
...
}:
{
imports = [
./hardware-configuration.nix
../default-machine-config.nix
../programs/kanata/system.nix
];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "kili";
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Europe/Amsterdam";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "nl_NL.UTF-8";
LC_IDENTIFICATION = "nl_NL.UTF-8";
LC_MEASUREMENT = "nl_NL.UTF-8";
LC_MONETARY = "nl_NL.UTF-8";
LC_NAME = "nl_NL.UTF-8";
LC_NUMERIC = "nl_NL.UTF-8";
LC_PAPER = "nl_NL.UTF-8";
LC_TELEPHONE = "nl_NL.UTF-8";
LC_TIME = "nl_NL.UTF-8";
};
services.xserver.xkb = {
layout = "us";
variant = "";
};
users.users.jana = {
isNormalUser = true;
description = "jana";
extraGroups = [
"networkmanager"
"wheel"
];
packages = with pkgs; [ ];
};
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
firefox
kitty
pkgs.custom.niri
zed-editor
signal-desktop
discord
nautilus
adwaita-icon-theme
(pkgs.callPackage (
{ stdenv }:
stdenv.mkDerivation {
name = "global-cursor-theme";
unpackPhase = "true";
outputs = [ "out" ];
installPhase = ''
mkdir -p $out/share/icons/default
cat << EOF > $out/share/icons/default/index.theme
[Icon Theme]
Name=Default
Comment=Default Cursor Theme
Inherits=Adwaita
EOF
'';
}
) { })
];
services.xserver.enable = true;
services.displayManager.gdm.enable = true;
services.desktopManager.gnome.enable = true;
services.gnome.gnome-keyring.enable = true;
services.gvfs.enable = true;
services.displayManager.sessionPackages = [ pkgs.custom.niri ];
programs.dconf.enable = true;
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
services.xserver.videoDrivers = [
"modesetting"
"nvidia"
];
hardware.graphics.enable = true;
hardware.graphics.extraPackages = [ pkgs.libva-vdpau-driver ];
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = true;
powerManagement.finegrained = false;
# use nvidia opensource driver (not nouveau!!)
open = true;
nvidiaSettings = true;
prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
intelBusId = "PCI:0@00:02:0";
nvidiaBusId = "PCI:0@01:00:0";
};
package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
version = "580.95.05";
sha256_64bit = "sha256-hJ7w746EK5gGss3p8RwTA9VPGpp2lGfk5dlhsv4Rgqc=";
sha256_aarch64 = "sha256-zLRCbpiik2fGDa+d80wqV3ZV1U1b4lRjzNQJsLLlICk=";
openSha256 = "sha256-RFwDGQOi9jVngVONCOB5m/IYKZIeGEle7h0+0yGnBEI=";
settingsSha256 = "sha256-F2wmUEaRrpR1Vz0TQSwVK4Fv13f3J9NJLtBe4UP2f14=";
persistencedSha256 = "sha256-QCwxXQfG/Pa7jSTBB0xD3lsIofcerAWWAHKvWjWGQtg=";
patchesOpen = [
(pkgs.fetchpatch {
name = "get_dev_pagemap.patch";
url = "https://github.com/NVIDIA/open-gpu-kernel-modules/commit/3e230516034d29e84ca023fe95e284af5cd5a065.patch";
hash = "sha256-BhL4mtuY5W+eLofwhHVnZnVf0msDj7XBxskZi8e6/k8=";
})
];
};
};
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
nix.settings = {
# users that can interact with nix
trusted-users = [
"jana"
"root"
];
};
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.jana = ./home.nix;
extraSpecialArgs = {
inherit flakes;
};
};
}

View file

@ -1,31 +0,0 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/4919727e-d114-4d57-b206-522b5df5fccc";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/26CD-373C";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,58 +0,0 @@
{
config,
pkgs,
flakes,
...
}:
{
imports = [
flakes.nixvim.homeModules.nixvim
flakes.niri.homeModules.niri
flakes.matugen.nixosModules.default
flakes.noctalia.homeModules.default
# ../programs/nvim
../programs/fish
../programs/kanata
../programs/kitty
../programs/tmux
../programs/git
../programs/jj
../programs/niri
../programs/zed
../programs/firefox
];
home = {
stateVersion = "26.05";
username = "jana";
homeDirectory = "/home/jana";
packages = with pkgs; [
p1n3appl3.tab
];
};
home.file = {
"dl".source = config.lib.file.mkOutOfStoreSymlink "${config.xdg.userDirs.download}";
"doc".source = config.lib.file.mkOutOfStoreSymlink "${config.xdg.userDirs.documents}";
};
xdg = {
enable = true;
configHome = "${config.home.homeDirectory}/.config";
userDirs = {
enable = true;
documents = "${config.home.homeDirectory}/Documents";
desktop = "${config.home.homeDirectory}/Documents";
download = "${config.home.homeDirectory}/Downloads";
music = "${config.home.homeDirectory}/Documents/personal/music";
pictures = "${config.home.homeDirectory}/Documents/personal/pictures";
};
mime.enable = true;
};
}

View file

@ -1,25 +0,0 @@
{ pkgs
, lib
, cosmicLib
, ...
}:
let
ron = cosmicLib.cosmic.mkRON;
in
{
wayland.desktopManager.cosmic = {
enable = true;
# shortcuts = [
# {
# action = ron "enum" "Close";
# key = "Super+Q";
# }
# {
# action = ron "enum" "maximize";
# key = "Super+d";
# }
# ];
};
}

View file

@ -1,153 +0,0 @@
{
config,
flakes,
pkgs,
...
}:
let
ff-pkgs = flakes.firefox-addons.packages.${pkgs.system};
lock-false = {
Value = false;
Status = "locked";
};
# lock-true = {
# Value = true;
# Status = "locked";
# };
in
{
home.file."${config.programs.firefox.profilesPath}/main/chrome".source =
"${flakes.firefox-sidebar-css}";
programs.firefox = {
enable = true;
package = pkgs.wrapFirefox pkgs.firefox-unwrapped {
extraPolicies = {
DisableFormHistory = true;
OfferToSaveLogins = false;
PasswordManagerEnabled = false;
AppAutoUpdate = false;
DisableFirefoxStudies = true;
DisablePocket = true;
DisableTelemetry = true;
UserMessaging = {
WhatsNew = true;
ExtensionRecommendations = false;
FeatureRecommendations = false;
UrlbarInterventions = false;
SkipOnboarding = true;
MoreFromMozilla = false;
Locked = true;
};
FirefoxHome = {
Search = true;
TopSites = false;
SponsoredTopSites = false;
Highlights = false;
Pocket = false;
SponsoredPocket = false;
Snippets = false;
Locked = false;
};
FirefoxSuggest = {
WebSuggestions = false;
SponsoredSuggestions = false;
ImproveSuggest = false;
Locked = true;
};
# TODO: https://github.com/TheRealGramdalf/nixos/blob/83f4339b121175f47940314bf5811080ac42c316/users/games/firefox/privacy.nix
};
};
profiles.default = {
id = 0;
name = "profile_0";
isDefault = true;
settings = {
# specify profile-specific preferences here; check about:config for options
"browser.newtabpage.activity-stream.feeds.section.highlights" = false;
"browser.startup.page" = 3; # Restore previous tabs
"extensions.autoDisableScopes" = 0;
"extensions.pocket.enabled" = lock-false;
"browser.tabs.closeWindowWithLastTab" = lock-false;
"sidebar.position_start" = false; # sidebar on the right
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
};
userChrome = builtins.readFile ./userChrome.css;
userContent = builtins.readFile ./userChrome.css;
extensions.packages = with ff-pkgs; [
bitwarden
ublock-origin
sidebery
sponsorblock
# vimium
];
bookmarks = {
force = true;
settings = [
{
keyword = "!w";
url = "https://www.wikipedia.org/w/index.php?title=Special:Search&search=%s";
}
{
keyword = "!m";
url = "https://www.google.com/maps?q=%s";
}
{
keyword = "!git";
url = "https://github.com/search?q=%s&type=code";
}
{
keyword = "!std";
url = "https://std.rs%s";
}
{
keyword = "!rust";
url = "https://docs.rs/releases/search?query=%s";
}
{
keyword = "!np";
url = "https://search.nixos.org/packages?query=%s";
}
{
keyword = "!nf";
url = "https://search.nixos.org/flakes?query=%s";
}
];
};
# extensions.settings = {
# "${ff-pkgs.sidebery.addonId}".settings = {
# sidebar = {
# # panels = with builtins; with lib; listToAttrs (map ffContainerToSideberryPanel (attrsToList containers));
# # nav = [ "Personal" "Programming"];
# };
# # https://github.com/Dash-L/nixconfig/blob/c30f6d1486a3fe2b3793ab0cb13a88edefe83b7a/home/firefox.nix#L82
# settings = {
# pinnedTabsPosition = "top";
# hideEmptyPanels = false;
# activateAfterClosing = "prev";
# activateAfterClosingStayInPanel = true;
# newTabCtxReopen = true;
# };
# };
# };
};
};
xdg.mimeApps = {
defaultApplications."x-scheme-handler/http" = [
"firefox.desktop"
];
defaultApplications."x-scheme-handler/https" = [
"firefox.desktop"
];
defaultApplications."text/html" = [ "firefox.desktop" ];
defaultApplications."x-scheme-handler/about" = [ "firefox.desktop" ];
defaultApplications."x-scheme-handler/unknown" = [ "firefox.desktop" ];
};
}

View file

@ -1,3 +0,0 @@
#TabsToolbar {
visibility: collapse;
}

View file

@ -1,236 +0,0 @@
{ config
, pkgs
, lib
, ...
}:
with builtins;
with lib.attrsets;
let
scripts = (import ./scripts.nix) pkgs;
aliases = with scripts; {
"cp-mov" = cp-media "mov" "movies";
"cp-ser" = cp-media "ser" "shows";
"cp-ani" = cp-media "ani" "anime";
"dumpasm" = "${pkgs.custom.dumpasm}/bin/dumpasm";
"p" = builtins.trace calc calc;
"s" = "systemctl";
"j" = "journalctl";
"ju" = "journalctl -u";
"jfu" = "journalctl -fu";
"ls" = "${pkgs.eza}/bin/eza --git";
"ll" = "${pkgs.eza}/bin/eza --git";
"lt" = "${pkgs.eza}/bin/eza --long --tree -L 3";
"open" = "${pkgs.xdg-utils}/bin/xdg-open";
"cb" = "${pkgs.wl-clipboard-rs}/bin/wl-copy";
"cat" = "${pkgs.bat}/bin/bat";
# "pull" = "${pkgs.git}/bin/git pull";
# "push" = "${pkgs.git}/bin/git push";
# "commit" = "${pkgs.git}/bin/git commit";
# "add" = "${pkgs.git}/bin/git add";
# "patch" = "${pkgs.git}/bin/git add -p";
# "amend" = "${pkgs.git}/bin/git commit --amend";
# "log" = "${pkgs.git}/bin/git log --all --graph --decorate";
# "st" = "${pkgs.git}/bin/git status";
# "checkout" = "${pkgs.git}/bin/git checkout";
# "rebase" = "${pkgs.git}/bin/git rebase";
# "stash" = "${pkgs.git}/bin/git stash";
"edit" = "jj edit";
"old" = "jj edit @-";
"new" = "jj edit @+";
"rebase" = "jj rebase";
"pull" = "jj git fetch; jj catchup";
"msg" = "jj describe -m";
"branch" = "jj bookmark set";
"stat" = "jj status";
"push" = "jj git push";
"tidy" = "x test tidy --bless";
"ui" = "x test tests/ui/";
"f" = "nautilus --no-desktop . &";
};
# extracting any compressed format
extract = ''
function extract -a file -d "decompress a file"
if not test -f $file
echo "'$file' is not a valid file"
return 1
end
switch $file
# tar can automatically figure out how to decompress
case '*.{tar,tar.{bz2,zst,gz,xz},tbz2,tgz'; ${pkgs.gnutar}/bin/tar xf $file; end
case '*.bz2'; bunzip2 $file; end
case '*.rar'; unrar e $file; end
case '*.gz'; gunzip $file; end
case '*.zip'; ${pkgs.unzip}/bin/unzip $file; end
case '*.Z'; uncompress $file; end
case '*.7z'; 7z x $file; end
case '*';
echo "'$file' cannot be extracted"
return 1
end
end
'';
in
{
programs = {
atuin = {
enable = true;
enableFishIntegration = true;
settings = {
filter_mode_shell_up_key_binding = "directory";
exit_mode = "return-original";
workspaces = true;
};
};
zoxide = {
enable = true;
enableFishIntegration = true;
};
direnv = {
enable = true;
# enableFishIntegration = lib.mkDefault true;
};
fzf = {
enable = true;
enableFishIntegration = true;
};
fish = {
enable = true;
shellAliases = aliases;
plugins = with pkgs.fishPlugins; [
{
name = "bang-bang";
src = pkgs.fetchFromGitHub {
owner = "oh-my-fish";
repo = "plugin-bang-bang";
rev = "ec991b80ba7d4dda7a962167b036efc5c2d79419";
hash = "sha256-oPPCtFN2DPuM//c48SXb4TrFRjJtccg0YPXcAo0Lxq0=";
};
}
{
name = "tide";
inherit (tide) src;
}
{
name = "sponge";
inherit (sponge) src;
}
{
name = "autopair";
inherit (autopair) src;
}
];
functions = {
fish_jj_prompt = {
body = ''
if not ${config.programs.jujutsu.package}/bin/jj root --quiet &>/dev/null
return 1
end
${config.programs.jujutsu.package}/bin/jj log --ignore-working-copy --no-graph --color always -r @ -T '
separate(
" ",
bookmarks.join(", "),
change_id.shortest(),
commit_id.shortest(),
if(conflict, "conflict"),
if(empty, "empty"),
if(divergent, "divergent"),
if(hidden, "hidden"),
)
'
'';
};
_tide_item_jj = {
body = ''
set -l _tide_item_jj_color $_tide_location_color
echo -ns $_tide_item_jj_color" ("(fish_jj_prompt)$_tide_item_jj_color")"
'';
};
_tide_item_git = {
body = ''
if not test -d .jj
fish_git_prompt '%s'
end
'';
};
};
interactiveShellInit = ''
fish_vi_key_bindings
set -g sponge_successful_exit_codes 0
set -g sponge_allow_previously_successful false
set -g sponge_delay 10
${config.programs.jujutsu.package}/bin/jj util completion fish | source
# if set -q tide_left_prompt_items; and not contains "jj" $tide_left_prompt_items
# set -l tide_item_jj_idx (contains -i "pwd" $tide_left_prompt_items)
# if test $tide_item_jj_idx
# set tide_left_prompt_items \
# $tide_left_prompt_items[1..$tide_item_jj_idx] \
# jj \
# $tide_left_prompt_items[(math $tide_item_jj_idx + 1)..-1]
# end
# end
function t
cd "$(${pkgs.custom.t}/bin/t-rs $argv | tail -n 1)"
end
function temp
t $argv
end
function rs
cd "$(${pkgs.custom.t}/bin/t-rs $argv | tail -n 1)"
cargo init . --bin --name $(basename "$PWD")
vim src/main.rs
end
fish_add_path "$HOME/.cargo/bin"
fish_add_path "$HOME/.local/bin"
fish_add_path "$HOME/Documents/scripts"
fish_add_path "$HOME/.nix-profile/bin"
function fish_greeting
${pkgs.blahaj}/bin/blahaj -s
end
'';
};
};
home.activation = {
setupTide = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
setupTide() {
${pkgs.fish}/bin/fish -c ${lib.escapeShellArg "tide configure ${
lib.cli.toGNUCommandLineShell { } {
auto = true;
style = "Lean";
prompt_colors = "True color";
show_time = "No";
lean_prompt_height = "Two lines";
prompt_connection = "Disconnected";
prompt_spacing = "Compact";
icons = "Few icons";
transient = "Yes";
}
}"} >/dev/null 2>&1
}
setupTide
'';
};
}

View file

@ -1,25 +0,0 @@
{ pkgs, ... }:
{
calc = "${pkgs.custom.pipethon}/bin/python -i ${pkgs.writeText "init.py" ''
import sys
sys.path.append("${../../scriptlib}")
from scriptlib import *
''} ";
# sys.path.append("${pkgs.python314Packages.numpy}/lib/python3.14/site-packages/")
cp-media =
name: media:
let
s = pkgs.writeScriptBin "cp-${name}" ''
echo "copying to library ${media}"
echo "calculating hash"
find "$1" - type f - print0 | sort - z | xargs - 0 sha1sum | awk '{
print $1}' | sha1sum | awk '{print $1}' > "$1.hash"
rsync -azP "$1" fili:/media/${media}
rsync -azP "$1.hash" fili:/media/${media}
'';
in
"${s}/bin/cp-${name}";
}

View file

@ -1,36 +0,0 @@
_: {
programs.git = {
enable = true;
signing.key = "/home/jana/.ssh/id_ed25519.pub";
signing.signByDefault = true;
settings = {
user.email = "jana@donsz.nl";
user.name = "Jana Dönszelmann";
push.autoSetupRemote = true;
pull.rebase = true;
init.defaultBranch = "main";
gpg.format = "ssh";
diff.colorMoved = "default";
rerere.enabled = true;
alias.conflicts = "diff --check";
};
};
programs.delta = {
enable = true;
options = {
navigate = true;
light = false;
side-by-side = true;
features = "decorations interactive";
interactive = {
keep-plus-minus-markers = false;
};
};
enableGitIntegration = true;
};
}

View file

@ -1,255 +0,0 @@
{ pkgs, lib, ... }:
let
unbound = [ "@as []" ];
custom-keys = [
{
binding = "<Shift><Super>Return";
command = "gnome-terminal";
name = "Launch terminal";
}
{
binding = "<Super>z";
command = "gnome-system-monitor";
name = "launch system monitor";
}
{
binding = "<Super>Return";
command = "${pkgs.custom.ghostty}/bin/ghostty";
name = "focus-terminal";
}
{
binding = "F12";
command = "${pkgs.custom.ghostty}/bin/ghostty -- ${((import ../fish/scripts.nix) pkgs).calc}";
name = "calculator";
}
];
in
{
dconf = {
enable = true;
settings =
{
"org/gnome/shell" = {
# pinned app bar
favorite-apps = [
"firefox.desktop"
"org.gnome.Nautilus.desktop"
"org.gnome.Settings.desktop"
"org.gnome.Terminal.desktop"
"jetbrains-clion-ec2b1366-55e3-4ecc-8780-ab6c7542eb56.desktop"
"discord-canary.desktop"
"io.element.Element.desktop"
"mattermost-desktop.desktop"
"org.mozilla.Thunderbird.desktop"
"spotify.desktop"
];
disable-user-extensions = false;
enabled-extensions = [
"horizontal-workspaces@gnome-shell-extensions.gcampax.github.com"
"org.gnome-shell.desktop-icons"
"auto-move-windows@gnome-shell-extensions.gcampax.github.com"
];
};
"org/gnome/desktop/background" = rec {
# picture-uri ="file:///${home.homeDirectory}/Pictures/backgrounds/2023-09-01-14-56-45-Road-saturated.png";
# picture-uri-dark = picture-uri;
};
"org/gnome/desktop/input-sources" = {
per-window = false;
show-all-sources = false;
sources = [ "('xkb', 'us')" ];
xkb-options = [
"lv3:switch"
"caps:escape"
"eurosign:4"
"compose:ralt"
];
};
"org/gnome/desktop/interface" = {
clock-show-seconds = true;
clock-show-weekday = true;
color-scheme = "prefer-dark";
cursor-theme = "Adwaita";
enable-animations = true;
enable-hot-corners = true;
font-name = "Noto Sans, 10";
};
"org/gnome/desktop/peripherals/mouse" = {
accel-profile = "adaptive";
natural-scroll = false;
};
"org/gnome/desktop/peripherals/touchpad" = {
click-method = "fingers";
disable-while-typing = false;
edge-scrolling-enabled = false;
natural-scroll = false;
send-events = "enabled";
speed = 0.5;
tap-to-click = true;
two-finger-scrolling-enabled = true;
};
"org/gnome/desktop/sound" = {
allow-volume-above-100-percent = true;
event-sounds = true;
};
"org/gnome/desktop/wm/keybindings" = {
always-on-top = [ "<Super>t" ];
begin-move = unbound;
begin-resize = unbound;
close = [ "<Super>q" ];
lower = unbound;
maximize = unbound;
minimize = [ "<Super>w" ];
move-to-monitor-down = [ "<Super>Down" ];
move-to-monitor-left = [ "<Super>Left" ];
move-to-monitor-right = [ "<Super>Right" ];
move-to-monitor-up = [ "<Super>Up" ];
move-to-workspace-1 = [ "<Shift><Super>exclam" ];
move-to-workspace-2 = [ "<Shift><Super>at" ];
move-to-workspace-3 = [ "<Shift><Super>numbersign" ];
move-to-workspace-4 = [ "<Shift><Super>dollar" ];
move-to-workspace-5 = [ "<Shift><Super>percent" ];
move-to-workspace-6 = [ "<Shift><Super>asciicircum" ];
panel-main-menu = [ "" ];
raise-or-lower = [ "<Super>s" ];
switch-applications = [ "<Super>Tab" ];
switch-applications-backward = [ "<Shift><Super>Tab" ];
switch-input-source = unbound;
switch-input-source-backward = unbound;
switch-to-workspace-1 = [ "<Super>1" ];
switch-to-workspace-2 = [ "<Super>2" ];
switch-to-workspace-3 = [ "<Super>3" ];
switch-to-workspace-4 = [ "<Super>4" ];
switch-to-workspace-5 = [ "<Super>5" ];
switch-to-workspace-6 = [ "<Super>6" ];
switch-to-workspace-down = [ "<Super>j" ];
switch-to-workspace-last = [ "<Super>0" ];
switch-to-workspace-up = [ "<Super>k" ];
switch-windows = unbound;
switch-windows-backward = unbound;
toggle-fullscreen = [ "<Super>f" ];
toggle-maximized = [ "<Super>d" ];
unmaximize = unbound;
};
"org/gnome/desktop/wm/preferences" = {
auto-raise = false;
button-layout = ":,maximize,minimize,close";
focus-mode = "click";
mouse-button-modifier = "<Super>";
num-workspaces = 6;
resize-with-right-button = false;
visual-bell = false;
};
"org/gnome/mutter" = {
center-new-windows = true;
dynamic-workspaces = false;
edge-tiling = true;
experimental-features = [ "scale-monitor-framebuffer" ];
overlay-key = "Super_L";
workspaces-only-on-primary = true;
};
"org/gnome/mutter/keybindings" = {
switch-monitor = [ "<Super>o" ];
toggle-tiled-left = [ "<Super>bracketleft" ];
toggle-tiled-right = [ "<Super>bracketright" ];
};
"org/gnome/settings-daemon/plugins/media-keys" = {
area-screenshot = unbound;
area-screenshot-clip = [ "<Shift><Super>s" ];
custom-keybindings =
with builtins;
(map (
i: "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom${toString (i - 1)}/"
) (genList (x: x + 1) (length custom-keys)));
email = [ "Display" ];
home = [ "<Super>e" ];
mic-mute = [ "AudioMicMute" ];
next = [ "<Super>period" ];
on-screen-keyboard = unbound;
pause = unbound;
play = [ "<Super>slash" ];
previous = [ "<Super>comma" ];
screensaver = [ "<Super>l" ];
screenshot = unbound;
screenshot-clip = unbound;
stop = unbound;
volume-down = [ "AudioLowerVolume" ];
volume-mute = [ "AudioMute" ];
volume-up = [ "AudioRaiseVolume" ];
window-screenshot = unbound;
window-screenshot-clip = unbound;
};
"org/gnome/settings-daemon/plugins/power" = {
ambient-enabled = false;
idle-dim = false;
power-button-action = "nothing";
power-saver-profile-on-low-battery = true;
sleep-inactive-ac-timeout = 7200;
sleep-inactive-ac-type = "nothing";
sleep-inactive-battery-timeout = 7200;
sleep-inactive-battery-type = "suspend";
};
"org/gnome/shell/extensions/auto-move-windows" = {
application-list = [
"firefox.desktop:1"
"discord.desktop:3"
"jetbrains-clion.desktop:2"
"jetbrains-goland.desktop:2"
"jetbrains-pycharm.desktop:2"
"jetbrains-idea.desktop:2"
"spotify.desktop:5"
];
};
"org/gnome/shell/keybindings" = {
open-application-menu = [ "Menu" ];
show-screenshot-ui = [ "<Shift><Super>s" ];
switch-to-application-1 = unbound;
switch-to-application-2 = unbound;
switch-to-application-3 = unbound;
switch-to-application-4 = unbound;
switch-to-application-5 = unbound;
switch-to-application-6 = unbound;
switch-to-application-7 = unbound;
switch-to-application-8 = unbound;
switch-to-application-9 = unbound;
toggle-message-tray = unbound;
toggle-overview = [ "<Super>p" ];
};
"org/gnome/terminal/legacy" = {
menu-accelerator-enabled = false;
mnemonics-enabled = true;
new-terminal-mode = "window";
shortcuts-enabled = true;
theme-variant = "dark";
};
"org/gnome/terminal/legacy/keybindings" = {
zoom-in = "<Primary>equal";
};
}
// (
with builtins;
foldl' (a: b: a // b) { } (
map (i: {
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom${toString (i - 1)}" =
elemAt custom-keys
(i - 1);
}) (genList (x: x + 1) (length custom-keys))
)
);
};
}

View file

@ -1,180 +0,0 @@
{ config, pkgs, ... }:
{
programs.jujutsu = {
enable = true;
# package = pkgs.custom.jujutsu;
settings = {
user = {
email = config.programs.git.settings.user.email;
name = config.programs.git.settings.user.name;
};
ui = {
paginate = "never";
# pager = "${pkgs.delta}/bin/delta";
# for delta
# diff-formatter = ":git";
diff-formatter = [
"${pkgs.difftastic}/bin/difft"
"--color=always"
"$left"
"$right"
];
default-command = [
"log"
"--reversed"
"--no-pager"
];
merge-editor = [
"${pkgs.meld}/bin/meld"
"$left"
"$base"
"$right"
"-o"
"$output"
"--auto-merge"
];
# diff-editor = "${pkgs.meld}/bin/meld";
};
fsmonitor.backend = "watchman";
fsmonitor.watchman.register-snapshot-trigger = true;
# revsets.log = "@ | ancestors(trunk()..(visible_heads() & mine()), 2) | trunk()";
# revsets.log = "trunk()..@ | @..trunk() | trunk() | @:: | fork_point(trunk() | @)";
revsets.log = "trunk() | ancestors(trunk()..heads(((trunk()..visible_heads()) & my() | @)::), 2)";
revset-aliases = {
"my()" = "user(\"${config.programs.jujutsu.settings.user.email}\")";
"user(x)" = "author(x) | committer(x)";
current = "bookmarks() & my() & ~immutable()";
"closest_bookmark(to)" = "heads(::to & bookmarks())";
};
template-aliases = {
"format_timestamp(timestamp)" = "timestamp.ago()";
log_oneline = ''
if(root,
format_root_commit(self),
label(if(current_working_copy, "working_copy"),
concat(
separate(" ",
format_short_change_id_with_change_offset(self),
if(empty, label("empty", "(empty)")),
if(description,
description.first_line(),
label(if(empty, "empty"), description_placeholder),
),
bookmarks,
tags,
working_copies,
if(conflict, label("conflict", "conflict")),
if(config("ui.show-cryptographic-signatures").as_boolean(),
format_short_cryptographic_signature(signature)),
) ++ "\n",
),
)
)
'';
# if(.contained_in('first_parent(@)'), label("git_head", "HEAD")),
status_summary = "'\n' ++ self.diff().summary() ++ '\n'";
log_oneline_with_status_summary = "log_oneline ++ if(self.current_working_copy() && self.diff().files().len() > 0, status_summary)";
};
aliases =
let
util = script: [
"util"
"exec"
"--"
"bash"
"-c"
script
];
in
{
tug = [
"bookmark"
"move"
"--from"
"heads(::@- & bookmarks())"
"--to"
"coalesce(@ & ~empty(), @-)"
];
catchup = [
"rebase"
"-b"
"bookmarks() & mine() & ~immutable()"
"-d"
"trunk()"
"--skip-emptied"
];
pull = util ''
jj git fetch
jj catchup
'';
ch = [
"show"
"--stat"
];
move = [
"rebase"
"-r"
];
push = [
"git"
"push"
];
ll = [
"log"
"-T"
"builtin_log_compact"
];
mdiff = [
"diff"
"--from"
"trunk()"
];
};
templates = {
log_node = ''
label("node",
coalesce(
if(!self, label("elided", "~")),
if(current_working_copy, label("working_copy", "@")),
if(conflict, label("conflict", "×")),
if(immutable, label("immutable", "*")),
label("normal", "·")
)
)
'';
log = "log_oneline_with_status_summary";
git_push_bookmark = ''"jdonszelmann/" ++ change_id.short()'';
};
signing = {
# sign-all = true;
behavior = "own";
backend = "ssh";
key = "~/.ssh/id_ed25519.pub";
};
# remotes.origin.auto-track-bookmarks = true;
# remotes.upstream.auto-track-bookmarks = true;
git = {
private-commits = "description(glob:'wip:*') | description(glob:'trial:*')";
write-change-id-header = true;
fetch = [
"upstream"
"origin"
];
push = "origin";
};
};
};
}

View file

@ -1,104 +0,0 @@
{ pkgs, config, ... }:
let
kanata-config = ''
(defcfg
process-unmapped-keys yes
danger-enable-cmd yes
)
(defsrc
esc
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ] \
caps a s d f g h j k l ; ' ret
lsft z x c v b n m , . / rsft
lctl lmet lalt spc ralt rctl
)
(deflayer qwerty
@esc
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ] \
@cap a s d f g h j k l ; ' ret
lsft z x c v b n m , . / rsft
lctl @lmet lalt spc ralt @rctl
)
(deflayer control
@esc
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e @replay t y u i o p @wup @wdown \
@cap a s d f g left down up right ; ' bspc
lsft z x C-c v bspc n @macro , . C-f rsft
lctl lmet lalt spc ralt @rctl
)
(deflayermap (programming)
f (macro f n spc)
w (macro w h e r e spc)
l (macro l o o p { ret)
u (macro u s e spc)
i (macro i m p o r t spc)
s (macro s e l f spc)
)
(defalias
;; hold esc
esc (tap-hold 800 800 esc caps)
;; control
cap (tap-hold-release 200 200
(multi dynamic-macro-record-stop esc)
(layer-while-held control)
)
lmet (
tap-hold-press 200 200
(cmd ${pkgs.lib.getExe' pkgs.custom.niri "niri"} msg action toggle-overview)
lmet
)
macro (dynamic-macro-record 0)
replay (dynamic-macro-play 0)
wup (mwheel-up 50 120)
wdown (mwheel-down 50 120)
;; programming
rctl (
tap-hold-release
200 200
C-k (layer-while-held programming)
)
)
'';
in
{
# sudo groupadd uinput
# sudo usermod -aG input $USER
# sudo usermod -aG uinput $USER
# echo "KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput"" >> /etc/udev/rules.d/99-input.rules
# reboot or sudo udevadm control --reload-rules && sudo udevadm trigger
# sudo modprobe uinput
systemd.user.services.kanata = {
Unit = {
Description = "kanata";
};
Service = {
Restart = "always";
RestartSec = "3";
ExecStart = "${pkgs.kanata-with-cmd}/bin/kanata --cfg ${pkgs.writeText "kanata.kbd" kanata-config}";
Nice = "-20";
};
Install = {
WantedBy = [ "default.target" ];
};
};
home.file.kanata = {
target = ".config/kanata/kanata.kbd";
text = builtins.readFile ./cfg.kbd;
};
}

View file

@ -1,19 +0,0 @@
{ pkgs, ... }:
{
# sudo groupadd uinput
# sudo usermod -aG input $USER
# sudo usermod -aG uinput $USER
# echo "KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput"" >> /etc/udev/rules.d/99-input.rules
# reboot or sudo udevadm control --reload-rules && sudo udevadm trigger
# sudo modprobe uinput
users.groups.uinput = { };
users.extraUsers.jana.extraGroups = [
"uinput"
"input"
];
environment.systemPackages = [ pkgs.kanata-with-cmd ];
services.udev.extraRules = ''
KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput"
'';
}

View file

@ -1,53 +0,0 @@
{ pkgs, flakes, ... }:
{
programs.kitty = {
enable = true;
font = {
name = "Jetbrains Mono";
size = 13.0;
package = pkgs.jetbrains-mono;
};
settings = {
scrollback_lines = 20000;
allow_hyperlinks = true;
repaint_delay = 10;
input_delay = 3;
enable_audio_bell = false;
update_check_interval = 0;
initial_window_width = "95c";
initial_window_height = "30c";
remember_window_size = "no";
draw_minimal_borders = false;
hide_window_decorations = true;
shell = "${pkgs.tmux}/bin/tmux";
clipboard_control = "write-clipboard write-primary read-clipboard read-primary";
foreground = "#fcfcfc";
background = "#232627";
linux_display_server = "auto";
};
keybindings = {
"ctrl+f" =
"launch --location=hsplit --allow-remote-control kitty +kitten ${flakes.kitty-search}/search.py @active-kitty-window-id";
"ctrl+alt+r" = "load_config_file";
"ctrl+shift+r" = "no_op";
"super+`" = "no_op";
"ctrl+EQUAL" = "change_font_size all +2.0";
"ctrl+minus" = "change_font_size all -2.0";
"ctrl+0" = "change_font_size all 0";
# "ctrl+/" = "send_text all ";
"super+~" = "no_op";
};
extraConfig = ''
mouse_map left click ungrabbed no-op
'';
};
}

View file

@ -1,558 +0,0 @@
{
config,
pkgs,
flakes,
lib,
...
}:
let
noctalia =
cmd:
[
"${pkgs.lib.getExe' flakes.noctalia.packages.${pkgs.system}.default "noctalia-shell"}"
"ipc"
"call"
]
++ (pkgs.lib.splitString " " cmd);
wallpaper = ("${pkgs.custom.raw-data}/pacific.png");
matugenSchemeType = "scheme-tonal-spot";
in
{
home.packages = with pkgs; [
matugen
glib
dconf
gsettings-desktop-schemas
xwayland-satellite
# gtk
nwg-look
# qt config tool
kdePackages.qt6ct
fira
jetbrains-mono
fira-mono
noto-fonts
];
home.sessionVariables = {
QT_QPA_PLATFORMTHEME = "qt6ct";
XCURSOR_THEME = "Adwaita";
XCURSOR_SIZE = "10";
};
programs.niri.settings = {
input = {
keyboard = {
xkb = {
layout = "us";
options = "grp:win_space_toggle,compose:ralt";
};
numlock = true;
};
mouse = {
accel-speed = 0.5;
};
touchpad = {
dwt = true;
tap = true;
tap-button-map = "left-right-middle";
click-method = "clickfinger";
natural-scroll = false;
};
};
debug = {
render-drm-device = "/dev/dri/renderD128";
};
cursor = {
theme = "Adwaita";
size = 10;
};
gestures.hot-corners.enable = false;
layout = {
gaps = 5;
center-focused-column = "never";
preset-column-widths = [
{ proportion = 0.33333; }
{ proportion = 0.5; }
{ proportion = 0.66667; }
{ proportion = 1.0; }
];
default-column-width = {
proportion = 0.5;
};
shadow = {
softness = 20;
spread = 5;
offset = {
x = 0;
y = 5;
};
};
focus-ring = {
width = 1;
active.color = "#${config.programs.matugen.theme.colors.primary.default}";
inactive.color = "#${config.programs.matugen.theme.colors.surface.default}";
urgent.color = "#${config.programs.matugen.theme.colors.error.default}";
};
border = {
active.color = "#${config.programs.matugen.theme.colors.primary.default}";
inactive.color = "#${config.programs.matugen.theme.colors.surface.default}";
urgent.color = "#${config.programs.matugen.theme.colors.error.default}";
};
shadow = {
color = "#${config.programs.matugen.theme.colors.shadow.default}70";
};
tab-indicator = {
active.color = "#${config.programs.matugen.theme.colors.primary.default}";
inactive.color = "#${config.programs.matugen.theme.colors.primary_container.default}";
urgent.color = "#${config.programs.matugen.theme.colors.error.default}";
};
insert-hint = {
display.color = "#${config.programs.matugen.theme.colors.primary.default}80";
};
};
hotkey-overlay.skip-at-startup = true;
screenshot-path = "~/Documents/personal/pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png";
workspaces."01-browser" = {
name = "browser";
};
workspaces."02-programming" = {
name = "programming";
};
workspaces."03-chat" = {
name = "chat";
};
window-rules = [
{
matches = [ { title = "Extension: (Bitwarden Password Manager).*"; } ];
open-floating = true;
open-focused = true;
block-out-from = "screen-capture";
}
{
matches = [ { app-id = "firefox"; } ];
open-on-workspace = "browser";
}
{
matches = [
{
app-id = "org.gnome.Nautilus";
title = "Open Files";
}
{
app-id = "steam";
title = "Steam Settings";
}
];
open-floating = true;
}
{
matches = [
{ app-id = "discord"; }
{ app-id = "org.element.desktop"; } # TODO
{ app-id = "signal"; } # TODO
];
open-on-workspace = "chat";
}
{
matches = [
{ app-id = "dev.zed.Zed"; }
];
open-on-workspace = "programming";
}
{
geometry-corner-radius = {
top-left = 8.0;
top-right = 8.0;
bottom-right = 8.0;
bottom-left = 8.0;
};
clip-to-geometry = true;
}
];
spawn-at-startup = [
{ argv = [ "firefox" ]; }
{ argv = [ "discord" ]; }
{ argv = [ "signal-desktop" ]; }
{ argv = [ "zeditor" ]; }
{
argv = [ "${pkgs.lib.getExe' flakes.noctalia.packages.${pkgs.system}.default "noctalia-shell"}" ];
}
];
animations = { };
binds = {
"Ctrl+Alt+Delete" = {
hotkey-overlay.title = "Power menu";
action.spawn = noctalia "sessionMenu toggle";
};
"Mod+O" = {
hotkey-overlay.title = "Run an Application";
action.spawn = noctalia "launcher toggle";
};
"Mod+L" = {
hotkey-overlay.title = "Lock the Screen";
action.spawn = noctalia "lockScreen lock";
};
"Mod+Shift+Slash".action.show-hotkey-overlay = { };
"Mod+Return" = {
hotkey-overlay.title = "Open a Terminal";
action.spawn = "kitty";
};
"XF86AudioRaiseVolume" = {
allow-when-locked = true;
action.spawn-sh = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+";
};
"XF86AudioLowerVolume" = {
allow-when-locked = true;
action.spawn-sh = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-";
};
"XF86AudioMute" = {
allow-when-locked = true;
action.spawn-sh = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
};
"XF86AudioMicMute" = {
allow-when-locked = true;
action.spawn-sh = "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
};
"XF86AudioPlay" = {
allow-when-locked = true;
action.spawn-sh = "playerctl play-pause";
};
"XF86AudioStop" = {
allow-when-locked = true;
action.spawn-sh = "playerctl stop";
};
"XF86AudioPrev" = {
allow-when-locked = true;
action.spawn-sh = "playerctl previous";
};
"XF86AudioNext" = {
allow-when-locked = true;
action.spawn-sh = "playerctl next";
};
"Mod+Period" = {
allow-when-locked = true;
action.spawn-sh = "playerctl previous";
};
"Mod+Comma" = {
allow-when-locked = true;
action.spawn-sh = "playerctl next";
};
"Mod+Slash" = {
allow-when-locked = true;
action.spawn-sh = "playerctl next";
};
# TODO
"XF86MonBrightnessUp" = {
allow-when-locked = true;
action.spawn = [
"brightnessctl"
"--device=amdgpu_bl1"
"--class=backlight"
"set"
"+10%"
];
};
"XF86MonBrightnessDown" = {
allow-when-locked = true;
action.spawn = [
"brightnessctl"
"--device=amdgpu_bl1"
"--class=backlight"
"set"
"10%-"
];
};
"Mod+Q" = {
repeat = false;
action.close-window = { };
};
"Mod+Left".action.focus-column-left = { };
"Mod+Down".action.focus-window-or-workspace-down = { };
"Mod+Up".action.focus-window-or-workspace-up = { };
"Mod+Right".action.focus-column-right = { };
"Mod+Shift+Left".action.move-column-left = { };
"Mod+Shift+Down".action.move-window-down-or-to-workspace-down = { };
"Mod+Shift+Up".action.move-window-up-or-to-workspace-up = { };
"Mod+Shift+Right".action.move-column-right = { };
"Mod+Home".action.focus-column-first = { };
"Mod+End".action.focus-column-last = { };
"Mod+Shift+Home".action.move-column-to-first = { };
"Mod+Shift+End".action.move-column-to-last = { };
"Mod+Ctrl+Left".action.focus-monitor-left = { };
"Mod+Ctrl+Down".action.focus-monitor-down = { };
"Mod+Ctrl+Up".action.focus-monitor-up = { };
"Mod+Ctrl+Right".action.focus-monitor-right = { };
"Mod+Shift+Ctrl+Left".action.move-column-to-monitor-left = { };
"Mod+Shift+Ctrl+Down".action.move-column-to-monitor-down = { };
"Mod+Shift+Ctrl+Up".action.move-column-to-monitor-up = { };
"Mod+Shift+Ctrl+Right".action.move-column-to-monitor-right = { };
"Mod+1".action.focus-workspace = 1;
"Mod+2".action.focus-workspace = 2;
"Mod+3".action.focus-workspace = 3;
"Mod+4".action.focus-workspace = 4;
"Mod+5".action.focus-workspace = 5;
"Mod+6".action.focus-workspace = 6;
"Mod+7".action.focus-workspace = 7;
"Mod+8".action.focus-workspace = 8;
"Mod+9".action.focus-workspace = 9;
"Mod+Shift+1".action.move-column-to-workspace = 1;
"Mod+Shift+2".action.move-column-to-workspace = 2;
"Mod+Shift+3".action.move-column-to-workspace = 3;
"Mod+Shift+4".action.move-column-to-workspace = 4;
"Mod+Shift+5".action.move-column-to-workspace = 5;
"Mod+Shift+6".action.move-column-to-workspace = 6;
"Mod+Shift+7".action.move-column-to-workspace = 7;
"Mod+Shift+8".action.move-column-to-workspace = 8;
"Mod+Shift+9".action.move-column-to-workspace = 9;
"Mod+WheelScrollDown" = {
cooldown-ms = 150;
action.focus-workspace-down = { };
};
"Mod+WheelScrollUp" = {
cooldown-ms = 150;
action.focus-workspace-up = { };
};
"Mod+Shift+WheelScrollDown" = {
cooldown-ms = 150;
action.move-column-to-workspace-down = { };
};
"Mod+Shift+WheelScrollUp" = {
cooldown-ms = 150;
action.move-column-to-workspace-up = { };
};
"Mod+WheelScrollRight".action.focus-column-right = { };
"Mod+WheelScrollLeft".action.focus-column-left = { };
"Mod+Shift+WheelScrollRight".action.move-column-right = { };
"Mod+Shift+WheelScrollLeft".action.move-column-left = { };
"Mod+BracketLeft".action.consume-or-expel-window-left = { };
"Mod+BracketRight".action.consume-or-expel-window-right = { };
"Mod+Shift+BracketLeft".action.consume-window-into-column = { };
"Mod+Shift+BracketRight".action.expel-window-from-column = { };
"Mod+R".action.switch-preset-column-width = { };
"Mod+Shift+R".action.switch-preset-window-height = { };
"Mod+Ctrl+R".action.reset-window-height = { };
"Mod+D".action.maximize-column = { };
"Mod+F".action.fullscreen-window = { };
"Mod+S".action.expand-column-to-available-width = { };
"Mod+C".action.center-column = { };
"Mod+Shift+C".action.center-visible-columns = { };
"Mod+Minus".action.set-column-width = "-10%";
"Mod+Equal".action.set-column-width = "+10%";
"Mod+Shift+Minus".action.set-window-height = "-10%";
"Mod+Shift+Equal".action.set-window-height = "+10%";
"Mod+E".action.toggle-window-floating = { };
"Mod+Shift+E".action.switch-focus-between-floating-and-tiling = { };
"Mod+W".action.toggle-column-tabbed-display = { };
"Mod+Shift+S".action.screenshot = { };
"Mod+Escape" = {
allow-inhibiting = false;
action.toggle-keyboard-shortcuts-inhibit = { };
};
"Mod+Shift+P".action.power-off-monitors = { };
};
};
programs.noctalia-shell = {
enable = true;
systemd.enable = false;
settings = {
general = {
# avatarImage = cfg.pfp;
};
colorSchemes = {
darkMode = true;
generateTemplatesForPredefined = true;
inherit matugenSchemeType;
predefinedScheme = "Noctalia (default)";
useWallpaperColors = true;
};
location = {
monthBeforeDay = false;
name = "Amsterdam";
};
wallpaper = {
enabled = true;
setWallpaperOnAllMonitors = true;
fillMode = "crop";
};
appLauncher = {
enableClipboardHistory = true;
terminalCommand = "kitty -e";
};
sessionMenu = {
enableCountdown = true;
countdownDuration = 5000;
};
controlCenter = {
position = "close_to_bar_button";
shortcuts = {
left = [
{
id = "WiFi";
}
{
id = "Bluetooth";
}
{
id = "PowerProfile";
}
{
id = "KeepAwake";
}
];
right = [ ];
};
};
bar = {
density = "compact";
position = "right";
backgroundOpacity = 0.5;
widgets = {
left = [
{
id = "ControlCenter";
useDistroLogo = true;
}
{
id = "NotificationHistory";
}
{
id = "plugin:catwalk";
}
];
center = [
{
hideUnoccupied = false;
id = "Workspace";
labelMode = "none";
}
];
right = [
{
id = "Tray";
drawerEnabled = false;
}
{
id = "WiFi";
}
{
id = "Bluetooth";
}
]
++ [ { id = "Battery"; } ]
++ [
{
id = "KeyboardLayout";
displayMode = "forceOpen";
}
{
formatHorizontal = "HH:mm";
formatVertical = "HH mm";
id = "Clock";
useMonospacedFont = true;
usePrimaryColor = true;
}
];
};
};
templates = {
gtk = true;
qt = true;
niri = true;
};
};
};
home.file.".cache/noctalia/wallpapers.json" = {
text = builtins.toJSON {
defaultWallpaper = wallpaper;
};
};
home.activation.themeFiles = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
mkdir -p ${config.xdg.configHome}/gtk-4.0
mkdir -p ${config.xdg.configHome}/gtk-3.0
mkdir -p ${config.xdg.configHome}/qt5ct/colors
mkdir -p ${config.xdg.configHome}/qt6ct/colors
touch ${config.xdg.configHome}/gtk-4.0/gtk.css
touch ${config.xdg.configHome}/gtk-3.0/gtk.css
touch ${config.xdg.configHome}/qt5ct/colors/noctalia.conf
touch ${config.xdg.configHome}/qt6ct/colors/noctalia.conf
'';
programs.matugen = {
enable = true;
wallpaper = wallpaper;
type = matugenSchemeType;
};
gtk.cursorTheme = {
package = pkgs.adwaita-icon-theme;
name = "Adwaita";
size = 24;
};
dconf.settings = {
# appearance
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
enable-hot-corners = false;
gtk-enable-primary-paste = false;
};
};
}

View file

@ -1,248 +0,0 @@
vim.o.sessionoptions="blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
vim.filetype.add({
extension = {
mdx = "markdown",
}
})
-- key mapping
local keymap = vim.api.nvim_set_keymap
local opts = { noremap = true, silent = true }
local builtin = require('telescope.builtin')
-- comment
local esc = vim.api.nvim_replace_termcodes(
'<ESC>', true, false, true
)
local api = require('Comment.api')
vim.keymap.set("n", "<C-_>", ":lua require('Comment.api').toggle.linewise.current()<CR> j", { remap = true })
vim.keymap.set("i", "<C-_>", "<c-o>:lua require('Comment.api').toggle.linewise.current()<CR>", { remap = true })
vim.keymap.set("x", "<C-_>", function()
vim.api.nvim_feedkeys(esc, 'nx', false)
api.toggle.linewise(vim.fn.visualmode())
end, { remap = true })
vim.keymap.set('n', 'gr', (function() builtin.lsp_references({jump_type="vsplit"}) end), {})
vim.keymap.set('n', 'gd', (function() builtin.lsp_definitions({jump_type="vsplit"}) end), {})
vim.keymap.set('n', 'gt', (function() builtin.lsp_type_definitions({jump_type="vsplit"}) end), {})
local barbar_state = require("barbar.state")
function find_windows_with_buffer(bufnum)
windows = {}
local window_list = vim.api.nvim_list_wins()
for _, window in ipairs(window_list) do
local win_info = vim.fn.getwininfo(window)
if win_info ~= nil then
for _, buf in ipairs(win_info) do
if buf.bufnr == bufnum then
table.insert(windows, window)
end
end
end
end
return windows
end
function num_useful_windows()
local window_list = vim.api.nvim_tabpage_list_wins(0)
local num = 0
for _, window in ipairs(window_list) do
local win_info = vim.fn.getwininfo(window)
if win_info ~= nil then
for _, win_info in ipairs(win_info) do
if buf_is_useful(win_info.bufnr) then
num = num + 1
end
end
end
end
return num
end
function buf_is_useful(bufnr)
local bufname = vim.api.nvim_buf_get_name(bufnr)
-- if the window's buffer has no name, it's not useful
if bufname == '' then
return false
end
-- print("bufname: ", bufname)
-- if the window's buffer is read only, it's not useful
local readonly = vim.api.nvim_buf_get_option(bufnr, 'readonly')
if readonly then
-- print("=readonly")
return false
end
-- -- if the buffer is not listed, it's not useful
local listed = vim.api.nvim_buf_get_option(bufnr, 'buflisted')
if not listed then
-- print("=unlisted")
return false
end
local buftype = vim.api.nvim_buf_get_option(bufnr, 'buftype')
if buftype == "quickfix" then
-- print("=readonly")
return false
end
local lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false)
if #lines > 1 or (#lines == 1 and #lines[1] > 0) then
return true -- If the buffer has content, return false
else
return false
end
-- the window contains a useful buffer
return true
end
function quit_window(window)
vim.api.nvim_win_call(window, function()
vim.cmd "quit"
end)
end
vim.api.nvim_create_user_command('CloseBuffer', function (opts)
if num_useful_windows() > 1 then
vim.cmd {
cmd = "quit",
bang = opts.bang,
}
else
vim.cmd {
cmd = "BufferDelete",
bang = opts.bang,
}
if not buf_is_useful(vim.api.nvim_get_current_buf()) then
vim.cmd {
cmd = "quit",
bang = opts.bang,
}
end
end
end, { desc = "Close Current Buffer", bang = true, })
local function close_floating()
for _, win in ipairs(vim.api.nvim_list_wins()) do
local config = vim.api.nvim_win_get_config(win)
if config.relative ~= "" then
vim.api.nvim_win_close(win, false)
end
end
end
vim.keymap.set("n", "<Esc>", close_floating, { desc = "Close floats, clear highlights" })
local builtin = require('telescope.builtin')
vim.keymap.set("n", "<leader>x", require("telescope.builtin").resume, {
noremap = true,
silent = true,
desc = "Resume",
})
-- local gitsigns = require('gitsigns')
-- vim.keymap.set('n', '<leader>gr', gitsigns.reset_hunk)
-- vim.keymap.set('n', '<leader>gd', gitsigns.diffthis)
-- vim.keymap.set({'o', 'x'}, 'ig', ':<C-U>Gitsigns select_hunk<CR>')
-- better search
vim.cmd([[
" Better search
set incsearch
set ignorecase
set smartcase
set gdefault
nnoremap <silent> n n:call BlinkNextMatch()<CR>
nnoremap <silent> N N:call BlinkNextMatch()<CR>
function! BlinkNextMatch() abort
highlight JustMatched ctermfg=white ctermbg=magenta cterm=bold
let pat = '\c\%#' . @/
let id = matchadd('JustMatched', pat)
redraw
exec 'sleep 150m'
call matchdelete(id)
redraw
endfunction
nnoremap <silent> <Space> :silent noh<Bar>echo<CR>
nnoremap <silent> <Esc> :silent noh<Bar>echo<CR>
nnoremap <silent> n nzz
nnoremap <silent> N Nzz
nnoremap <silent> * *zz
nnoremap <silent> # #zz
nnoremap <silent> g* g*zz
]])
vim.cmd([[
inoremap <silent> <F1> <CMD>FloatermToggle<CR>
nnoremap <silent> <F1> <CMD>FloatermToggle<CR>
tnoremap <silent> <F1> <C-\><C-n><CMD>FloatermToggle<CR>
]])
vim.cmd([[
let g:suda_smart_edit = 1
filetype plugin indent on
]])
-- multicursor
vim.g.VM_default_mappings = 1
vim.g.VM_reselect_first = 1
vim.g.VM_notify_previously_selected = 1
vim.g.VM_theme = "iceblue"
-- workaround for rust-analyzer server cancelled request
for _, method in ipairs { 'textDocument/diagnostic', 'workspace/diagnostic' } do
local default_diagnostic_handler = vim.lsp.handlers[method]
vim.lsp.handlers[method] = function(err, result, context, config)
if err ~= nil and err.code == -32802 then
return
end
return default_diagnostic_handler(err, result, context, config)
end
end
require("hover").setup {
init = function()
require("hover.providers.lsp")
require('hover.providers.gh')
require('hover.providers.diagnostic')
end,
preview_opts = {
border = 'rounded'
},
-- Whether the contents of a currently open hover window should be moved
-- to a :h preview-window when pressing the hover keymap.
preview_window = false,
title = true,
}
-- Setup keymaps
vim.keymap.set("n", "K", require("hover").hover, {desc = "hover.nvim"})
vim.keymap.set("n", "gK", require("hover").hover_select, {desc = "hover.nvim (select)"})
-- vim.keymap.set("n", "<C-p>", function() require("hover").hover_switch("previous") end, {desc = "hover.nvim (previous source)"})
-- vim.keymap.set("n", "<C-n>", function() require("hover").hover_switch("next") end, {desc = "hover.nvim (next source)"})

View file

@ -1,99 +0,0 @@
{ pkgs, inputs, ... }:
{
home = {
sessionVariables = {
EDITOR = "nvim";
};
};
imports = [
./options.nix
./plugins.nix
./keys.nix
];
programs.nixvim = {
enable = true;
globals.mapleader = " ";
globals.maplocalleader = " ";
viAlias = true;
vimAlias = true;
# Highlight and remove extra white spaces
# same color as cursorline as per
# https://github.com/joshdick/onedark.vim/blob/390b893d361c356ac1b00778d849815f2aa44ae4/autoload/onedark.vim
highlight.ExtraWhitespace.bg = "#2C323C";
match.ExtraWhitespace = "\\s\\+$";
clipboard.providers.wl-copy.enable = true;
performance = {
byteCompileLua.enable = true;
combinePlugins = {
enable = true;
standalonePlugins = [
# clashes with lualine
"onedark.nvim"
];
};
};
extraLuaPackages = ps: [ ps.magick ];
extraPackages = [ pkgs.imagemagick ];
# package = (import inputs.unstable { inherit (pkgs) system; }).neovim-unwrapped;
package = pkgs.neovim-unwrapped;
colorschemes.onedark = {
enable = true;
settings = {
style = "deep";
highlights = {
# bright green doccomments
"@lsp.type.comment".fg = "#77B767";
"@comment.documentation.rust".fg = "#77B767";
"@comment.documentation".fg = "#77B767";
"@comment".fg = "#426639";
# "Visual".bg = "#2a2e36";
# "Cursorline".bg = "#2a2e36";
};
};
};
extraConfigLuaPre = ''
require("neoconf").setup({})
'';
extraConfigLua =
''
require("render-markdown").setup {
latex_converter = '${pkgs.python312Packages.pylatexenc}/bin/latex2text',
}
''
# local lspconfig = require 'lspconfig'
# local configs = require 'lspconfig.configs'
# if not configs.foo_lsp then
# configs.noteslsp = {
# default_config = {
# -- cmd = {'${pkgs.custom.noteslsp}/bin/noteslsp'},
# cmd = {'./noteslsp/target/debug/noteslsp'},
# filetypes = {'markdown'},
# root_dir = function(fname)
# return lspconfig.util.find_git_ancestor(fname)
# end,
# settings = {}
# ,
# },
# }
# end
#
# lspconfig.noteslsp.setup{}
# ''
+ (builtins.readFile ./config.lua);
};
}

View file

@ -1,103 +0,0 @@
_:
let
map = mode: key: action: {
inherit mode key action;
};
luamap =
mode: key: action:
map mode key "<cmd>lua ${action}<cr>";
telescope = "require('telescope.builtin')";
in
{
programs.nixvim.keymaps = [
(map "" "<f2>" "<cmd>Lspsaga rename<cr>")
(map "" "<leader>o" "<cmd>Lspsaga outline<cr>")
(map "" "<leader>." "<cmd>Lspsaga code_action<cr>")
# splitting
(map "n" "<leader>s" "<cmd>vertical sb<cr>")
# closing
(map "n" "<leader>w" "<cmd>BufferClose<cr>") # single buffer
(map "n" "<leader>cb" "<cmd>BufferClose<cr>") # single buffer
(map "n" "<leader>ct" "<cmd>CloseBuffer<cr>") # buffer or extra tab
(map "n" "<leader>q" "<cmd>CloseBuffer<cr>") # buffer or extra tab
(map "n" "<leader>co" "<cmd>silent! BufferCloseAllButVisible<cr>") # other buffers
(map "n" "<leader>cl" "<cmd>silent! BufferCloseBuffersLeft<cr>") # other buffers (left)
(map "n" "<leader>cr" "<cmd>silent! BufferCloseBuffersRight<cr>") # other buffers (right)
# moving
(map "n" "mL" "<cmd>BufferMovePrevious<cr>") # left
(map "n" "mr" "<cmd>BufferMoveNext<cr>") # right
(map "n" "m0" "<cmd>BufferMoveStart<cr>") # start
(map "n" "m$" "<cmd>BufferMoveEnd<cr>") # end
(map "n" "<leader>jb" "<cmd>BufferPick<cr>") # jump to tab
# jumplist
# (map "n" "<leader><Tab>" "<C-o>")
# (map "n" "<leader><S-Tab>" "<C-i>")
(luamap "n" "<leader>r" "${telescope}.jumplist()")
# pickers
(luamap "n" "<leader><leader>" "${telescope}.find_files()")
(luamap "n" "<leader>f" "${telescope}.live_grep()")
(luamap "n" "<leader>t" "${telescope}.lsp_document_symbols()")
(luamap "n" "<leader>T" "${telescope}.lsp_dynamic_workspace_symbols()")
# last used pickers/searches
(luamap "n" "<leader>h" "${telescope}.pickers()")
# open buffers
(luamap "n" "<leader>b" "${telescope}.buffers({sort_mru = true})")
# diagnostics
(map "n" "<leader>d" "<cmd>Trouble diagnostics toggle filter.buf=0<cr>")
(map "n" "<leader>ad" "<cmd>Trouble diagnostics toggle<cr>")
(luamap "n" "]d"
"vim.diagnostic.goto_next({ severity = vim.diagnostic.severity.ERROR, wrap=true })"
)
(luamap "n" "[d"
"vim.diagnostic.goto_prev({ severity = vim.diagnostic.severity.ERROR, wrap=true })"
)
(luamap "n" "]w" "vim.diagnostic.goto_next({ wrap=true })")
(luamap "n" "[w" "vim.diagnostic.goto_prev({ wrap=true })")
# docs with control-d just like in autocomplete
(map "n" "<C-d>" "K")
# expand macro
(map "n" "<leader>em" "<cmd>RustLsp expandMacro<cr>")
# easier quitting etc
(map "ca" "W" "w")
(map "ca" "X" "x")
(map "ca" "Q" "CloseBuffer")
(map "ca" "q" "CloseBuffer")
# navigation
(map "" "<leader><Left>" "<C-w><Left>")
(map "" "<leader><Right>" "<C-w><Right>")
(map "" "<leader><Up>" "<C-w><Up>")
(map "" "<leader><Down>" "<C-w><Down>")
(map "" "<leader><Down>" "<C-w><Down>")
# {
# key = "/";
# action = "<cmd>lua require('spectre').open_file_search({select_word=true})<CR>";
# }
(map "n" "t" "<cmd>Neotree toggle<cr>")
# tab for indent/dedent
(map "n" "<tab>" ">>_")
(map "n" "<S-tab>" "<<_")
(map "i" "<S-tab>" "<c-d>")
(map "v" "<tab>" ">gv")
(map "v" "<S-tab>" "<gv")
# to avoid many typos
(map "n" ";" ":")
];
}

View file

@ -1,88 +0,0 @@
_: {
programs.nixvim.diagnostics = {
# virtual_lines.enable = false;
# # virtual_lines = {
# # current_line = true;
# # format = ''
# # function(d)
# # if d.severity == vim.diagnostic.severity.ERROR then
# # return d
# # else
# # return ""
# # end
# # end
# # '';
# # };
# virtual_text = false;
update_in_insert = false; # annoying with virtual_lines which keep updating
severity_sort = true;
float = {
border = "rounded";
};
};
programs.nixvim.opts = {
# lazyredraw = true;
startofline = true;
showmatch = true;
belloff = "all";
showcmd = true;
mouse = "a";
modeline = true;
wrap = false;
spell = false;
# don't change the directory when a file is opened
# to work more like an IDE
autochdir = false;
autoindent = true;
smartindent = true;
smarttab = true;
backspace = [
"indent"
"eol"
"start"
];
list = true;
swapfile = false;
backup = false;
autoread = true;
undofile = true;
undodir = "/home/jana/.vimdid";
tabstop = 4;
softtabstop = 4;
shiftwidth = 4;
expandtab = true;
# relative line numbers except the current line
number = true;
# relativenumber = true;
# show (usually) hidden characters
listchars = {
nbsp = "¬";
extends = "»";
precedes = "«";
trail = "·";
tab = ">-";
};
# highlight current line
cursorline = true;
# clipboard == system clipboard
clipboard = "unnamedplus";
completeopt = [
"menuone"
"noselect"
"noinsert"
];
};
}

View file

@ -1,752 +0,0 @@
{ pkgs, ... }:
let
render-markdown = pkgs.vimUtils.buildVimPlugin {
name = "render-markdown";
src = pkgs.fetchFromGitHub {
owner = "MeanderingProgrammer";
repo = "markdown.nvim";
rev = "78ef39530266b3a0736c48b46c3f5d1ab022c7db";
hash = "sha256-mddnBvIrekHh60Ix6qIYAnv10Mu40LamGI47EXk9wSo=";
};
};
in
# fzy-lua-native = pkgs.vimUtils.buildVimPlugin {
# name = "fzy-lua-native";
# src = pkgs.fetchFromGitHub {
# owner = "romgrk";
# repo = "fzy-lua-native";
# rev = "9d720745d5c2fb563c0d86c17d77612a3519c506";
# hash = "sha256-pBV5iGa1+5gtM9BcDk8I5SKoQ9sydOJHsmyoBcxAct0=";
# };
# };
{
programs.nixvim = {
plugins = {
treesitter-textobjects = {
enable = false;
lspInterop.enable = true;
select = {
enable = true;
keymaps = {
"ai" = {
query = "@impl.outer";
};
"ii" = {
query = "@impl.inner";
};
"af" = {
query = "@function.outer";
};
"if" = {
query = "@function.inner";
};
"ac" = {
query = "@conditional.outer";
};
"ic" = {
query = "@conditional.inner";
};
"al" = {
query = "@loop.outer";
};
"il" = {
query = "@loop.inner";
};
};
};
move = {
enable = true;
setJumps = true;
gotoNextStart = {
"]f" = {
query = "@function.outer";
};
"]c" = {
query = "@conditional.outer";
};
"]l" = {
query = "@loop.outer";
};
"]i" = {
query = "@impl.outer";
};
};
gotoNextEnd = {
"]F" = {
query = "@function.outer";
};
"]C" = {
query = "@conditional.outer";
};
"]L" = {
query = "@loop.outer";
};
"]I" = {
query = "@impl.outer";
};
};
gotoPreviousStart = {
"[f" = {
query = "@function.outer";
};
"[c" = {
query = "@conditional.outer";
};
"[l" = {
query = "@loop.outer";
};
"[i" = {
query = "@impl.outer";
};
};
gotoPreviousEnd = {
"[F" = {
query = "@function.outer";
};
"[C" = {
query = "@conditional.outer";
};
"[L" = {
query = "@loop.outer";
};
"[I" = {
query = "@impl.outer";
};
};
};
};
treesitter-context = {
enable = true;
settings = {
multiwindow = true;
separator = "";
max_lines = 4;
trim_scopes = "outer";
};
};
treesitter = {
enable = true;
nixGrammars = false;
nixvimInjections = false;
settings = {
indent.enable = true;
ensure_installed = "all";
ignore_install = [
"wing"
"brightscript"
];
highlight.enable = true;
incremental_selection = {
enable = true;
keymaps = {
scope_incremental = "s";
node_incremental = "+";
node_decremental = "-";
};
};
};
};
rainbow-delimiters.enable = true;
vim-surround.enable = true;
lsp-format.enable = true;
fugitive.enable = true;
lspkind.enable = true;
crates.enable = true;
fidget.enable = true;
nvim-autopairs.enable = true;
# nvim-highlight-colors.enable = true;
cmp = {
enable = true;
autoEnableSources = true;
settings = {
completion.completeopt = "noselect";
preselect = "None";
sources =
let
s = name: { inherit name; };
in
[
{
name = "nvim_lsp";
priority = 8;
}
# (s "nvim_lsp_signature_help")
# (s "treesitter")
(s "path")
(s "luasnip")
# (s "crates")
# (s "git")
# (s "calc")
# (s "buffer")
];
mapping =
let
next = ''
function(fallback)
if cmp.visible() then
cmp.select_next_item()
else
fallback()
end
end
'';
prev = ''
function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end
'';
in
{
"<C-Space>" = "cmp.mapping.complete()";
"<CR>" = "cmp.mapping.confirm({ select = true })";
"<C-d>" = ''
function()
if cmp.visible_docs() then
cmp.close_docs()
else
cmp.open_docs()
end
end
'';
"<Tab>" = next;
"<S-Tab>" = prev;
"<Down>" = next;
"<Up>" = prev;
};
snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end";
sorting.comparators = [
"offset"
"exact"
"score"
"recently_used"
"locality"
"kind"
"length"
"order"
];
window =
let
common_border = {
border = "rounded";
winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:Visual,Search:None";
};
in
{
completion = common_border;
documentation = common_border;
};
};
};
image = {
enable = true;
};
# dial.nvim
which-key = {
enable = true;
};
auto-session = {
enable = true;
settings = {
auto_save_enabled = true;
auto_restore_enabled = true;
pre_save_cmds = [ "Neotree close" ];
post_restore_cmds = [ "Neotree filesystem show" ];
};
};
comment = {
enable = true;
settings = {
sticky = true;
};
};
neo-tree = {
enable = true;
closeIfLastWindow = true;
enableGitStatus = false;
window = {
position = "right";
width = 30;
# mappings = {
# "<bs>" = "navigate_up";
# "." = "set_root";
# "/" = "fuzzy_finder";
# "f" = "filter_on_submit";
# "h" = "show_help";
# };
};
filesystem = {
followCurrentFile.enabled = true;
filteredItems = {
hideHidden = false;
hideDotfiles = false;
forceVisibleInEmptyFolder = true;
hideGitignored = false;
};
};
};
nvim-lightbulb = {
enable = true;
settings = {
autocmd = {
enabled = true;
updatetime = 200;
};
line = {
enabled = true;
};
number = {
enabled = true;
hl = "LightBulbNumber";
};
float = {
enabled = false;
text = "💡";
};
sign = {
enabled = true;
text = "💡";
};
status_text = {
enabled = false;
text = "💡";
};
};
};
git-conflict = {
enable = true;
settings = {
default_mappings = {
both = "<leader>cb";
none = "<leader>c0";
ours = "<leader>co";
prev = "]x";
next = "[x";
theirs = "<leader>ct";
};
disable_diagnostics = false;
highlights = {
current = "DiffText";
incoming = "DiffAdd";
};
list_opener = "conflicts";
};
};
gitsigns = {
enable = true;
settings = {
current_line_blame = true;
current_line_blame_opts = {
virt_text = true;
virt_text_pos = "eol";
};
};
};
lspsaga = {
enable = true;
lightbulb.enable = false;
codeAction.keys = {
quit = "<Esc>";
};
symbolInWinbar.enable = false;
};
typst-vim = {
enable = true;
settings = {
cmd = "${pkgs.typst}/bin/typst";
conceal_math = 1;
auto_close_toc = 1;
};
};
lualine = {
enable = true;
settings.options.theme = "onedark";
};
rustaceanvim = {
enable = true;
settings = {
rustAnalyzerPackage = null;
auto_attach = true;
server = {
standalone = false;
default_settings = {
rust-analyzer = {
inlayHints = {
lifetimeElisionHints.enable = "always";
# expressionAdjustmentHints = {
# enable = "always";
# mode = "prefer_postfix";
# };
discriminantHints.enable = "always";
};
# check = {
# command = "+nightly clippy";
# };
cachePriming.enable = true;
diagnostic = {
refreshSupport = true;
};
};
# cargo = {
# buildScripts.enable = true;
# features = "all";
# runBuildScripts = true;
# loadOutDirsFromCheck = true;
# };
# checkOnSave = true;
# check = {
# allFeatures = true;
# command = "clippy";
# extraArgs = [ "--no-deps" ];
# };
# procMacro = { enable = true; };
# imports = {
# granularity = { group = "module"; };
# prefix = "self";
# };
# files = {
# excludeDirs =
# [ ".cargo" ".direnv" ".git" "node_modules" "target" ];
# };
#
# inlayHints = {
# bindingModeHints.enable = true;
# closureStyle = "rust_analyzer";
# closureReturnTypeHints.enable = "always";
# discriminantHints.enable = "always";
# expressionAdjustmentHints.enable = "always";
# implicitDrops.enable = true;
# lifetimeElisionHints.enable = "always";
# rangeExclusiveHints.enable = true;
# reborrowHints.enable = "mutable";
# };
#
# rustc.source = "discover";
#
options.diagnostics = {
enable = true;
styleLints.enable = true;
};
};
};
};
};
lsp = {
enable = true;
servers = {
astro.enable = true;
cssls.enable = true;
nil_ls = {
enable = true;
settings = {
formatting.command = [ "${(pkgs.lib.getExe pkgs.nixfmt-rfc-style)}" ];
};
extraOptions = {
nix = {
maxMemoryMB = 0;
flake = {
autoArchive = true;
autoEvalInputs = true;
nixpkgsInputName = "nixpkgs";
};
};
};
};
clangd = {
enable = true;
filetypes = [
"c"
"cpp"
"objc"
"objcpp"
];
};
eslint = {
enable = true;
filetypes = [
"javascript"
"javascriptreact"
"typescript"
"typescriptreact"
];
};
html = {
enable = true;
filetypes = [ "html" ];
};
jsonls = {
enable = true;
filetypes = [
"json"
"jsonc"
];
};
pyright = {
enable = true;
filetypes = [ "python" ];
};
bashls = {
enable = true;
filetypes = [
"sh"
"bash"
];
};
# ts_ls = {
# enable = true;
# filetypes =
# [ "javascript" "javascriptreact" "typescript" "typescriptreact" ];
# };
# marksman.enable = true;
yamlls = {
enable = true;
filetypes = [ "yaml" ];
};
};
inlayHints = true;
keymaps = {
lspBuf = {
"<leader>;" = "format";
"gh" = "hover";
};
};
};
# leap = {
# enable = true;
# };
wilder = {
enable = true;
modes = [
"/"
":"
"?"
];
enableCmdlineEnter = true;
beforeCursor = true;
useCmdlinechanged = true;
nextKey = "<Tab>";
prevKey = "<S-Tab>";
acceptKey = "<Down>";
rejectKey = "<Up>";
pipeline = [
''
wilder.branch(
wilder.cmdline_pipeline({
language = 'python',
fuzzy = 2,
}),
wilder.python_search_pipeline({
pattern = wilder.python_fuzzy_pattern(),
sorter = wilder.python_difflib_sorter(),
engine = 're',
}),
wilder.substitute_pipeline({
pipeline = wilder.python_search_pipeline({
skip_cmdtype_check = 1,
pattern = wilder.python_fuzzy_pattern({
start_at_boundary = 0,
}),
}),
}),
{
wilder.check(function(ctx, x) return x == "" end),
wilder.history(),
},
wilder.python_file_finder_pipeline({
file_command = {'${pkgs.ripgrep}/bin/rg', '--files'},
dir_command = {'${pkgs.fd}/bin/fd', '-td'},
filters = {'cpsm_filter'},
})
)
''
];
renderer = ''
(function()
local highlighters = {
wilder.pcre2_highlighter(),
-- wilder.lua_fzy_highlighter(),
}
local popupmenu_renderer = wilder.popupmenu_renderer(
wilder.popupmenu_border_theme({
border = 'rounded',
empty_message = wilder.popupmenu_empty_message_with_spinner(),
highlighter = highlighters,
highlights = {
accent = wilder.make_hl('WilderAccent', 'Pmenu', {{a = 1}, {a = 1}, {foreground = '#f4468f'}}),
},
left = {
' ',
wilder.popupmenu_devicons(),
wilder.popupmenu_buffer_flags({
flags = ' a + ',
icons = {['+'] = '', a = '', h = ''},
}),
},
right = {
' ',
wilder.popupmenu_scrollbar(),
},
})
)
local wildmenu_renderer = wilder.wildmenu_renderer({
highlights = {
accent = wilder.make_hl('WilderAccent', 'Pmenu', {{a = 1}, {a = 1}, {foreground = '#f4468f'}}),
},
highlighter = highlighters,
separator = ' · ',
left = {' ', wilder.wildmenu_spinner(), ' '},
right = {' ', wilder.wildmenu_index()},
})
return wilder.renderer_mux({
[':'] = popupmenu_renderer,
['/'] = wildmenu_renderer,
substitute = wildmenu_renderer,
})
end)()
'';
};
floaterm = {
enable = true;
settings = {
opener = "edit";
width = 0.8;
height = 0.8;
};
};
telescope = {
enable = true;
extensions = {
ui-select.enable = true;
fzf-native.enable = true;
frecency.enable = true;
};
settings = {
file_ignore_patterns = [
"^.git/"
"^.jj/"
"^.vscode/"
"^.idea/"
"^build/"
"^target/"
];
defaults = {
path_display = [ "smart" ];
layout_strategy = "horizontal";
layout_config = {
width = 0.99;
height = 0.99;
};
};
};
};
# diagnostics
trouble = {
enable = true;
};
# tabs
barbar = {
enable = true;
settings = {
options.diagnostics = "nvim_lsp";
focus_on_close = "previous";
};
};
# for lsp/cmp inside markdown code blocks
otter = {
enable = true;
};
none-ls = {
enable = true;
sources = {
formatting.nixpkgs_fmt.enable = true;
code_actions.statix.enable = true;
diagnostics = {
statix.enable = true;
deadnix.enable = true;
};
};
};
nix.enable = true;
web-devicons.enable = true;
};
extraPlugins = with pkgs.vimPlugins; [
telescope-ui-select-nvim
telescope-fzf-native-nvim
vim-suda
render-markdown
vim-astro
nvim-web-devicons
vim-visual-multi
vim-gh-line
neoconf-nvim
vim-autoswap
targets-vim
# fzy-lua-native
cpsm
# jj
vim-jjdescription
hover-nvim
];
};
}

View file

@ -1,166 +0,0 @@
{ pkgs, ... }:
{
programs.tmux = {
enable = true;
mouse = true;
clock24 = true;
shortcut = "k";
plugins = with pkgs; [
{
plugin = tmuxPlugins.mkTmuxPlugin {
pluginName = "suspend";
version = "1a2f806";
src = pkgs.fetchFromGitHub {
owner = "MunifTanjim";
repo = "tmux-suspend";
rev = "1a2f806666e0bfed37535372279fa00d27d50d14";
sha256 = "0j7vjrwc7gniwkv1076q3wc8ccwj42zph5wdmsm9ibz6029wlmzv";
};
};
extraConfig = ''
set -g @suspend_key 'F11'
'';
}
{
plugin = tmuxPlugins.mode-indicator;
}
];
extraConfig = ''
# unbind every single normal keybinding
unbind-key -a
# for special characters to work right
# like <C-_>
# set-window-option -g xterm-keys on
set -g default-terminal "screen-256color"
set -g set-titles on
set -g allow-passthrough on
set -s escape-time 0
set-option -g default-shell ${pkgs.fish}/bin/fish
set -ga terminal-features "\*:hyperlinks"
set-window-option -g mode-keys vi
# clipboard stuff
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel
bind v copy-mode
bind p paste-buffer -p
set -s set-clipboard on
# get back normal terminal emulator bindings
bind-key -n S-PPage copy-mode -u
bind-key -T copy-mode -n S-NPage send-keys -X page-down
# don't scroll to end when copying with mouse
bind-key -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe
bind-key -T copy-mode DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe
bind-key -T copy-mode TripleClick1Pane select-pane \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe
bind-key -T copy-mode-vi DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe
bind-key -T copy-mode-vi TripleClick1Pane select-pane \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe
# window control
bind t new-window -c "#{pane_current_path}"
bind-key Tab next-window
bind-key BTab previous-window
set -g automatic-rename-format "#{?#{==:#{pane_current_path},$HOME},~,#{b:pane_current_path}} (#{pane_current_command})"
set -g renumber-windows on
bind-key Q confirm-before -p "kill-window #W? (y/n)" kill-window
bind A last-window
bind-key 1 select-window -t :0
bind-key 2 select-window -t :1
bind-key 3 select-window -t :2
bind-key 4 select-window -t :3
bind-key 5 select-window -t :4
bind-key 6 select-window -t :5
bind-key 7 select-window -t :6
bind-key 8 select-window -t :7
bind-key 9 select-window -t :8
bind-key 0 select-window -t :9
# pane control
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind L split-window -h -c "#{pane_current_path}"
bind J split-window -v -c "#{pane_current_path}"
bind H split-window -h -b -c "#{pane_current_path}"
bind K split-window -v -b -c "#{pane_current_path}"
bind x swap-pane -D
# double-click ^k (or lshift with kanata) for previous pane like ^w in vim
bind -r ^k select-pane -l
bind-key q confirm-before -p "kill-pane #P? (y/n)" kill-pane
bind-key o choose-tree -wZ
bind-key O choose-tree -sZ
# get back command mode and some other basics...
bind : command-prompt
bind r source-file ~/.config/tmux/tmux.conf \; display "config reloaded"
bind-key ? list-keys
# Scroll oin man etc
tmux_commands_with_legacy_scroll="nano less more man git"
bind-key -T root WheelUpPane \
if-shell -Ft= '#{?mouse_any_flag,1,#{pane_in_mode}}' \
'send -Mt=' \
'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \
"send -t= Up" "copy-mode -et="'
bind-key -T root WheelDownPane \
if-shell -Ft = '#{?pane_in_mode,1,#{mouse_any_flag}}' \
'send -Mt=' \
'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \
"send -t= Down" "send -Mt="'
bind-key -T copy-mode-vi ] \
send-keys -X clear-selection \; \
send-keys -X search-forward "--> " \; \
send-keys -X next-word \; \
send-keys -X begin-selection \; \
send-keys -X jump-forward ":" \; \
send-keys -X jump-to-forward ":" \;
bind-key -T copy-mode-vi [ \
send-keys -X clear-selection \; \
send-keys -X start-of-line \; \
send-keys -X search-backward "--> " \; \
send-keys -X next-word \; \
send-keys -X begin-selection \; \
send-keys -X jump-forward ":" \; \
send-keys -X jump-to-forward ":" \;
bind-key [ copy-mode \; send-keys [
bind-key ] copy-mode \; send-keys ]
bind d select-pane -l \; send-keys [
'';
};
# bind-key -T root DoubleClick1Pane run-shell "cd '#{pane_current_path}'; echo '#{mouse_line}' | ${pkgs.writeScriptBin "open-file" ''
# open_file () {
# input=`cat`
# link=$(echo "$input" | grep -Po '[^ \\]*/[^ \\]*\.[^ \\]*\:[0-9]+' | sed 's/\:/|/g')
#
# if [ ! -z "$link" ]; then
# echo "LINK = $link"
# vim_proc=$(pgrep vim | xargs pwdx | grep $(pwd -P) | awk '{print $1}' | sed 's/\:*$//g' | xargs -I{} find /run/user/1000 -depth -maxdepth 1 -name "nvim.{}.0")
#
# nvim --server "$vim_proc" --remote-send "<C-\><C-N>:e $link<cr>"
# fi
# }
#
# open_file 2>&1 >> ~/open-file.log
#
# ''}/bin/open-file"
}

View file

@ -1,166 +0,0 @@
{ pkgs, ... }:
{
programs.zed-editor = {
enable = true;
extensions = [
"nix"
"intellij-newui-theme"
"charmed-icons"
];
userSettings = {
ssh_connections = [
{
host = "icecube";
args = [ ];
projects = [
{
paths = [
"/home/jana/src/eii-test"
];
}
{
paths = [
"/home/jana/src/example"
];
}
{
paths = [
"/home/jana/src/fitgirl-ddl"
];
}
{
paths = [
"/home/jana/src/libs-team/tools/unstable-api"
];
}
{
paths = [
"/home/jana/src/ml-kem-hang"
];
}
{
paths = [
"/home/jana/src/opendal/core"
];
}
{
paths = [
"/home/jana/src/rust"
];
}
{
paths = [
"/home/jana/src/span-lowering-tests"
];
}
];
}
];
icon_theme = "Warm Charmed Icons";
ui_font_size = 16;
buffer_font_size = 16;
theme = {
mode = "system";
light = "One Light";
dark = "JetBrains New Dark";
};
disable_ai = true;
preview_tabs = {
enabled = true;
enable_preview_from_file_finder = true;
};
close_on_file_delete = true;
confirm_quit = true;
edit_predictions_disabled_in = [
"comment"
"string"
];
vim_mode = true;
cursor_blink = false;
vertical_scroll_margin = 0;
inlay_hints = {
enabled = true;
};
project_panel = {
dock = "right";
git_status = false;
};
minimap = {
show = "auto";
thumb = "always";
thumb_border = "left_open";
};
tab_bar = {
show = true;
show_nav_history_buttons = false;
show_tab_bar_buttons = false;
};
tabs = {
file_icons = true;
git_status = false;
activate_on_close = "history";
show_close_button = "hover";
};
lsp = {
rust-analyzer = {
initialization_options = {
inlayHints = {
lifetimeElisionHints = "always";
discriminantHints = "always";
};
diagnostic = {
refreshSupport = true;
};
};
};
nil = {
binary = {
ignore_system_version = false;
path = "${pkgs.lib.getExe' pkgs.nil "nil"}";
};
initialization_options = {
formatting = {
command = [ "${pkgs.lib.getExe' pkgs.nixfmt "nixfmt"}" ];
};
};
};
};
diagnostics = {
button = false;
include_warnings = true;
inline = {
enabled = true;
};
};
terminal = {
"dock" = "left";
"env" = {
# "EDITOR": "zeditor --wait"
"EDITOR" = "vim";
};
"font_size" = 12;
"font_family" = "Noto Sans Mono";
"line_height" = "standard";
};
buffer_font_family = "JetBrains Mono";
# "diagnostics_max_severity": "off",
"experimental.theme_overrides" = {
"syntax" = {
"comment.doc" = {
"color" = "#77B767";
};
};
};
};
};
}

View file

@ -1,50 +0,0 @@
from math import *;
# import numpy as np
from pathlib import Path
import subprocess
import os
from pprint import pprint
from itertools import *
Path.__repr__ = lambda i: f"p'{str(i)}'"
kilo = 1000
mega = 1000 * kilo
giga = 1000 * mega
tera = 1000 * giga
peta = 1000 * tera
b = 1
kib = 1024
mib = 1024 * kib
gib = 1024 * mib
tib = 1024 * gib
pib = 1024 * tib
inch = 0.0254
yard = 0.9144
def cwd():
return Path.cwd()
def ls(d = None):
if d is None:
d = cwd()
return list(Path(d).iterdir())
def glob(expr):
return list(cwd().glob(expr))
def run(cmd, only_stdout=True):
res = subprocess.run(cmd, capture_output=True, text=True, shell=True)
if only_stdout:
return str(res.stdout)
else:
return res
def cat(file):
return open(file, "r").read()
print_ = print
print = pprint

View file

@ -48,6 +48,11 @@
"networkmanager"
"libvirtd"
"dialout"
"storage"
"syncthing"
"jellyfin"
"media"
"nginx"
];
};