Compare commits

..

No commits in common. "master" and "mdt" have entirely different histories.
master ... mdt

12 changed files with 300 additions and 135 deletions

View File

@ -24,14 +24,7 @@ jobs:
# known_hosts: ${{ secrets.SSH_GITEA_KNOWN_HOSTS }}
#- name: Fix SSH key
# run: sed -i 's/\r$//g' /root/.ssh/gitea_action
- uses: cachix/install-nix-action@v31
name: Install Nix
- name: Setup Attic Cache
uses: ryanccn/attic-action@3354ae812cb672e1381be4c7914204c44db53866
with:
endpoint: ${{ secrets.ATTIC_ENDPOINT }}
cache: ${{ secrets.ATTIC_CACHE }}
token: ${{ secrets.ATTIC_TOKEN }}
- uses: cachix/install-nix-action@v20
- run: nix flake update
- run: nix flake check
- uses: stefanzweifel/git-auto-commit-action@v4

118
flake.lock generated
View File

@ -8,11 +8,11 @@
]
},
"locked": {
"lastModified": 1749574455,
"narHash": "sha256-fm2/8KPOYvvIAnNVtjDlTt/My00lIbZQ+LMrfQIWVzs=",
"lastModified": 1742999260,
"narHash": "sha256-wgeb7kSod9MAGm39MsVLsy2zxSbtCtckCkgfbjg6TLM=",
"owner": "nix-community",
"repo": "NixOS-WSL",
"rev": "917af390377c573932d84b5e31dd9f2c1b5c0f09",
"rev": "64d679540fa4d7e2afdbbb53ea63e3e5019c1f52",
"type": "github"
},
"original": {
@ -65,11 +65,11 @@
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1747046372,
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
"lastModified": 1733328505,
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"type": "github"
},
"original": {
@ -85,11 +85,11 @@
]
},
"locked": {
"lastModified": 1747688870,
"narHash": "sha256-ypL9WAZfmJr5V70jEVzqGjjQzF0uCkz+AFQF7n9NmNc=",
"lastModified": 1742655702,
"narHash": "sha256-jbqlw4sPArFtNtA1s3kLg7/A4fzP4GLk9bGbtUJg0JQ=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "d5f1f641b289553927b3801580598d200a501863",
"rev": "0948aeedc296f964140d9429223c7e4a0702a1ff",
"type": "github"
},
"original": {
@ -134,11 +134,11 @@
},
"nixpkgs-24-11": {
"locked": {
"lastModified": 1750330365,
"narHash": "sha256-hJ7XMNVsTnnbV2NPmStCC07gvv5l2x7+Skb7hyUzazg=",
"lastModified": 1742937945,
"narHash": "sha256-lWc+79eZRyvHp/SqMhHTMzZVhpxkRvthsP1Qx6UCq0E=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d883b6213afa179b58ba8bace834f1419707d0ad",
"rev": "d02d88f8de5b882ccdde0465d8fa2db3aa1169f7",
"type": "github"
},
"original": {
@ -150,11 +150,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1750506804,
"narHash": "sha256-VLFNc4egNjovYVxDGyBYTrvVCgDYgENp5bVi9fPTDYc=",
"lastModified": 1742889210,
"narHash": "sha256-hw63HnwnqU3ZQfsMclLhMvOezpM7RSB0dMAtD5/sOiw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4206c4cb56751df534751b058295ea61357bbbaa",
"rev": "698214a32beb4f4c8e3942372c694f40848b360d",
"type": "github"
},
"original": {
@ -164,6 +164,38 @@
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1742578646,
"narHash": "sha256-GiQ40ndXRnmmbDZvuv762vS+gew1uDpFwOfgJ8tLiEs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "94c4dbe77c0740ebba36c173672ca15a7926c993",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1735554305,
"narHash": "sha256-zExSA1i/b+1NMRhGGLtNfFGXgLtgo+dcuzHzaWA6w3Q=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "0e82ab234249d8eee3e8c91437802b32c74bb3fd",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nomodoro": {
"flake": false,
"locked": {
@ -184,11 +216,11 @@
"nvim-web-devicons": {
"flake": false,
"locked": {
"lastModified": 1750462241,
"narHash": "sha256-6M9H/PQbiJH22Os/Fx2asHgdUmy4ZxTXOmiyX66jjNQ=",
"lastModified": 1742215722,
"narHash": "sha256-JKOvXJr1s2lpP5aeRE7OC3IeOrF5uJxg/Tal3eScd6g=",
"owner": "nvim-tree",
"repo": "nvim-web-devicons",
"rev": "19d6211c78169e78bab372b585b6fb17ad974e82",
"rev": "4c3a5848ee0b09ecdea73adcd2a689190aeb728c",
"type": "github"
},
"original": {
@ -198,6 +230,23 @@
"type": "github"
}
},
"parrot-nvim": {
"flake": false,
"locked": {
"lastModified": 1742298853,
"narHash": "sha256-sr0UHw/FtIKwVKQkihCNi1qkXuyOCb930fKWQfgmWmU=",
"owner": "frankroeder",
"repo": "parrot.nvim",
"rev": "3027b481ef58245147408455a13b61608a86885c",
"type": "github"
},
"original": {
"owner": "frankroeder",
"ref": "main",
"repo": "parrot.nvim",
"type": "github"
}
},
"pyproject-build-systems": {
"inputs": {
"nixpkgs": [
@ -259,6 +308,7 @@
"nixpkgs-24-11": "nixpkgs-24-11",
"nomodoro": "nomodoro",
"nvim-web-devicons": "nvim-web-devicons",
"parrot-nvim": "parrot-nvim",
"sops-nix": "sops-nix",
"spaceport-nvim": "spaceport-nvim",
"systems": "systems",
@ -268,16 +318,14 @@
},
"sops-nix": {
"inputs": {
"nixpkgs": [
"nixpkgs-24-11"
]
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1750119275,
"narHash": "sha256-Rr7Pooz9zQbhdVxux16h7URa6mA80Pb/G07T4lHvh0M=",
"lastModified": 1742700801,
"narHash": "sha256-ZGlpUDsuBdeZeTNgoMv+aw0ByXT2J3wkYw9kJwkAS4M=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "77c423a03b9b2b79709ea2cb63336312e78b72e2",
"rev": "67566fe68a8bed2a7b1175fdfb0697ed22ae8852",
"type": "github"
},
"original": {
@ -289,11 +337,11 @@
"spaceport-nvim": {
"flake": false,
"locked": {
"lastModified": 1749075311,
"narHash": "sha256-Bgah2+Xg0Uva4wNJZ492SDMEPvXU+xssq/0Q0T0djxQ=",
"lastModified": 1742672154,
"narHash": "sha256-72jL1ww+6DB3UwRY/oa7YYu2E6RIp2OT67Rri5hWumg=",
"owner": "CWood-sdf",
"repo": "spaceport.nvim",
"rev": "b60383b708ec4dbd8ea9728ed04a784657dd231e",
"rev": "9b9493ed5802620fa94f8df79bf0db83317220b1",
"type": "github"
},
"original": {
@ -337,16 +385,14 @@
},
"treefmt-nix_2": {
"inputs": {
"nixpkgs": [
"nixpkgs-24-11"
]
"nixpkgs": "nixpkgs_4"
},
"locked": {
"lastModified": 1749194973,
"narHash": "sha256-eEy8cuS0mZ2j/r/FE0/LYBSBcIs/MKOIVakwHVuqTfk=",
"lastModified": 1742982148,
"narHash": "sha256-aRA6LSxjlbMI6MmMzi/M5WH/ynd8pK+vACD9za3MKLQ=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "a05be418a1af1198ca0f63facb13c985db4cb3c5",
"rev": "61c88349bf6dff49fa52d7dfc39b21026c2a8881",
"type": "github"
},
"original": {
@ -383,11 +429,11 @@
"zsh-completions": {
"flake": false,
"locked": {
"lastModified": 1749690964,
"narHash": "sha256-xjGx1kvWioVwSS/n1rcud83ZtGZzZoUp+xx+sfu8hJU=",
"lastModified": 1741777219,
"narHash": "sha256-9s9EkorKNH1DrA9rKUl/4aGIZY+7+EyryZ/69365te0=",
"owner": "zsh-users",
"repo": "zsh-completions",
"rev": "e07f6fb780725e9c0f50a7666700cf91ded30222",
"rev": "e61c9c14d6978191762e9586a0c882114e49221d",
"type": "github"
},
"original": {

View File

@ -5,15 +5,8 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-24-11.url = "github:NixOS/nixpkgs/nixos-24.11";
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs-24-11";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs-24-11";
};
treefmt-nix.url = "github:numtide/treefmt-nix";
sops-nix.url = "github:Mic92/sops-nix";
NixOS-WSL-2411 = {
url = "github:nix-community/NixOS-WSL";
@ -35,10 +28,10 @@
flake = false;
};
# parrot-nvim = {
# url = "github:frankroeder/parrot.nvim/main";
# flake = false;
# };
parrot-nvim = {
url = "github:frankroeder/parrot.nvim/main";
flake = false;
};
nomodoro = {
url = "github:dbinagi/nomodoro/main";
@ -84,7 +77,7 @@
inherit spaceport-nvim;
inherit inputs;
inherit nomodoro;
# parrot-nvim = inputs.parrot-nvim;
parrot-nvim = inputs.parrot-nvim;
}).overlay;
# Small tool to iterate over each systems
eachSystem = f: nixpkgs.lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system});

View File

@ -5,5 +5,5 @@ creation_rules:
- path_regex: secrets.yaml$
key_groups:
- age:
- *nixosEggYoke
- *nixosWSL
- *nixosEggYoke
- *nixosWSL

View File

@ -37,8 +37,7 @@ in
pkgs.glow
# lsps
# pkgs.nil
pkgs.nixd
pkgs.nil
# pkgs.nodePackages.pyright
pkgs.pyright
@ -81,7 +80,6 @@ in
home.sessionVariables =
let
win_home_dir = specialArgs.win_home_dir or "/mnt/c/Users/Deepak";
obsidian_dir = specialArgs.obsidian_dir or "/mnt/c/Users/Deepak/Documents/vault01";
in
{
# Namespace our own nixconf variables with DPK
@ -91,7 +89,7 @@ in
# Different per host
#
DPK_WIN_HOME_DIR = "${win_home_dir}";
DPK_OBSIDIAN_DIR = "${obsidian_dir}";
DPK_OBSIDIAN_DIR = "/mnt/c/Users/Deepak/Documents/vault01";
# UV_PYTHON = "${default_python}";
};
@ -157,8 +155,6 @@ in
cmp_luasnip
nvim-lspconfig
guess-indent-nvim
vim-tmux-navigator
# vim-vinegar
oil-nvim
@ -195,7 +191,7 @@ in
pkgs.customVimPlugins.cmp-vimtex
# pkgs.customVimPlugins.spaceport-nvim
pkgs.customVimPlugins.nomodoro
# pkgs.customVimPlugins.parrot-nvim
pkgs.customVimPlugins.parrot-nvim
pkgs.customVimPlugins.nvim-web-devicons
# syntax highlighting
@ -256,7 +252,6 @@ in
programs.tmux = {
enable = true;
package = pkgs-unstable.tmux;
historyLimit = 100000;
clock24 = true;
keyMode = "vi";
@ -297,11 +292,8 @@ in
unbind %
set -s copy-command 'xsel -bi'
bind -N "Change layout" -T prefix % next-layout
bind -N "Horizontal split" -T prefix | split-window -h -c '#{pane_current_path}'
bind -N "Horizontal split" -T prefix \\ split-window -h -c '#{pane_current_path}'
bind -N "Vertical split" -T prefix - split-window -v -c '#{pane_current_path}'
bind -N "Create a new window" -T prefix c new-window -c '#{pane_current_path}'
bind -N "Quick pane for obsidian todos" -T prefix . split-window -c $DPK_OBSIDIAN_DIR -h "vim todos.md"
bind -N "Horizontal split" -T prefix | split-window -h
bind -N "Vertical split" -T prefix - split-window -v
bind -N "Enter copy mode" -T prefix Space copy-mode
bind -N "Load buffer from xsel and paste" -T prefix C-p run "xsel -ob | tmux load-buffer - ; tmux paste-buffer"
set -g escape-time 1
@ -320,49 +312,6 @@ in
freshrss-url "https://freshrss.deepak.science/api/greader.php"
freshrss-login "deepak"
freshrss-passwordfile "${config.sops.secrets.freshrssapikey.path}"
## ## ## ## ## ## ##
## ## Stolen from https://forums.freebsd.org/threads/newsboat-rss-reader-enable-vim-key-bindings.69448/
## ##
## ## Disabling the browser but could consider using w3m?
## ##
## ## ## ## ## ## ##
# general settings
auto-reload yes
max-items 50
# externel browser
# browser "/usr/local/bin/w3m %u"
# macro m set browser "/usr/local/bin/mpv %u"; open-in-browser ; set browser "/usr/local/bin/w3m %u"
# macro l set browser "/usr/local/bin/firefox %u"; open-in-browser ; set browser "/usr/local/bin/w3m %u"
# unbind keys
# unbind-key ENTER
unbind-key j
unbind-key k
unbind-key J
unbind-key K
# bind keys - vim style
bind-key j down
bind-key k up
# bind-key l open
# bind-key h quit
# solarized
color background default default
color listnormal default default
color listnormal_unread default default
color listfocus black cyan
color listfocus_unread black cyan
color info default black
color article default default
# highlights
highlight article "^(Title):.*$" blue default
highlight article "https?://[^ ]+" red default
highlight article "\\[image\\ [0-9]+\\]" green default
'';
};

View File

@ -1,5 +1,4 @@
{ ... }:
# ^ passing in config for things as needed but we don't use it currently
{ config }:
''
inoremap jj <Esc>
inoremap kk <Esc>
@ -77,7 +76,7 @@
require('flash').setup()
vim.keymap.set('n', "<leader>ft", function() require("flash").toggle() end, {desc = "Toggle flash.nvim search", noremap = true})
require('guess-indent').setup {}
require('which-key').setup({})
${builtins.readFile ./lsp.lua}
vim.keymap.set('n', "]d", vim.diagnostic.goto_next, { noremap = true, desc = "Next diagnostic" })
@ -93,6 +92,170 @@
vim.g.vimtex_fold_enabled = true
${builtins.readFile ./overseer.lua}
require("parrot").setup({
providers = {
anthropic = {
api_key = { "cat", "${config.sops.secrets.anthropic_api_key.path}" },
},
},
hooks = {
Complete = function(prt, params)
local template = [[
I have the following code from {{filename}}:
```{{filetype}}
{{selection}}
```
Please finish the code above carefully and logically.
Respond just with the snippet of code that should be inserted."
]]
local model_obj = prt.get_model "command"
prt.Prompt(params, prt.ui.Target.append, model_obj, nil, template)
end,
CompleteFullContext = function(prt, params)
local template = [[
I have the following code from {{filename}}:
```{{filetype}}
{{filecontent}}
```
Please look at the following section specifically:
```{{filetype}}
{{selection}}
```
Please finish the code above carefully and logically.
Respond just with the snippet of code that should be inserted.
]]
local model_obj = prt.get_model "command"
prt.Prompt(params, prt.ui.Target.append, model_obj, nil, template)
end,
CompleteMultiContext = function(prt, params)
local template = [[
I have the following code from {{filename}} and other realted files:
```{{filetype}}
{{multifilecontent}}
```
Please look at the following section specifically:
```{{filetype}}
{{selection}}
```
Please finish the code above carefully and logically.
Respond just with the snippet of code that should be inserted.
]]
local model_obj = prt.get_model "command"
prt.Prompt(params, prt.ui.Target.append, model_obj, nil, template)
end,
Explain = function(prt, params)
local template = [[
Your task is to take the code snippet from {{filename}} and explain it with gradually increasing complexity.
Break down the code's functionality, purpose, and key components.
The goal is to help the reader understand what the code does and how it works.
```{{filetype}}
{{selection}}
```
Use the markdown format with codeblocks and inline code.
Explanation of the code above:
]]
local model = prt.get_model "command"
prt.logger.info("Explaining selection with model: " .. model.name)
prt.Prompt(params, prt.ui.Target.new, model, nil, template)
end,
ProofReader = function(prt, params)
local chat_prompt = [[
I want you to act as a proofreader. I will provide you with texts and
I would like you to review them for any spelling, grammar, or
punctuation errors. Once you have finished reviewing the text,
provide me with any necessary corrections or suggestions to improve the
text. Highlight the corrected fragments (if any) using markdown backticks.
When you have done that subsequently provide me with a slightly better
version of the text, but keep close to the original text.
Finally provide me with an ideal version of the text.
For each of these versions, you can elide sections which include long unchanged text with NO_CHANGES_HERE.
Whenever I provide you with text, you reply in this format directly:
## Summary of suggestions:
{a brief list of spelling, grammar and punctuation errors, with brief snippets of the original text so I can search and find each change, followed by summaries of what types of changes are in the slightly better and ideal versions}
## Corrected text:
{corrected text, or say "NO_CORRECTIONS_NEEDED" instead if there are no corrections made}
## Slightly better text
{slightly better text}
## Ideal text
{ideal text}
]]
prt.ChatNew(params, chat_prompt)
end,
ProofReader2 = function(prt, params)
local chat_prompt = [[
I want you to act as a professional proofreader and editor. When I provide you with text, please:
1. First, identify and correct errors in
- spelling
- grammar
- punctuation
- syntax errors.
- Technical accuracy (for domain-specific content especially)
Mark corrections using markdown backticks.
2. Second, analyze stylistic elements including
- clarity
- conciseness
- word choice
- sentence structure
- paragraph organization and transitions (as appropriate for text length)
3. Provide your response in this structured format:
# Summary of the text:
Provide a concise overview of the text (1-2 sentences).
For longer texts (5+ paragraphs), include a brief outline of the content.
## Summary of suggestions:
- List specific errors found with brief context
- Group similar issues together
- Note patterns if they exist
- Highlight 3-5 most impactful improvements
- Summarize the types of improvements made in each version
## Corrected text:
Present the text with technical errors fixed (or state "NO_CORRECTIONS_NEEDED" if appropriate)
## Enhanced text:
Provide a version with moderate improvements to readability and flow while preserving the original voice and style. You may use [NO_CHANGES_HERE] to indicate substantial unchanged sections to keep your response more concise.
## Optimal text:
Present an ideal version that maintains the original intent but optimizes for clarity, impact, and professional quality. Use [NO_CHANGES_HERE] as mentioned above.
Please maintain the original meaning and tone while making your suggestions. If you're uncertain about the author's intent in any section, note this and provide alternative interpretations.
For very long texts, focus on the most impactful improvements.
]]
prt.ChatNew(params, chat_prompt)
end,
},
})
vim.api.nvim_set_keymap("n", "<leader>pt", "<cmd>PrtChatToggle<CR>", { noremap = true})
require("nomodoro").setup({
work_time = 10,

View File

@ -20,8 +20,7 @@ cmp.setup({
end,
},
},
{ name = "luasnip", option = { show_autosnippets = true } },
-- { name = "luasnip" },
{ name = "luasnip" },
{ name = "vimtex" },
},
formatting = cmp_format,
@ -44,6 +43,5 @@ cmp.setup({
end,
},
})
-- require("lspconfig").nil_ls.setup({})
require("lspconfig").nil_ls.setup({})
require("lspconfig").pyright.setup({})
require("lspconfig").nixd.setup({})

View File

@ -26,7 +26,7 @@ require("lualine").setup({
icons_enabled = false,
},
require("nomodoro").status,
-- parrot_status,
parrot_status,
},
lualine_x = {
"encoding",

View File

@ -52,7 +52,6 @@ in
];
trusted-substituters = [ "http://attic.baklava" ];
trusted-public-keys = [ "systems:tvbHIThn7MAwvgMSiYR3ULVlL6cBrA40afqGuextnNQ=" ];
download-buffer-size = 524288000;
};
nixpkgs.overlays = [

View File

@ -16,6 +16,34 @@ let
};
in
{
"maxos" = inputs.nixpkgs-24-11.lib.nixosSystem {
system = linuxSystem;
specialArgs = {
inherit customPackageOverlay;
inherit nixpkgs-unstable;
withDocker = false;
};
modules = [
./maxos/configuration.nix
inputs.sops-nix.nixosModules.sops
inputs.homeManager-24-11.nixosModules.home-manager
{
home-manager.extraSpecialArgs = {
withGUI = true;
gitSigningKey = "976F3357369149AB";
rundirnum = "1000";
inherit nixpkgs-unstable;
};
home-manager.useGlobalPkgs = true;
home-manager.users.deepak = {
imports = [ ../home/deepak/home.nix ];
};
home-manager.sharedModules = [
inputs.sops-nix.homeManagerModules.sops
];
}
];
};
"nixosWalrus" = inputs.nixpkgs-24-11.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
@ -39,7 +67,6 @@ in
home-manager.extraSpecialArgs = {
withGUI = false;
gitSigningKey = "8F904A3FC7021497";
obsidian_dir = "/mnt/d/applications/obsidian/vault01";
inherit nixpkgs-unstable;
};
home-manager.useGlobalPkgs = true;

View File

@ -2,7 +2,7 @@
cmp-vimtex,
spaceport-nvim,
nomodoro,
# parrot-nvim,
parrot-nvim,
inputs,
}:
let
@ -22,10 +22,10 @@ let
name = "nomodoro";
};
# parrotNvimPlugin = prev.vimUtils.buildVimPlugin {
# src = parrot-nvim;
# name = "parrot-nvim";
# };
parrotNvimPlugin = prev.vimUtils.buildVimPlugin {
src = parrot-nvim;
name = "parrot-nvim";
};
nvimWebDeviconPlugin = prev.vimUtils.buildVimPlugin {
src = inputs.nvim-web-devicons;
@ -42,7 +42,7 @@ let
cmp-vimtex = cmpVimtexPlugin;
spaceport-nvim = spaceportNvimPlugin;
nomodoro = nomodoroNvimPlugin;
# parrot-nvim = parrotNvimPlugin;
parrot-nvim = parrotNvimPlugin;
nvim-web-devicons = nvimWebDeviconPlugin;
};

View File

@ -18,9 +18,6 @@
programs.nixfmt.enable = true;
programs.shellcheck.enable = true;
settings.formatter.shellcheck = {
excludes = [ "*.envrc*" ];
};
programs.shfmt.enable = true;
settings.formatter.shfmt.indent_size = 0;