├── .envrc ├── .github ├── flake-to-md.awk └── workflows │ └── update.yaml ├── .gitignore ├── .helix └── languages.toml ├── .nixd.json ├── LICENSE ├── README.md ├── darwin-common.nix ├── darwin-modules ├── .gitkeep └── borgmatic.nix ├── data ├── monitoring.toml └── pubkeys.nix ├── flake.lock ├── flake.nix ├── hm-modules ├── cli.nix ├── eww │ ├── eww.scss │ └── eww.yuck ├── files.nix ├── helix │ └── default.nix ├── nushell │ └── default.nix ├── nvim │ ├── config │ │ ├── lua │ │ │ ├── .luarc.json │ │ │ ├── dark_notify.lua │ │ │ ├── filetypes.lua │ │ │ ├── keybindings.lua │ │ │ ├── plugin │ │ │ │ ├── cmp.lua │ │ │ │ ├── dap.lua │ │ │ │ ├── gitsigns.lua │ │ │ │ ├── lsp.lua │ │ │ │ ├── lualine.lua │ │ │ │ ├── nnn.lua │ │ │ │ ├── noice.lua │ │ │ │ ├── telescope.lua │ │ │ │ ├── terminal.lua │ │ │ │ └── treesitter.lua │ │ │ └── utils.lua │ │ └── nvim.lua │ └── default.nix ├── tmux │ ├── default.nix │ └── tmux-switch-colors │ │ ├── dark.tmux │ │ ├── light.tmux │ │ ├── start_theme_switcher.sh │ │ ├── theme_setter.sh │ │ └── theme_switcher.sh ├── vscode │ ├── PLEASE FORGIVE ME FOR THIS SINFUL ACT │ ├── default.nix │ ├── extensions.toml │ └── vscode-extensions.nix ├── xonsh │ └── default.nix ├── zellij │ └── default.nix └── zsh │ ├── default.nix │ ├── p10k.zsh │ └── zshrc ├── hosts ├── daedalus │ ├── default.nix │ └── hammerspoon.lua ├── ds9 │ ├── authentik.nix │ ├── backup.nix │ ├── containers.nix │ ├── default.nix │ ├── hardware-configuration.nix │ ├── paperless.nix │ ├── part-db.nix │ ├── plex.nix │ └── samba.nix ├── picard │ ├── default.nix │ ├── gotosocial.nix │ ├── hardware-configuration.nix │ ├── mail.nix │ ├── obsidianshare.nix │ ├── plausible.nix │ └── xynospace-matrix.nix ├── theseus │ ├── builtin.kbd │ ├── default.nix │ ├── gnome.nix │ ├── hardware-configuration.nix │ ├── kmonad.nix │ ├── mako.nix │ ├── niri.nix │ ├── razer.kbd │ ├── river.nix │ ├── swaycfg.nix │ ├── waybar.nix │ ├── wired.ron │ └── work.nix └── voyager │ ├── default.nix │ └── hardware-configuration.nix ├── lefthook.yml ├── lib ├── attrs.nix ├── default.nix ├── modules.nix └── options.nix ├── nixos-common.nix ├── nixos-modules ├── cli │ └── default.nix ├── networking │ └── tailscale.nix ├── services │ ├── authelia.nix │ ├── bitwarden.nix │ ├── caddy │ │ ├── custom-caddy.nix │ │ └── default.nix │ ├── docker.nix │ ├── hedgedoc.nix │ ├── libvirt.nix │ ├── msmtp.nix │ ├── paperless.nix │ ├── photoprism.nix │ ├── samba.nix │ ├── ssh.nix │ ├── tailscale-openvpn.nix │ └── ts3.nix ├── system │ ├── agenix.nix │ ├── fs.nix │ ├── persist.nix │ └── security.nix └── user │ └── default.nix ├── packages ├── .gitkeep ├── scripts.nix └── scripts │ ├── , │ ├── nosrebuild │ └── nr └── secrets ├── aliases.age ├── autheliaEmail.age ├── autheliaHedgedoc.age ├── autheliaJwtSecret.age ├── autheliaOidcHmacSecret.age ├── autheliaOidcIssuerPrivateKey.age ├── autheliaSessionSecret.age ├── autheliaStorageEncryption.age ├── borgmaticEncryptionKey.age ├── desec.age ├── ds9AuthentikEnv.age ├── ds9AuthentikLdapEnv.age ├── ds9DynDns.age ├── ds9ImmichEnv.age ├── ds9OffsiteBackupSSH.age ├── ds9PartDbEnv.age ├── ds9PostgresEnv.age ├── ds9SyncoidHealthCheckUrl.age ├── ds9rcloneConfig.age ├── ds9resticPassword.age ├── gatebridgeHostKeys.age ├── gitlabDBFile.age ├── gitlabInitialRootPassword.age ├── gitlabJWSFile.age ├── gitlabOTPFile.age ├── gitlabSecretFile.age ├── hedgedocSecret.age ├── ionos.age ├── mailmoverConf.age ├── matrixSecrets.age ├── msmtprc.age ├── nextcloudAdminPass.age ├── nextshot.age ├── ovpnCrt1.age ├── ovpnDe.age ├── ovpnNl.age ├── ovpnPw1.age ├── ovpnPw2.age ├── ovpnScript.age ├── ovpnTu.age ├── paperlessAdminPW.age ├── photoprismEnv.age ├── picardCalCom.age ├── picardResticHealthCheckUrl.age ├── picardResticPassword.age ├── picardResticSSHKey.age ├── picardSharenoteEnv.age ├── picardSlidingSyncSecret.age ├── plausibleAdminPw.age ├── plausibleGoogleClientId.age ├── plausibleGoogleClientSecret.age ├── plausibleReleaseCookie.age ├── plausibleSecretKeybase.age ├── prometheusBlackboxConfig.yaml.age ├── pulseLaunch.age ├── ragonPasswd.age ├── rootPasswd.age ├── secrets.nix ├── smbSecrets.age ├── smtpPassword.age ├── tailscaleKey.age ├── vpnConfig.age └── wpa_supplicant.age /.envrc: -------------------------------------------------------------------------------- 1 | use flake 2 | -------------------------------------------------------------------------------- /.github/flake-to-md.awk: -------------------------------------------------------------------------------- 1 | # Parses a flake lock update commit and output readable markdown with proper 2 | # https://github.com/sandhose/nixconf/blob/master/misc/flake-to-markdown.awk 3 | # compare links 4 | 5 | function unquote (str) { 6 | split(str, arr, "'"); 7 | return arr[2]; 8 | } 9 | 10 | function parse_flakeref (flakeref, res) { 11 | split(flakeref, arr, ":"); 12 | type = arr[1]; 13 | tmp = arr[2]; 14 | split(tmp, arr, "?"); 15 | tmp = arr[1]; 16 | n = split(tmp, arr, "/"); 17 | commit = arr[n]; 18 | repo = arr[1] 19 | for (i = 2; i < n; i++) { 20 | repo = repo "/" arr[i]; 21 | } 22 | 23 | res["type"] = type; 24 | res["commit"] = commit; 25 | res["repo"] = repo; 26 | } 27 | 28 | function short (sha) { 29 | return substr(sha, 1, 8); 30 | } 31 | 32 | # Show the raw output in a foldable section 33 | BEGIN { 34 | print "
Raw output

"; 35 | print ""; 36 | print "```"; 37 | } 38 | 39 | # Print all lines anyway 40 | { print } 41 | 42 | # This is a "Updated input 'x'" ine 43 | $3 ~ /input/ { 44 | input = unquote($4); 45 | operations[input] = $2; 46 | next; 47 | } 48 | 49 | # This is a "'type:foo/bar/1234' (2021-01-01)" line 50 | $2 ~ /\(.*\)/ { 51 | input_from[input] = unquote($1) 52 | input_from_date[input] = substr($2, 2, 10); 53 | next; 54 | } 55 | 56 | # This is a "→ 'type:foo/bar/1234' (2021-01-01)" line 57 | $3 ~ /\(.*\)/ { 58 | input_to[input] = unquote($2) 59 | input_to_date[input] = substr($3, 2, 10); 60 | next; 61 | } 62 | 63 | END { 64 | print "```"; 65 | print ""; 66 | print "

"; 67 | print ""; 68 | 69 | # Once we gathered the information we needed, we can show it properly 70 | for (input in operations) { 71 | operation = operations[input]; 72 | details = ""; 73 | link = ""; 74 | 75 | # For "updated" inputs, we have two flake refs 76 | if (operation == "Updated") { 77 | from = input_from[input]; 78 | to = input_to[input]; 79 | from_date = input_from_date[input] 80 | to_date = input_to_date[input] 81 | parse_flakeref(from, parsed_from); 82 | parse_flakeref(to, parsed_to); 83 | type = parsed_to["type"]; 84 | repo = parsed_to["repo"]; 85 | from_commit = parsed_from["commit"]; 86 | to_commit = parsed_to["commit"]; 87 | 88 | compare = sprintf("`%s` ➡️ `%s`", short(from_commit), short(to_commit)); 89 | # Render the details according to the ref type 90 | if (type == "github") { 91 | compare = sprintf("[%s](https://github.com/%s/compare/%s...%s)", compare, repo, from_commit, to_commit); 92 | link = sprintf("https://github.com/%s", repo); 93 | } else if (type == "gitlab") { 94 | compare = sprintf("[%s](https://gitlab.com/%s/-/compare/%s...%s)", compare, repo, from_commit, to_commit); 95 | link = sprintf("https://gitlab.com/%s", repo); 96 | } 97 | 98 | details = sprintf("%s (%s to %s)", compare, from_date, to_date); 99 | # For "added" inputs, we have one flake ref 100 | } else if (operation == "Added") { 101 | ref = input_from[input]; 102 | parse_flakeref(ref, parsed_ref); 103 | type = parsed_ref["type"]; 104 | repo = parsed_ref["repo"]; 105 | commit = parsed_ref["commit"]; 106 | 107 | # Render the details according to the ref type 108 | if (type == "github") { 109 | details = sprintf("[github.com/%s](https://github.com/%s/tree/%s/)", repo, repo, commit); 110 | link = sprintf("https://github.com/%s", repo); 111 | } else if (type == "gitlab") { 112 | details = sprintf("[gitlab.com/%s](https://gitlab.com/%s/-/tree/%s/)", repo, repo, commit); 113 | link = sprintf("https://gitlab.com/%s", repo); 114 | } else { 115 | details = sprintf("`%s`", ref); 116 | } 117 | } 118 | 119 | if (link) { 120 | input_txt = sprintf("[`%s`](%s)", input, link); 121 | } else { 122 | input_txt = sprintf("`%s`", input); 123 | } 124 | 125 | if (details) { 126 | printf(" - %s input %s: %s\n", operation, input_txt, details); 127 | } else { 128 | printf(" - %s input %s.\n", operation, input_txt); 129 | } 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /.github/workflows/update.yaml: -------------------------------------------------------------------------------- 1 | # https://github.com/sandhose/nixconf/blob/master/.github/workflows/update.yaml 2 | name: "Update lock file" 3 | on: 4 | schedule: 5 | - cron: "0 6 * * *" 6 | workflow_dispatch: 7 | jobs: 8 | tests: 9 | runs-on: ubuntu-20.04 10 | 11 | steps: 12 | - uses: actions/checkout@v3 13 | with: 14 | fetch-depth: 0 15 | 16 | - uses: tibdex/github-app-token@v1.5 17 | id: generate-token 18 | with: 19 | app_id: ${{ secrets.APP_ID }} 20 | private_key: ${{ secrets.APP_PRIVATE_KEY }} 21 | 22 | - uses: cachix/install-nix-action@v16 23 | with: 24 | install_url: https://releases.nixos.org/nix/nix-2.6.1/install 25 | extra_nix_config: | 26 | experimental-features = nix-command flakes 27 | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} 28 | 29 | - name: Setup Git author 30 | run: | 31 | git config user.name 'GitHub Ations' 32 | git config user.email 'noreply@github.com' 33 | 34 | - name: Update lock file 35 | run: nix flake update --no-use-registries --commit-lock-file 36 | 37 | - name: Get commit message 38 | id: commit 39 | run: | 40 | message="$(git log -1 --pretty=%B | tail +3 | awk -f ./.github/flake-to-md.awk)" 41 | message="${message//'%'/'%25'}" 42 | message="${message//$'\n'/'%0A'}" 43 | message="${message//$'\r'/'%0D'}" 44 | echo "::set-output name=message::$message" 45 | 46 | - name: Create Pull Request 47 | uses: peter-evans/create-pull-request@v4 48 | with: 49 | token: "${{ steps.generate-token.outputs.token }}" 50 | title: "Automated Flake update" 51 | body: "${{ steps.commit.outputs.message }}" 52 | delete-branch: true 53 | assignees: thexyno 54 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore configurable file with secrets 2 | #/data/secrets.nix 3 | .DS_Store 4 | /.direnv 5 | 6 | # Ignore build symlinks 7 | result* 8 | internal 9 | .tmp 10 | 11 | # Ignore vscode stuff 12 | /.vscode/ 13 | 14 | -------------------------------------------------------------------------------- /.helix/languages.toml: -------------------------------------------------------------------------------- 1 | [language-server.nil] 2 | command = "nil" 3 | [[language]] 4 | name = "nix" 5 | formatter = {command = "nixfmt"} 6 | language-servers = [ "nil" ] 7 | -------------------------------------------------------------------------------- /.nixd.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": { 3 | "enable": true, 4 | "target": { 5 | "installable": ".#nixosConfigurations.picard.options" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # my nixos/nix-darwin Configs 2 | 3 | ## Folder structure 4 | 5 | - `hosts/` 6 | - host specific configuration 7 | - `nixos-modules/` 8 | - nixos modules 9 | - `hm-imports/` 10 | - home-manager modules 11 | - `data/` 12 | - some configuration files, pubkeys, ... 13 | - `lib/` 14 | - helper functions 15 | - `packages/` 16 | - packages to small to put into another repo 17 | - `secrets/` 18 | - agenix secrets 19 | 20 | -------------------------------------------------------------------------------- /darwin-common.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, inputs, ... }: { 2 | programs.zsh.enable = true; 3 | environment.pathsToLink = [ "/share/zsh" ]; 4 | services.nix-daemon.enable = true; 5 | nix.settings.cores = 0; # use all cores 6 | nix.settings.max-jobs = 10; # use all cores 7 | nix.settings.experimental-features = [ "nix-command" "flakes" ]; 8 | security.pam.enableSudoTouchIdAuth = true; 9 | programs.zsh.shellInit = '' 10 | eval "$(/opt/homebrew/bin/brew shellenv)" 11 | ''; 12 | environment.systemPath = [ "/opt/homebrew/bin" "/opt/homebrew/sbin" ]; 13 | #nix.settings.auto-optimise-store = true; 14 | nix.distributedBuilds = true; 15 | nix.nixPath = [{ nixpkgs = "${inputs.nixpkgs-darwin.outPath}"; nixpkgs-master = "${inputs.nixpkgs-master.outPath}"; nixpkgs-nixos = "${inputs.nixpkgs.outPath}"; }]; 16 | nix.buildMachines = [{ 17 | systems = [ "x86_64-linux" ]; 18 | supportedFeatures = [ "kvm" "big-parallel" ]; 19 | sshUser = "ragon"; 20 | maxJobs = 12; 21 | hostName = "ds9"; 22 | sshKey = "/Users/xyno/.ssh/id_ed25519"; 23 | publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUorQkJYdWZYQUpoeVVIVmZocWxrOFk0ekVLSmJLWGdKUXZzZEU0ODJscFYgcm9vdEBpc28K"; 24 | }]; 25 | nix.extraOptions = '' 26 | builders-use-substitutes = true 27 | ''; 28 | 29 | system.defaults = { 30 | NSGlobalDomain.AppleShowAllExtensions = true; 31 | NSGlobalDomain.InitialKeyRepeat = 25; 32 | NSGlobalDomain.KeyRepeat = 4; 33 | NSGlobalDomain.NSNavPanelExpandedStateForSaveMode = true; 34 | NSGlobalDomain.PMPrintingExpandedStateForPrint = true; 35 | NSGlobalDomain."com.apple.mouse.tapBehavior" = 1; 36 | NSGlobalDomain."com.apple.trackpad.trackpadCornerClickBehavior" = 1; 37 | dock.autohide = true; 38 | dock.mru-spaces = false; 39 | dock.show-recents = false; 40 | dock.static-only = true; 41 | dock.expose-animation-duration = 0.01; 42 | finder.AppleShowAllExtensions = true; 43 | finder.FXEnableExtensionChangeWarning = false; 44 | loginwindow.GuestEnabled = false; 45 | }; 46 | } 47 | 48 | -------------------------------------------------------------------------------- /darwin-modules/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thexyno/nixos-config/f628d8a214a1932969292c93379b58c84c6df1d9/darwin-modules/.gitkeep -------------------------------------------------------------------------------- /darwin-modules/borgmatic.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, config, ... }: 2 | with lib; 3 | let 4 | cfg = config.ragon.services.borgmatic; 5 | settingsFormat = pkgs.formats.yaml { }; 6 | cfgType = with types; submodule { 7 | freeformType = settingsFormat.type; 8 | }; 9 | cfgfile = settingsFormat.generate "config.yaml" cfg.settings; 10 | in 11 | { 12 | options.ragon.services.borgmatic = { 13 | enable = mkEnableOption (mdDoc "borgmatic"); 14 | 15 | settings = mkOption { 16 | description = mdDoc '' 17 | See https://torsion.org/borgmatic/docs/reference/configuration/ 18 | ''; 19 | default = null; 20 | type = types.nullOr cfgType; 21 | }; 22 | 23 | configurations = mkOption { 24 | description = mdDoc '' 25 | Set of borgmatic configurations, see https://torsion.org/borgmatic/docs/reference/configuration/ 26 | ''; 27 | default = { }; 28 | type = types.attrsOf cfgType; 29 | }; 30 | }; 31 | config = mkIf cfg.enable { 32 | 33 | environment.systemPackages = [ 34 | #pkgs.borgmatic 35 | pkgs.borgbackup 36 | ]; 37 | homebrew.brews = [ "borgmatic" ]; 38 | 39 | environment.etc = (optionalAttrs (cfg.settings != null) { "borgmatic/config.yaml".source = cfgfile; }) // 40 | mapAttrs' 41 | (name: value: nameValuePair 42 | "borgmatic.d/${name}.yaml" 43 | { source = settingsFormat.generate "${name}.yaml" value; }) 44 | cfg.configurations; 45 | 46 | launchd.user.agents.borgmatic = { 47 | script = '' 48 | if (pmset -g batt | grep -q 'AC Power'); then 49 | borgmatic 50 | else 51 | echo "On Battery Power, skipping backup" 52 | fi 53 | ''; 54 | path = [ "/opt/homebrew/bin" config.environment.systemPath ]; 55 | serviceConfig = { 56 | StartInterval = 60 * 60; # run every hour 57 | StandardOutPath = "/var/log/borgmatic.log"; 58 | StandardErrorPath = "/var/log/borgmatic.log"; 59 | KeepAlive = true; 60 | # NetworkState = true; 61 | Nice = 1; 62 | }; 63 | }; 64 | assertions = [ 65 | { 66 | assertion = config.homebrew.enable; 67 | message = "homebrew must be enabled for borgmatic to run"; 68 | } 69 | ]; 70 | }; 71 | 72 | 73 | } 74 | -------------------------------------------------------------------------------- /data/monitoring.toml: -------------------------------------------------------------------------------- 1 | [master] 2 | hostname = "beliskner" 3 | ip = "beliskner.kangaroo-galaxy.ts.net" # tailscale 4 | 5 | [hostOverrides] 6 | 7 | [exporters.node] 8 | hosts = [ "ds9", "picard" ] 9 | 10 | [exporters.smartctl] 11 | hosts = [ "ds9" ] 12 | 13 | [exporters.blackbox] 14 | hosts = [ "beliskner" ] 15 | 16 | [promtail] 17 | hosts = [ "picard", "ds9" ] 18 | -------------------------------------------------------------------------------- /data/pubkeys.nix: -------------------------------------------------------------------------------- 1 | let 2 | ragon = 3 | let 4 | user = [ 5 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEJwOH1b6xWmEr1VZh48kBIYhW11vtPFR3my8stAHlSi" # saurier 6 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIuwQJY0H/fdu1UmGXAut7VfcvAk2Dm78tJpkyyv2in2" # daedalus 7 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKZ0hlF6EFQXpw74kkpoA8vxMX6vVDTnpM41rCDXRMuo" # daedalusvm 8 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC6xx1IWlRoSQvCUZ+iyzekjFjoXBKmDT4Kxww4Tl+63" # iPad 9 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJmN2QRbwQyeUChQ0ZxNzjNnUZTOUVbM4kDEGfEtmufc" # iPhone 10 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID/oMAi5jyQsNohfhcSH2ItisTpBGB0WtYTVxJYKKqhj" # theseus 11 | ]; 12 | server = user ++ hosts.ds9 ++ hosts.picard; 13 | client = user; 14 | hosts = { 15 | ds9 = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ+BBXufXAJhyUHVfhqlk8Y4zEKJbKXgJQvsdE482lpV" ]; 16 | picard = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAm3UXZaN95WBUaS9SiHLNEuI1tP1x1w07qnYxPe+vdr" ]; 17 | theseus = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP/pPCcq0ziQhdyZSObly3bUUJqH56Ly+uYS6MNdR2D+"]; 18 | }; 19 | in 20 | { 21 | inherit user server client; 22 | computers = user ++ (builtins.foldl' (a: b: a ++ b) [ ] (builtins.attrValues hosts)); # everything 23 | host = hn: (hosts.${hn} ++ user); 24 | hosts = hn: ((map (x: hosts.${x}) hn) ++ user); 25 | }; 26 | in 27 | { 28 | inherit ragon; 29 | } 30 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "ragons nix/nixos configs"; 3 | inputs = { 4 | # base imports 5 | utils.url = "github:numtide/flake-utils"; 6 | 7 | ## nixos/nix-darwin dependencies 8 | nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; 9 | nixpkgs-darwin.url = "github:NixOS/nixpkgs/nixpkgs-24.05-darwin"; 10 | nixpkgs-master.url = "github:NixOS/nixpkgs/master"; 11 | agenix.url = "github:ryantm/agenix/main"; 12 | agenix.inputs.nixpkgs.follows = "nixpkgs"; 13 | home-manager.url = "github:nix-community/home-manager/release-24.11"; 14 | home-manager.inputs.nixpkgs.follows = "nixpkgs"; 15 | impermanence.url = "github:nix-community/impermanence"; 16 | nixos-hardware.url = "github:NixOS/nixos-hardware/master"; 17 | darwin.url = "github:lnl7/nix-darwin/master"; 18 | darwin.inputs.nixpkgs.follows = "nixpkgs"; 19 | quadlet-nix.url = "github:SEIAROTg/quadlet-nix"; 20 | quadlet-nix.inputs.nixpkgs.follows = "nixpkgs"; 21 | 22 | lix-module = { 23 | url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-2.tar.gz"; 24 | inputs.nixpkgs.follows = "nixpkgs"; 25 | }; 26 | 27 | # programs 28 | xynoblog.url = "github:thexyno/blog"; 29 | xynoblog.inputs.nixpkgs.follows = "nixpkgs"; 30 | x.url = "github:thexyno/x"; 31 | x.inputs.nixpkgs.follows = "nixpkgs"; 32 | helix.url = "github:SofusA/helix-pull-diagnostics/pull-diagnostics"; 33 | wired.inputs.nixpkgs.follows = "nixpkgs"; 34 | wired.url = "github:Toqozz/wired-notify"; 35 | zen-browser.url = "github:0xc000022070/zen-browser-flake"; 36 | 37 | 38 | kmonad = { 39 | url = "git+https://github.com/jokesper/kmonad?dir=nix&ref=feat-tap-overlap"; 40 | inputs.nixpkgs.follows = "nixpkgs"; 41 | }; 42 | 43 | ## editor stuff 44 | # nixd.url = "github:nix-community/nixd"; 45 | # nixd.inputs.nixpkgs.follows = "nixpkgs"; 46 | 47 | 48 | ## vim 49 | # nnn-nvim.url = "github:luukvbaal/nnn.nvim"; 50 | # nnn-nvim.flake = false; 51 | # notify-nvim.url = "github:rcarriga/nvim-notify"; 52 | # notify-nvim.flake = false; 53 | # noice-nvim.url = "github:folke/noice.nvim"; 54 | # noice-nvim.flake = false; 55 | 56 | # ## zsh 57 | # zsh-completions.url = "github:zsh-users/zsh-completions"; 58 | # zsh-completions.flake = false; 59 | # zsh-syntax-highlighting.url = "github:zsh-users/zsh-syntax-highlighting/master"; 60 | # zsh-syntax-highlighting.flake = false; 61 | # zsh-vim-mode.url = "github:softmoth/zsh-vim-mode"; 62 | # zsh-vim-mode.flake = false; 63 | # agkozak-zsh-prompt.url = "github:agkozak/agkozak-zsh-prompt"; 64 | # agkozak-zsh-prompt.flake = false; 65 | 66 | # ## xonsh 67 | # xonsh-fish-completer.url = "github:xonsh/xontrib-fish-completer"; 68 | # xonsh-fish-completer.flake = false; 69 | # xonsh-direnv.url = "github:74th/xonsh-direnv"; 70 | # xonsh-direnv.flake = false; 71 | 72 | ## hammerspoon 73 | miro.url = "github:miromannino/miro-windows-manager"; 74 | miro.flake = false; 75 | spoons.url = "github:Hammerspoon/Spoons"; 76 | spoons.flake = false; 77 | 78 | 79 | 80 | #other dependencies 81 | pandoc-latex-template.url = "github:Wandmalfarbe/pandoc-latex-template"; 82 | pandoc-latex-template.flake = false; 83 | 84 | }; 85 | 86 | outputs = 87 | inputs @ { self 88 | , nixpkgs 89 | , nixpkgs-darwin 90 | , nixpkgs-master 91 | , agenix 92 | , home-manager 93 | , impermanence 94 | , darwin 95 | , utils 96 | , xynoblog 97 | # , lolpizza 98 | , lix-module 99 | , kmonad 100 | , wired 101 | , x 102 | , ... 103 | }: 104 | let 105 | extraSystems = [ ]; 106 | lib = nixpkgs.lib.extend (self: super: { 107 | my = import ./lib { inherit inputs; lib = self; }; 108 | }); 109 | 110 | overlays = [ 111 | self.overlays.default 112 | wired.overlays.default 113 | ]; 114 | genPkgsWithOverlays = system: import nixpkgs { 115 | inherit system overlays; 116 | config.allowUnfree = true; 117 | }; 118 | genDarwinPkgsWithOverlays = system: import nixpkgs-darwin { 119 | inherit system overlays; 120 | config.allowUnfree = true; 121 | }; 122 | 123 | 124 | rev = if (lib.hasAttrByPath [ "rev" ] self.sourceInfo) then self.sourceInfo.rev else "Dirty Build"; 125 | 126 | nixosSystem = system: extraModules: hostName: 127 | let 128 | pkgs = genPkgsWithOverlays system; 129 | in 130 | nixpkgs.lib.nixosSystem 131 | rec { 132 | inherit system; 133 | specialArgs = { inherit lib inputs; }; 134 | modules = [ 135 | lix-module.nixosModules.default 136 | agenix.nixosModules.age 137 | impermanence.nixosModules.impermanence 138 | home-manager.nixosModules.home-manager 139 | kmonad.nixosModules.default 140 | xynoblog.nixosModule 141 | # lolpizza.nixosModule 142 | x.nixosModule 143 | ({ config, ... }: lib.mkMerge [{ 144 | nixpkgs.pkgs = pkgs; 145 | nixpkgs.overlays = overlays; 146 | networking.hostName = hostName; 147 | system.configurationRevision = rev; 148 | services.getty.greetingLine = 149 | "<<< Welcome to ${config.system.nixos.label} @ ${rev} - Please leave \\l >>>"; 150 | home-manager.useGlobalPkgs = true; 151 | home-manager.useUserPackages = true; 152 | home-manager.extraSpecialArgs = { inherit inputs; }; 153 | }]) 154 | ./nixos-common.nix 155 | ] ++ extraModules; 156 | }; 157 | darwinSystem = system: extraModules: hostName: 158 | let 159 | pkgs = genDarwinPkgsWithOverlays system; 160 | in 161 | darwin.lib.darwinSystem 162 | { 163 | inherit system; 164 | specialArgs = { inherit lib inputs self darwin; }; 165 | modules = [ 166 | home-manager.darwinModules.home-manager 167 | { 168 | nixpkgs.overlays = overlays; 169 | networking.hostName = hostName; 170 | home-manager.useGlobalPkgs = true; 171 | home-manager.useUserPackages = true; 172 | home-manager.extraSpecialArgs = { inherit inputs pkgs; }; 173 | } 174 | ./darwin-common.nix 175 | lix-module.nixosModules.default 176 | ] ++ extraModules; 177 | }; 178 | 179 | processConfigurations = lib.mapAttrs (n: v: v n); 180 | 181 | 182 | in 183 | { 184 | lib = lib.my; 185 | overlays.default = final: prev: { 186 | unstable = import nixpkgs-master { 187 | system = prev.system; 188 | config.allowUnfree = true; 189 | }; 190 | my = self.packages."${prev.system}"; 191 | }; 192 | # nixosModules = lib.my.mapModulesRec ./nixos-modules import; 193 | # darwinModules = lib.my.mapModulesRec ./darwin-modules import; 194 | 195 | nixosConfigurations = processConfigurations { 196 | picard = nixosSystem "x86_64-linux" [ ./hosts/picard/default.nix ]; 197 | ds9 = nixosSystem "x86_64-linux" [ ./hosts/ds9/default.nix ]; 198 | 199 | voyager = nixosSystem "x86_64-linux" [ ./hosts/voyager/default.nix ]; 200 | theseus = nixosSystem "x86_64-linux" [ ./hosts/theseus/default.nix ]; 201 | }; 202 | darwinConfigurations = processConfigurations { 203 | daedalus = darwinSystem "aarch64-darwin" [ ./hosts/daedalus/default.nix ]; 204 | }; 205 | 206 | } // utils.lib.eachDefaultSystem (system: 207 | let pkgs = nixpkgs.legacyPackages.${system}; in 208 | { 209 | devShell = pkgs.mkShell { 210 | buildInputs = with pkgs; [ 211 | pkgs.nixfmt-rfc-style 212 | pkgs.nil 213 | lefthook inputs.agenix.packages.${system}.agenix ]; 214 | }; 215 | packages = lib.my.mapModules ./packages (p: pkgs.callPackage p { inputs = inputs; }); 216 | }); 217 | } 218 | -------------------------------------------------------------------------------- /hm-modules/cli.nix: -------------------------------------------------------------------------------- 1 | { inputs, config, lib, pkgs, ... }: 2 | { 3 | 4 | home.stateVersion = lib.mkDefault "22.05"; 5 | home.packages = with pkgs; [ 6 | my.scripts 7 | jq 8 | nnn 9 | bat 10 | htop 11 | eza 12 | curl 13 | fd 14 | file 15 | git 16 | neofetch 17 | ripgrep 18 | direnv # needed for lorri 19 | unzip 20 | pv 21 | killall 22 | yt-dlp 23 | aria2 24 | ]; 25 | home.shellAliases = { 26 | v = "nvim"; 27 | c = "code"; 28 | vim = "nvim"; 29 | gpl = "git pull"; 30 | gp = "git push"; 31 | gpf = "git push --force-with-lease"; 32 | gd = "git diff"; 33 | lg = "lazygit"; 34 | gc = "git commit -v"; 35 | kb = "git commit -m \"\$(curl -s http://whatthecommit.com/index.txt)\""; 36 | gs = "git status -v"; 37 | gfc = "git fetch && git checkout"; 38 | gl = "git log --graph"; 39 | l = "eza -la --git"; 40 | la = "eza -la --git"; 41 | ls = "eza"; 42 | ll = "eza -l --git"; 43 | cat = "bat"; 44 | p = "cd ~/proj"; 45 | ytl = ''yt-dlp -f "bv*+mergeall[vcodec=none]" --audio-multistreams''; 46 | }; 47 | 48 | programs = { 49 | bat = { 50 | enable = true; 51 | config.theme = "gruvbox-dark"; 52 | }; 53 | git = { 54 | enable = true; 55 | lfs.enable = true; 56 | 57 | # Default configs 58 | extraConfig = { 59 | commit.gpgSign = true; 60 | gpg.format = "ssh"; 61 | 62 | user.name = "Lucy Hochkamp"; 63 | user.email = "git@xyno.systems"; 64 | user.signingKey = # TODO: don't hardcode a computer 65 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID/oMAi5jyQsNohfhcSH2ItisTpBGB0WtYTVxJYKKqhj"; # theseus 66 | 67 | # Set default "git pull" behaviour so it doesn't try to default to 68 | # either "git fetch; git merge" (default) or "git fetch; git rebase". 69 | pull.ff = "only"; 70 | }; 71 | }; 72 | # Htop configurations 73 | htop = { 74 | enable = true; 75 | settings = { 76 | hide_userland_threads = true; 77 | highlight_base_name = true; 78 | shadow_other_users = true; 79 | show_program_path = false; 80 | tree_view = false; 81 | }; 82 | }; 83 | 84 | }; 85 | } 86 | 87 | -------------------------------------------------------------------------------- /hm-modules/eww/eww.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thexyno/nixos-config/f628d8a214a1932969292c93379b58c84c6df1d9/hm-modules/eww/eww.scss -------------------------------------------------------------------------------- /hm-modules/eww/eww.yuck: -------------------------------------------------------------------------------- 1 | (defwindow bar 2 | :monitor 0 3 | :hexpand false 4 | :vexpand false 5 | :geometry (geometry :anchor "top left" :x 0 :y 0 :width "100%") 6 | ; :reserve (struts :distance "10px" :side "top") 7 | (bar)) 8 | 9 | (defwidget bar 10 | (centerbox :orientation "h" 11 | (left) 12 | (center) 13 | (right))) 14 | 15 | (defwidget left [] 16 | :halign "start" 17 | (workspaces) 18 | ) 19 | 20 | (defwidget workspaces [] 21 | (box :class "workspaces" 22 | :orientation "h" 23 | :space-evenly true 24 | :spacing 5 25 | (button :onclick "wmctrl -s 0" 1) 26 | (button :onclick "wmctrl -s 1" 2) 27 | (button :onclick "wmctrl -s 2" 3) 28 | (button :onclick "wmctrl -s 3" 4) 29 | (button :onclick "wmctrl -s 4" 5) 30 | (button :onclick "wmctrl -s 5" 6) 31 | (button :onclick "wmctrl -s 6" 7) 32 | (button :onclick "wmctrl -s 7" 8) 33 | (button :onclick "wmctrl -s 8" 9))) 34 | 35 | (defwidget center [] 36 | :haligh "center" 37 | (window_name)) 38 | 39 | (defwidget ) 40 | -------------------------------------------------------------------------------- /hm-modules/files.nix: -------------------------------------------------------------------------------- 1 | { inputs, config, lib, pkgs, ... }: 2 | { 3 | imports = [ 4 | "${inputs.impermanence}/home-manager.nix" 5 | ]; 6 | home.file = { 7 | # Home nix config. 8 | ".config/nixpkgs/config.nix".text = "{ allowUnfree = true; }"; 9 | ".local/share/pandoc/templates/default.latex".source = "${inputs.pandoc-latex-template}/eisvogel.tex"; 10 | 11 | # empty zshrc to stop zsh-newuser-install from running 12 | ".zshrc".text = ""; 13 | 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /hm-modules/helix/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, inputs, ... }: 2 | let 3 | cfg = config.ragon.helix; 4 | in 5 | { 6 | options.ragon.helix.enable = lib.mkOption { default = false; }; 7 | config = lib.mkIf cfg.enable { 8 | home.packages = with pkgs; [ 9 | jsonnet-language-server 10 | jsonnet 11 | nixpkgs-fmt 12 | # omnisharp-roslyn 13 | ## ts 14 | # nodePackages_latest.prettier 15 | typescript 16 | dprint 17 | nodePackages_latest.typescript-language-server 18 | nodePackages_latest.vscode-langservers-extracted 19 | ## python 20 | ruff-lsp 21 | # nodePackages_latest.pyright 22 | inputs.roslyn-language-server.packages.${pkgs.system}.roslyn-language-server 23 | netcoredbg 24 | ]; 25 | programs.helix = { 26 | package = inputs.helix.packages.${pkgs.system}.default; 27 | enable = true; 28 | defaultEditor = true; 29 | settings = { 30 | theme = "gruvbox_dark_hard"; 31 | editor = { 32 | line-number = "relative"; 33 | bufferline = "multiple"; 34 | color-modes = true; 35 | cursorline = true; 36 | auto-format = true; 37 | end-of-line-diagnostics = "hint"; 38 | inline-diagnostics = { 39 | cursor-line = "hint"; 40 | }; 41 | lsp = { 42 | display-messages = true; 43 | display-inlay-hints = true; 44 | }; 45 | popup-border = "popup"; 46 | statusline.left = [ 47 | "mode" 48 | "spinner" 49 | "spacer" 50 | "version-control" 51 | "file-name" 52 | "diagnostics" 53 | "read-only-indicator" 54 | "file-modification-indicator" 55 | "spacer" 56 | ]; 57 | 58 | statusline.right = [ 59 | "workspace-diagnostics" 60 | "register" 61 | "position" 62 | "selections" 63 | "file-encoding" 64 | "file-type" 65 | ]; 66 | idle-timeout = 50; 67 | completion-timeout = 100; 68 | indent-guides = { 69 | render = true; 70 | character = "│"; 71 | skip-levels = 1; 72 | }; 73 | soft-wrap = { 74 | enable = true; 75 | }; 76 | whitespace = { 77 | render = { 78 | space = "none"; 79 | tab = "all"; 80 | newline = "none"; 81 | }; 82 | characters = { 83 | nbsp = "·"; 84 | tab = "→"; 85 | }; 86 | }; 87 | 88 | }; 89 | keys = { 90 | normal = { 91 | space."=" = ":fmt"; 92 | 93 | # smart tab++ 94 | tab = "move_parent_node_end"; 95 | S-tab = "move_parent_node_start"; 96 | }; 97 | insert = { 98 | # smart tab ++ 99 | S-tab = "move_parent_node_start"; 100 | }; 101 | select = { 102 | # smart tab++ 103 | tab = "extend_parent_node_end"; 104 | S-tab = "extend_parent_node_start"; 105 | }; 106 | }; 107 | 108 | 109 | }; 110 | languages = { 111 | language-server.pyright.config.python.analysis.typeCheckingMode = "basic"; 112 | language-server.ruff = { 113 | command = "ruff-lsp"; 114 | config.settings.args = [ "--ignore" "E501" ]; 115 | }; 116 | language-server.roslyn = { 117 | command = "roslyn-language-server"; 118 | }; 119 | language = lib.flatten [ 120 | (map 121 | (x: { 122 | name = x; 123 | language-servers = [ "typescript-language-server" "eslint" ]; 124 | #formatter = { command = "dprint"; args = [ "fmt" "--stdin" x ]; }; 125 | # formatter = { command = "prettier"; args = [ "--parser" "typescript" ]; }; 126 | }) [ "typescript" "javascript" "jsx" "tsx" ]) 127 | { 128 | name = "nix"; 129 | formatter = { command = "nixpkgs-fmt"; }; 130 | } 131 | { 132 | name = "python"; 133 | language-servers = [ "pyright" "ruff" ]; 134 | } 135 | { 136 | name = "c-sharp"; 137 | language-servers = [ "roslyn" ]; 138 | formatter = { command = "dotnet"; args = [ "csharpier" ]; }; 139 | 140 | } 141 | ]; 142 | }; 143 | }; 144 | }; 145 | } 146 | -------------------------------------------------------------------------------- /hm-modules/nvim/config/lua/dark_notify.lua: -------------------------------------------------------------------------------- 1 | -- http://lua-users.org/wiki/StringTrim 2 | function trim6(s) 3 | return s:match '^()%s*$' and '' or s:match '^%s*(.*%S)' 4 | end 5 | 6 | -- from norcalli/nvim_utils 7 | function nvim_create_augroups(definitions) 8 | for group_name, definition in pairs(definitions) do 9 | vim.api.nvim_command('augroup ' .. group_name) 10 | vim.api.nvim_command('autocmd!') 11 | for _, def in ipairs(definition) do 12 | -- if type(def) == 'table' and type(def[#def]) == 'function' then 13 | -- def[#def] = lua_callback(def[#def]) 14 | -- end 15 | local command = table.concat(vim.tbl_flatten { 'autocmd', def }, ' ') 16 | vim.api.nvim_command(command) 17 | end 18 | vim.api.nvim_command('augroup END') 19 | end 20 | end 21 | 22 | local state = { 23 | initialized = false, 24 | pid = -1, 25 | stdin_handle = nil, 26 | config = {}, 27 | } 28 | 29 | local M = {} 30 | 31 | local function ensure_config() 32 | if state.config == nil then 33 | state.config = {} 34 | end 35 | end 36 | 37 | local function get_config() 38 | ensure_config() 39 | return state.config 40 | end 41 | 42 | local function edit_config(fn) 43 | ensure_config() 44 | fn(state.config) 45 | end 46 | 47 | local function apply_mode(mode) 48 | local config = get_config() 49 | local sel = config.schemes[mode] or {} 50 | local colorscheme = sel.colorscheme or nil 51 | local bg = sel.background or mode 52 | local lualineTheme = sel.lualine or nil 53 | 54 | vim.api.nvim_command('set background=' .. bg) 55 | if colorscheme ~= nil then 56 | vim.api.nvim_command('colorscheme ' .. colorscheme) 57 | end 58 | 59 | require('lualine').setup { options = { theme = lualineTheme } } 60 | 61 | if config.onchange ~= nil then 62 | config.onchange(mode) 63 | end 64 | 65 | state.current_mode = mode 66 | end 67 | 68 | function M.update() 69 | local mode = vim.fn.system('dark-notify --exit') 70 | mode = trim6(mode) 71 | apply_mode(mode) 72 | end 73 | 74 | function M.set_mode(mode) 75 | mode = trim6(mode) 76 | if not (mode == "light" or mode == "dark") then 77 | error("mode must be either \"light\" or \"dark\"" .. mode) 78 | return 79 | end 80 | apply_mode(mode) 81 | end 82 | 83 | function M.toggle() 84 | local mode = state.current_mode 85 | if mode == "light" then 86 | mode = "dark" 87 | elseif mode == "dark" then 88 | mode = "light" 89 | else 90 | M.update() 91 | return 92 | end 93 | apply_mode(mode) 94 | end 95 | 96 | local function init_dark_notify() 97 | -- Docs on this vim.loop stuff: https://github.com/luvit/luv 98 | 99 | local handle, pid 100 | local stdout = vim.loop.new_pipe(false) 101 | local stdin = vim.loop.new_pipe(false) 102 | 103 | local function onexit() 104 | vim.loop.close(handle, vim.schedule_wrap(function() 105 | vim.loop.shutdown(stdout) 106 | vim.loop.shutdown(stdin) 107 | state.initialized = false 108 | state.pid = nil 109 | state.stdin_handle = nil 110 | end)) 111 | end 112 | 113 | local function onread(err, chunk) 114 | assert(not err, err) 115 | if (chunk) then 116 | local mode = trim6(chunk) 117 | if not (mode == "light" or mode == "dark") then 118 | error("dark-notify output not expected: " .. chunk) 119 | return 120 | end 121 | apply_mode(mode) 122 | end 123 | end 124 | 125 | handle, pid = vim.loop.spawn( 126 | "dark-notify", 127 | { stdio = { stdin, stdout, nil } }, 128 | vim.schedule_wrap(onexit) 129 | ) 130 | 131 | vim.loop.read_start(stdout, vim.schedule_wrap(onread)) 132 | 133 | state.initialized = true 134 | state.pid = pid 135 | state.stdin_handle = stdin 136 | 137 | -- For whatever reason, nvim isn't killing child processes properly on exit 138 | -- So if you don't do this, you get zombie dark-notify processes hanging about. 139 | nvim_create_augroups({ 140 | DarkNotifyKillChildProcess = { 141 | { "VimLeave", "*", "lua require('dark_notify').stop()" }, 142 | } 143 | }) 144 | end 145 | 146 | -- For whatever reason, killing the child process doesn't work, at all. So we 147 | -- send it the line "quit\n", and it kills itself. 148 | function M.stop() 149 | if state.stdin_handle == nil then 150 | return 151 | end 152 | vim.loop.write(state.stdin_handle, "quit\n") 153 | -- process quits itself, calls onexit 154 | -- config gets edited from there 155 | end 156 | 157 | function M.configure(config) 158 | if config == nil then 159 | return 160 | end 161 | local lightline_loaders = config.lightline_loaders or {} 162 | local schemes = config.schemes or {} 163 | local onchange = config.onchange 164 | 165 | for _, mode in pairs({ "light", "dark" }) do 166 | if type(schemes[mode]) == "string" then 167 | schemes[mode] = { colorscheme = schemes[mode] } 168 | end 169 | end 170 | 171 | edit_config(function(conf) 172 | conf.lightline_loaders = lightline_loaders 173 | conf.schemes = schemes 174 | conf.onchange = onchange 175 | end) 176 | end 177 | 178 | function M.run(config) 179 | if config ~= nil or get_config().schemes == nil then 180 | -- if it's nil, it's a first run, so configure with no options. 181 | config = config or {} 182 | M.configure(config) 183 | end 184 | 185 | local config = get_config() 186 | if not config.initialized then 187 | -- first run on startup, also happens to apply current mode 188 | init_dark_notify() 189 | elseif state.current_mode ~= nil then 190 | -- we have run it before, but we're updating the settings 191 | -- so don't reset to system, but do apply changed config. 192 | local mode = state.current_mode 193 | apply_mode(mode) 194 | end 195 | end 196 | 197 | return M 198 | 199 | -- init.lua or init.vim in a lua < /tmp/curvimserver') 10 | endfunction 11 | ]] 12 | -------------------------------------------------------------------------------- /hm-modules/nvim/config/lua/keybindings.lua: -------------------------------------------------------------------------------- 1 | local map = require('utils').map 2 | 3 | -- split binds 4 | map { 'n', '', 'vertical resize -5', noremap = true, silent = true} 5 | map { 'n', '', 'vertical resize +5', noremap = true, silent = true} 6 | map { 'n', '', 'resize -5', noremap = true, silent = true} 7 | map { 'n', '', 'resize +5', noremap = true, silent = true} 8 | map { 'n', '', ' =', noremap = true, silent = true} 9 | 10 | map { 'n', '', 'vsp', noremap = true, silent = true} 11 | map { 'n', '', 'split', noremap = true, silent = true} 12 | 13 | map { 'n', '', 'h', noremap = true, silent = true} 14 | map { 'n', '', 'j', noremap = true, silent = true} 15 | map { 'n', '', 'k', noremap = true, silent = true} 16 | map { 'n', '', 'l', noremap = true, silent = true} 17 | 18 | -- telescope 19 | map { 'n', 'b', 'Telescope buffers', noremap = false, silent = true} 20 | --map { 'n', 'ff', 'Telescope find_files', noremap = false, silent = true} 21 | map { 'n', 's', 'Telescope live_grep', noremap = false, silent = true} 22 | map { 'n', '', 'Telescope registers', noremap = false, silent = true} 23 | --map { 'n', 'pp', 'lua require\'telescope\'.extensions.projects.projects{}', noremap = false, silent = true} 24 | -- tab binds 25 | map { 'n', '', 'tabnew', noremap = false, silent = true} 26 | map { 'n', '', 'tabprevious', noremap = false, silent = true} 27 | map { 'n', '', 'tabnext', noremap = false, silent = true} 28 | 29 | -- copy paste 30 | map { 'v', '', '"+y', noremap = true, silent = true} 31 | --map { 'n', '', '"+P', noremap = false, silent = true} 32 | 33 | -- sudo :w 34 | map { 'c', 'w!!', 'w !sudo tee > /dev/null %', noremap = false, silent = false} 35 | 36 | -- vimspector 37 | map { 'n', 'di', 'VimspectorBalloonEval', noremap = false, silent = false } 38 | map { 'x', 'di', 'VimspectorBalloonEval', noremap = false, silent = false } 39 | 40 | -- terminal 41 | -- map { 'n', 't', ':term', noremap = false, silent = true} 42 | -- map { 't', '', '', noremap = true, silent = true} 43 | 44 | -- plugins - nnn 45 | map { 'n', '', ':NnnPicker %:p:h', noremap = true, silent = true} 46 | map { 'n', '', ':NnnExplorer %:p:h', noremap = true, silent = true} 47 | 48 | -- plugins - terminal 49 | map {"n", "gg", "lua _lazygit_toggle()", {noremap = true, silent = true}} 50 | map {"n", "gl", "lua _glab_toggle()", {noremap = true, silent = true}} 51 | map {"n", "gh", "lua _ghub_toggle()", {noremap = true, silent = true}} 52 | 53 | -- diagnostic 54 | map {"n", "e", "lua require\'telescope.builtin\'.lsp_diagnostics{}", { noremap = true, silent = true}} 55 | map {"n", "q", "lua vim.diagnostic.setloclist()", { noremap = true, silent = true}} 56 | map {"n", "]g", "lua vim.diagnostic.goto_next()", { noremap = true, silent = true}} 57 | map {"n", "[g", "lua vim.diagnostic.goto_prev()", { noremap = true, silent = true}} 58 | -- dap 59 | map {"n", "db", "lua require'dap'.toggle_breakpoint()", { noremap = true, silent = true}} 60 | map {"n", "du", "lua require'dapui'.toggle()", { noremap = true, silent = true}} 61 | map {"n", "dc", "lua require'dap'.continue()", { noremap = true, silent = true}} 62 | map {"n", "dr", "lua require'dap'.repl.open()", { noremap = true, silent = true}} 63 | map {"n", "di", "lua require'dap'.step_into()", { noremap = true, silent = true}} 64 | -- cp 65 | map {"n", "c", "Copilot panel", { noremap = true, silent = true}} 66 | vim.cmd [[ 67 | imap