Compare commits

..

No commits in common. "266c981cd4f3a1243daa8ecf77236da41f5295b3" and "f01e535157d2d62794fd2c6fb3d2c264e03e8049" have entirely different histories.

34 changed files with 260 additions and 607 deletions

3
.gitignore vendored
View file

@ -1,4 +1 @@
.direnv/
.direnv/*
.direnv/**
.envrc

View file

@ -40,8 +40,7 @@ D('sealight.xyz', REG_NONE, DnsProvider(DNS_HEDNS),
A('bin', '69.61.2.203', TTL(300)),
A('ci', '69.61.2.203', TTL(300)),
A('write', '69.61.2.203', TTL(300)),
A('photos', '69.61.2.203', TTL(300)),
// vultr: lituus
// vultr -> nulled: lituus
A('@', '45.77.48.108', TTL(300)),
A('jitsi', '45.77.48.108', TTL(300)),
A('chat', '45.77.48.108', TTL(300)),

View file

@ -270,16 +270,16 @@
]
},
"locked": {
"lastModified": 1751810233,
"narHash": "sha256-kllkNbIqQi3VplgTMeGzuh1t8Gk8TauvkTRt93Km+tQ=",
"lastModified": 1736373539,
"narHash": "sha256-dinzAqCjenWDxuy+MqUQq0I4zUSfaCvN9rzuCmgMZJY=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "9b0873b46c9f9e4b7aa01eb634952c206af53068",
"rev": "bd65bc3cde04c16755955630b344bc9e35272c56",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-25.05",
"ref": "release-24.11",
"repo": "home-manager",
"type": "github"
}
@ -354,16 +354,16 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1755274400,
"narHash": "sha256-rTInmnp/xYrfcMZyFMH3kc8oko5zYfxsowaLv1LVobY=",
"lastModified": 1738277201,
"narHash": "sha256-6L+WXKCw5mqnUIExvqkD99pJQ41xgyCk6z/H9snClwk=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "ad7196ae55c295f53a7d1ec39e4a06d922f3b899",
"rev": "666e1b3f09c267afd66addebe80fb05a5ef2b554",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-25.05",
"ref": "nixos-24.11",
"repo": "nixpkgs",
"type": "github"
}
@ -534,11 +534,11 @@
},
"unstable": {
"locked": {
"lastModified": 1752687322,
"narHash": "sha256-RKwfXA4OZROjBTQAl9WOZQFm7L8Bo93FQwSJpAiSRvo=",
"lastModified": 1738410390,
"narHash": "sha256-xvTo0Aw0+veek7hvEVLzErmJyQkEcRk6PSR4zsRQFEc=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "6e987485eb2c77e5dcc5af4e3c70843711ef9251",
"rev": "3a228057f5b619feb3186e986dbe76278d707b6e",
"type": "github"
},
"original": {

View file

@ -3,7 +3,7 @@
inputs = {
# Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
@ -11,7 +11,7 @@
# ngipkgs-local.url = "path:/home/anish/usr/ngipkgs";
# Home manager
home-manager.url = "github:nix-community/home-manager/release-25.05";
home-manager.url = "github:nix-community/home-manager/release-24.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
hardware.url = "github:nixos/nixos-hardware";
@ -95,7 +95,7 @@
tidalcycles.overlays.default
agenix.overlays.default
nur.overlay
# nix-matrix-appservices.overlay # nixpkgs has these packages and newer ones at that
nix-matrix-appservices.overlay
unstableOverlay
vimwikiOverlay
self.overlays.additions
@ -251,7 +251,7 @@
};
lituus = {
hostname = "sealight.xyz";
autoRollback = false;
# autoRollback = false;
profiles.system = {
user = "root";
path = deploy-rs.lib.x86_64-linux.activate.nixos

View file

@ -4,7 +4,7 @@
../profiles/cli
../profiles/direnv
../profiles/git
../profiles/tmux
# ../profiles/tmux
];
home.stateVersion = "22.05";
}

View file

@ -11,22 +11,4 @@
../profiles/ssh
../profiles/task
];
# GPG configuration for user session
services.gpg-agent = {
enable = true;
pinentry.package = pkgs.pinentry-rofi; # Use rofi for consistency with desktop theme
enableSshSupport = true;
defaultCacheTtl = 28800; # 8 hours
maxCacheTtl = 86400; # 24 hours
extraConfig = ''
pinentry-program ${pkgs.writeShellScript "pinentry-rofi-themed" ''
exec ${pkgs.pinentry-rofi}/bin/pinentry-rofi -theme ~/.config/rofi/theme/passmenu.rasi "$@"
''}
'';
};
programs.gpg = {
enable = true;
};
}

View file

@ -61,8 +61,7 @@
fontconfig
pandoc
taskwarrior-tui
# vimwiki-cli
zk
vimwiki-cli
(pkgs.writeScriptBin "jq-repl" ''
#!/usr/bin/env bash
@ -96,15 +95,10 @@
# Turn it on if it was off
xrandr --output HDMI-2 --auto
xrandr --output HDMI-2 --same-as eDP-1
xrandr --output eDP-1 --off
pkill -9 polybar
feh --bg-scale ~/Downloads/stephen-walker-onIXxjH56AA-unsplash.jpg
polybar mybar > $XDG_DATA_HOME/polybar.log 2>&1 &
}
disconnect() {
xrandr --output HDMI-2 --off
xrandr --output eDP-1 --auto
}
xrandr | grep "HDMI-2 connected" &>>/dev/null && connect || disconnect
@ -154,7 +148,7 @@
enableCompletion = true;
autosuggestion.enable = false;
initContent = ''
initExtra = ''
bindkey -v
autopair-init
'';

View file

@ -31,9 +31,8 @@ in
inotify-tools
offpunk
termpdfpy
# libsForQt5.kontact
libsForQt5.kontact
thunderbird
libsecret # For secret-tool to manage keyring
];
# GTK4 color scheme?
@ -74,7 +73,7 @@ in
#gtk4 theme
".config/gtk-4.0/settings.ini".text = ''
[Settings]
gtk-application-prefer-dark-theme=true
gtk-application-prefer-dark-theme=1
'';
# gtk3 theme
".config/gtk-3.0/settings.ini".text = ''

View file

@ -8,10 +8,6 @@ open_url_with default
mouse_map left click ungrabbed mouse_click_url_or_select
confirm_os_window_close 0
enable_audio_bell no
# Ctrl+V for paste
map ctrl+v paste_from_clipboard
-- Allows zen-mode.nvim to increase font size
-- allow_remote_control socket-only
-- listen_on unix:/tmp/kitty

View file

@ -18,7 +18,7 @@
isDefault = true;
name = "anish";
userChrome = (builtins.readFile ./userChrome.css);
extensions.packages = with pkgs.nur.repos.rycee.firefox-addons; [
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
# Find extensions: https://github.com/nix-community/nur-combined/blob/master/repos/rycee/pkgs/firefox-addons/generated-firefox-addons.nix
ublock-origin
# wallabagger

View file

@ -8,29 +8,13 @@
/*** NAV BAR ***/
/* Hide urlbar */
#nav-bar {
/* customize this value. */
--navbar-margin: -55px;
margin-top: var(--navbar-margin);
margin-bottom: 0;
z-index: -100;
transition: all 0.3s ease !important;
opacity: 0;
}
#navigator-toolbox:focus-within > #nav-bar,
#navigator-toolbox:hover > #nav-bar
{
margin-top: 0;
margin-bottom: var(--navbar-margin);
z-index: 100;
opacity: 1;
}
#main-window[chromehidden*="toolbar"] {
visibility: collapse;
height: -55px !important;
min-height: -55px !important;
position: relative !important;
z-index: 2 !important;
height: 2px !important;
min-height: 2px !important;
margin-bottom: -2px !important;
opacity: 0 !important;
border: none !important;
}
/* But unfocus it when we invoke it with ctrl+L */
@ -53,11 +37,10 @@
height: 28px !important;
}
/* hides the sidebar header
/* hides the sidebar header */
#sidebar-header {
display: none !important;
}
*/
.tab[selected="true"] {
visibility: collapse;
@ -70,153 +53,73 @@
.tabbrowser-tab[visuallyselected="true"] {
visibility: collapse;
}
/* Credits to https://github.com/MrOtherGuy for hthe following snippet*/
/* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/autohide_sidebar.css made available under Mozilla Public License v. 2.0
See the above repository for updates as well as full license text. */
/* Show sidebar only when the cursor is over it.
The border controlling sidebar width will be removed so you'll need to modify
these values to change width.
By default the internal layout of sidebar changes when hovered, but this can
be changed by setting pref "userchrome.autohide-sidebar.static-layout.enabled" to true
*/
/* Show sidebar only when the cursor is over it */
/* The border controlling sidebar width will be removed so you'll need to modify these values to change width */
/* Note: If you want only *some* sidebar to be auto-hidden, then you can use [sidebarcommand] attribute selector.
For example, to only affect Sidebery's sidebar replace all instances of #sidebar-box with
#sidebar-box[sidebarcommand="_3c078156-979c-498b-8990-85f7987dd929_-sidebar-action"].
To find the sidebarcommand value for any other sidebar, open that sidebar and use Browser Toolbox to inspect it.
See: https://firefox-source-docs.mozilla.org/devtools-user/browser_toolbox/index.html
*/
/* The whole thing
:where(#main-window) #browser{
--uc-sidebar-width: 240px;
--uc-sidebar-hover-width: 210px;
}
#main-window[sizemode="fullscreen"] #browser{
--uc-sidebar-width: 1px;
}
#sidebar-box{
--uc-sidebar-width: 44px; /* Only thing I (gale) changed */
--uc-sidebar-hover-width: 210px;
--uc-autohide-sidebar-delay: 600ms; /* Wait 0.6s before hiding sidebar */
--uc-autohide-transition-duration: 115ms;
--uc-autohide-transition-type: linear;
--browser-area-z-index-sidebar: 3;
position: relative;
min-width: var(--uc-sidebar-width) !important;
width: var(--uc-sidebar-width) !important;
max-width: var(--uc-sidebar-width) !important;
z-index: var(--browser-area-z-index-sidebar,3);
background-color: inherit;
/* This directionality flipper is played so that sidebar "grows" into the right direction */
direction: ltr;
&:is([positionend],[sidebar-positionend]):not(:-moz-locale-dir(rtl)){
direction: rtl;
}
z-index:1;
}
.sidebar-browser-stack{
background: inherit;
}
#main-window[sizemode="fullscreen"] #browser{ --uc-sidebar-width: 1px; }
#sidebar-box[positionend]{ direction: rtl }
#sidebar-box[positionend] > *{ direction: ltr }
#sidebar-box[positionend]:-moz-locale-dir(rtl){ direction: ltr }
#sidebar-box[positionend]:-moz-locale-dir(rtl) > *{ direction: rtl }
#main-window[sizemode="fullscreen"] #sidebar-box{ --uc-sidebar-width: 1px; }
#sidebar-splitter{ display: none }
#sidebar-header{
overflow: hidden;
color: var(--chrome-color, inherit) !important;
padding-inline: 0 !important;
}
#sidebar-header{ overflow: hidden; /*color: var(--chrome-color, inherit) !important*/}
#sidebar-header::before,
#sidebar-header::after{
content: "";
display: flex;
padding-left: 8px;
}
#sidebar-header,
#sidebar{
transition: min-width var(--uc-autohide-transition-duration) var(--uc-autohide-transition-type) var(--uc-autohide-sidebar-delay) !important;
transition: min-width 115ms linear var(--uc-autohide-sidebar-delay) !important;
min-width: var(--uc-sidebar-width) !important;
will-change: min-width;
direction: ltr;
&:-moz-locale-dir(rtl){
direction: rtl;
}
}
#sidebar-box:hover > #sidebar-header,
#sidebar-box:hover > #sidebar,
#sidebar-box:hover > .sidebar-browser-stack > #sidebar{
min-width: var(--uc-sidebar-hover-width) !important;
transition-delay: 0ms !important;
}
#sidebar-box:hover > #sidebar{ min-width: var(--uc-sidebar-hover-width) !important; transition-delay: 0ms !important }
.sidebar-panel{
background-color: transparent !important;
color: var(--newtab-text-primary-color) !important;
/*background-color: transparent !important;
color: var(--newtab-text-primary-color) !important;*/
}
.sidebar-panel #search-box{
-moz-appearance: none !important;
background-color: rgba(249,249,250,0.1) !important;
/*background-color: rgba(249,249,250,0.1) !important;
color: inherit !important;
*/
}
/* Add sidebar divider and give it background */
#sidebar,
#sidebar-header{
background-color: inherit !important;
/*background-color: inherit !important;*/
border-inline: 1px solid rgb(80,80,80);
border-inline-width: 0px 1px;
}
#sidebar-box:not([positionend],[sidebar-positionend]) > :-moz-locale-dir(rtl),
#sidebar-box:is([positionend],[sidebar-positionend]) > *{
#sidebar-box:not([positionend]) > :-moz-locale-dir(rtl),
#sidebar-box[positionend] > *{
border-inline-width: 1px 0px;
}
@media -moz-pref("sidebar.revamp") {
#sidebar, #sidebar-header{ border-style: none }
#sidebar-box{ padding: 0 !important; }
}
/* Move statuspanel to the other side when sidebar is hovered so it doesn't get covered by sidebar */
#sidebar-box:not([positionend],[sidebar-positionend]):hover ~ #appcontent #statuspanel{
inset-inline: auto 0px !important;
}
#sidebar-box:not([positionend],[sidebar-positionend]):hover ~ #appcontent #statuspanel-label{
margin-inline: 0px !important;
border-left-style: solid !important;
}
@media -moz-pref("userchrome.autohide-sidebar.static-layout.enabled"){
#sidebar-box{
min-width: var(--uc-sidebar-width) !important;
contain: size;
box-shadow: var(--content-area-shadow);
}
#sidebar{
min-width: var(--uc-sidebar-hover-width) !important;
}
.sidebar-browser-stack{
overflow: hidden;
width: 100%;
transition: width var(--uc-autohide-transition-duration) var(--uc-autohide-transition-type) var(--uc-autohide-sidebar-delay);
direction: ltr;
&:hover{
transition-delay: 0ms;
width: var(--uc-sidebar-hover-width);
}
&:-moz-locale-dir(rtl){
transition-property: transform,width !important;
}
}
#sidebar-box[sidebar-positionend]:hover :is(#sidebar-header,#sidebar):-moz-locale-dir(ltr){
transform: translateX(0);
transition-delay: 0ms !important;
}
#sidebar-box:not([sidebar-positionend]):hover .sidebar-browser-stack:-moz-locale-dir(rtl){
transform: translateX(calc(-1 * var(--uc-sidebar-hover-width) + var(--uc-sidebar-width)));
}
#sidebar-box[sidebar-positionend]:hover > .sidebar-browser-stack:-moz-locale-dir(rtl){
transform: translateX(calc(var(--uc-sidebar-hover-width) - var(--uc-sidebar-width)));
transition-delay: 0ms !important;
}
}
*/
#sidebar-box:not([positionend]):hover ~ #appcontent #statuspanel{ inset-inline: auto 0px !important; }
#sidebar-box:not([positionend]):hover ~ #appcontent #statuspanel-label{ margin-inline: 0px !important; border-left-style: solid !important; }

View file

@ -10,7 +10,15 @@ let
sha256 = "1fzKmknfVlEYwqeXgbKITbb2/PJ023iJyMz6vak3qh4=";
};
};
lsp-format = pkgs.vimUtils.buildVimPlugin {
name = "lsp-format";
src = pkgs.fetchFromGitHub {
owner = "lukas-reineke";
repo = "lsp-format.nvim";
rev = "84e117b99bb2bc0d0c8122e2b256046f046f8aff";
sha256 = "rs3NTZwWdsmBGXnrgUeVxUiNjbN/ULxJHifPYJD9mT4=";
};
};
my-lspsaga = pkgs.vimUtils.buildVimPlugin {
name = "lspsaga.nvim";
src = pkgs.fetchFromGitHub {
@ -58,6 +66,16 @@ let
};
meta.homepage = "https://github.com/folke/which-key.nvim/";
};
scnvim = pkgs.vimUtils.buildVimPlugin {
pname = "scnvim";
version = "2022-06-04";
src = pkgs.fetchFromGitHub {
owner = "davidgranstrom";
repo = "scnvim";
rev = "746cc0db820d02a9c36b8f9ba2eac9725fa73107";
sha256 = "kvSwS6FNUY2Ue84NhWLLcm0ldLMSp4WqQ7s6TUoX6Cc=";
};
};
yuck-vim = pkgs.vimUtils.buildVimPlugin {
pname = "yuck.vim";
version = "2021-08-09";
@ -114,6 +132,11 @@ let
tasklib
pynvim
six
pylsp-mypy
#pyls-isort
#pyls-black
black
isort
# other python packages you want
];
python-with-my-packages = pkgs.python3.withPackages my-python-packages;
@ -182,7 +205,7 @@ in
set nobackup
set nowritebackup
" Better display for messages
set cmdheight=0
set cmdheight=2
" You will have bad experience for diagnostic messages when it's default 4000.
set updatetime=300
" don't give |ins-completion-menu| messages.
@ -191,7 +214,6 @@ in
set signcolumn=yes
" highlight row
set cursorline
set autoread
let mapleader = "\<Space>"
let maplocalleader = ","
@ -206,7 +228,19 @@ in
nmap <leader>rt :retab!<CR>
vmap <leader>rt :retab!<CR>
" Alt+hjkl navigation now handled by Navigator.nvim plugin
" moving splits with vim movements.
:tnoremap <A-h> <C-\><C-N><C-w>h
:tnoremap <A-j> <C-\><C-N><C-w>j
:tnoremap <A-k> <C-\><C-N><C-w>k
:tnoremap <A-l> <C-\><C-N><C-w>l
:inoremap <A-h> <C-\><C-N><C-w>h
:inoremap <A-j> <C-\><C-N><C-w>j
:inoremap <A-k> <C-\><C-N><C-w>k
:inoremap <A-l> <C-\><C-N><C-w>l
:nnoremap <A-h> <leader>h
:nnoremap <A-j> <leader>j
:nnoremap <A-k> <leader>k
:nnoremap <A-l> <leader>l
:nnoremap <F5> "=strftime("%Y-%m-%d %H:%M")<CR>
:inoremap <F5> <C-R>=strftime("%Y-%m-%d %H:%M")<CR>
:inoremap <F4> <C-R>=strftime("%H:%M")<CR>
@ -244,11 +278,11 @@ in
autocmd BufReadPost,BufNewFile c,clj,cljs RainbowParenthesesToggleAll
" general commands
map <leader>e :Neotree toggle<CR>
map <leader>t :NERDTreeToggle<CR>
map <leader>s :w<CR>
map <leader>q :q<CR>
map <leader>r :RainbowParenthesesToggleAll<CR>
nnoremap <Esc> :noh<CR>
nnoremap <BS> :noh<CR>
map Q <Nop>
nnoremap Y y$
nnoremap <leader>n :vnew<CR>
@ -279,11 +313,11 @@ in
:vmap <leader>sy "*y
:map <leader>sp :r!xclip -o<CR>
" buffer navigation (using built-in commands)
nnoremap <silent> gT :bprevious<CR>
nnoremap <silent> gt :bnext<CR>
nnoremap <silent> gj :buffers<CR>
nnoremap <silent> gq :bdelete<CR>
" barbar
nnoremap <silent> gT :BufferPrevious<CR>
nnoremap <silent> gt :BufferNext<CR>
nnoremap <silent> gj :BufferPick<CR>
nnoremap <silent> gq :BufferClose<CR>
" git
nnoremap <leader>ga :G fetch --all
@ -296,14 +330,14 @@ in
nnoremap <leader>gc :G commit -v -q %:p<CR>
" kitaab
"map <leader>cz :VimwikiIndex<CR>:ZettelNew
"map <leader>zs :ZettelSearch<CR>
map <leader>cz :VimwikiIndex<CR>:ZettelNew
map <leader>zs :ZettelSearch<CR>
map <leader>zn :ZettelNew<CR>
"map <leader>zo :ZettelOpen<CR>
"map <leader>zf :Telescope oldfiles only_cwd=true<CR>
"map <leader>wt :VimwikiMakeTomorrowDiaryNote
"map <leader>wd :VimwikiMakeYesterdayDiaryNote
"map <leader>zm :ZenMode<CR>:setlocal nospell<CR>
map <leader>zo :ZettelOpen<CR>
map <leader>zf :Telescope oldfiles only_cwd=true<CR>
map <leader>wt :VimwikiMakeTomorrowDiaryNote
map <leader>wd :VimwikiMakeYesterdayDiaryNote
map <leader>zm :ZenMode<CR>:setlocal nospell<CR>
let g:vimwiki_list = [{ 'path': '~/kitaab/vimwiki', 'auto_tags': 1, 'auto_diary_index': 1, 'auto_generate_links': 1 }]
let g:sync_taskwarrior = 0
let g:zettel_format = "%y%m%d-%H%M"
@ -334,22 +368,7 @@ in
nnoremap <leader>vsd :Lspsaga show_line_diagnostics<CR>
nnoremap <leader>vs :Dasht<Space>
nnoremap <leader>vn :Lspsaga diagnostic_jump_prev<CR>
nnoremap <leader>co :Outline<CR>
" Trouble keybindings
nnoremap <leader>xx :Trouble diagnostics<CR>
nnoremap <leader>xw :Trouble workspace_diagnostics<CR>
nnoremap <leader>xd :Trouble document_diagnostics<CR>
nnoremap <leader>xl :Trouble loclist<CR>
nnoremap <leader>xq :Trouble quickfix<CR>
nnoremap <leader>xr :Trouble lsp_references<CR>
" Yank to system clipboard (y operations only, not d)
nnoremap y "+y
vnoremap y "+y
nnoremap Y "+Y
" Note-taking keybindings
nnoremap <leader>zz :ZkNew { title = vim.fn.input('Title: ') }<CR>
nnoremap <leader>vo :LSoutlineToggle<CR>
" dashboard
let g:dashboard_custom_header = [
@ -408,7 +427,7 @@ in
" lua config
lua <<EOF
local signs = { Error = " ", Warn = " ", Hint = "💡", Info = " " }
local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
@ -468,7 +487,7 @@ in
vim.api.nvim_set_keymap('n', '<leader>vt', ':call v:lua.toggle_diagnostics()<CR>', {noremap = true, silent = true})
-- autopairs
require('nvim-autopairs').setup{}
@ -548,109 +567,27 @@ in
cmp.event:on( 'confirm_done', cmp_autopairs.on_confirm_done({ map_char = { tex = ' ' } }))
require("luasnip.loaders.from_vscode").lazy_load()
-- lsp-format removed, using conform.nvim instead
require("nvim-navic").setup {
icons = {
Constant = "π ",
Function = "ƒ "
}
}
-- Setup neo-tree
require("neo-tree").setup {}
-- Setup outline
require("outline").setup {}
-- Setup trouble
require("trouble").setup {}
-- Setup noice for floating command palette and notifications
require("noice").setup({
cmdline = {
enabled = true,
view = "cmdline_popup",
},
messages = {
enabled = true,
},
popupmenu = {
enabled = true,
},
notify = {
enabled = true,
view = "notify",
},
lsp = {
progress = {
enabled = true,
format = "lsp_progress",
format_done = "lsp_progress_done",
throttle = 1000 / 30, -- frequency to update lsp progress message
view = "mini",
},
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
},
presets = {
command_palette = true,
long_message_to_split = true,
inc_rename = false,
lsp_doc_border = false,
},
views = {
cmdline_popup = {
border = {
style = "rounded",
padding = { 0, 1 },
},
filter_options = {},
win_options = {
winhighlight = "NormalFloat:NormalFloat,FloatBorder:FloatBorder",
},
},
-- null-ls
-- being very janky
local null_ls = require("null-ls")
null_ls.setup({
sources = {
null_ls.builtins.diagnostics.shellcheck,
null_ls.builtins.diagnostics.proselint.with({ filetypes = { "vimwiki", "mail", }, }),
null_ls.builtins.diagnostics.commitlint,
null_ls.builtins.diagnostics.jsonlint,
-- null_ls.builtins.code_actions.statix,
-- null_ls.builtins.diagnostics.clj_kondo,
-- null_ls.builtins.formatting.isort,
-- null_ls.builtins.formatting.black,
},
})
-- Setup barbar (tabline with icons)
require'barbar'.setup {
icons = {
filetype = {
enabled = true,
},
},
}
-- Setup lspconfig
require("lsp-format").setup {}
require("nvim-navic").setup {}
local format = require("lsp-format")
local navic = require("nvim-navic")
-- Setup conform.nvim for formatting
require("conform").setup({
formatters_by_ft = {
javascript = { "prettier", "lsp" },
typescript = { "prettier", "lsp" },
javascriptreact = { "prettier", "lsp" },
typescriptreact = { "prettier", "lsp" },
json = { "prettier", "lsp" },
html = { "prettier", "lsp" },
css = { "prettier", "lsp" },
yaml = { "prettier", "lsp" },
rust = { "lsp" },
go = { "lsp" },
lua = { "lsp" },
nix = { "nixfmt-rfc-style" },
clojure = { "lsp" },
fennel = { "lsp" },
terraform = { "lsp" },
bash = { "shfmt" },
sh = { "shfmt" },
},
format_on_save = {
timeout_ms = 500,
lsp_fallback = true,
},
})
-- lspsaga, code_action lightbulb is annoying
local saga = require('lspsaga')
@ -698,20 +635,21 @@ in
}
}
local servers = { 'clojure_lsp', 'terraform_lsp', 'zls', 'pyright', 'rust_analyzer', 'ts_ls', 'lua_ls', 'nil_ls', 'gopls', 'bashls'}
local servers = { 'clojure_lsp', 'terraform_lsp', 'zls', 'pyright', 'rust_analyzer', 'tsserver', 'lua_ls', 'nil_ls', 'gopls'}
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = function(client, bufnr)
format.on_attach(client)
navic.attach(client, bufnr)
end,
capabilities = capabilities,
}
end
-- fennel-ls doesn't support navic
-- fennel-ls doesn't support gps
lspconfig['fennel-ls'].setup {
on_attach = function(client, bufnr)
-- fennel-ls setup without navic
format.on_attach(client)
end,
capabilities = capabilities,
}
@ -764,7 +702,7 @@ in
function()
local msg = 'No Active Lsp'
local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype')
local clients = vim.lsp.get_clients()
local clients = vim.lsp.get_active_clients()
if next(clients) == nil then
return msg
end
@ -790,7 +728,7 @@ in
local map = vim.api.nvim_set_keymap
local opts = { noremap = true, silent = true }
map('n', '<TAB>', '<CMD>lua require("FTerm").toggle()<CR>', opts)
map('t', '<TAB>', '<C-\\><C-n><CMD>lua require("FTerm").toggle()<CR>', opts)
map('t', '<A-i>', '<C-\\><C-n><CMD>lua require("FTerm").toggle()<CR>', opts)
-- Custom functions
function update_date()
@ -827,17 +765,11 @@ in
)
-- auto session
vim.o.sessionoptions="blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
require('auto-session').setup {
log_level = 'error',
auto_session_suppress_dirs = {'~/', '/tmp', '/'},
auto_session_enable_last_session = false,
auto_session_root_dir = vim.fn.stdpath('data').."/sessions/",
auto_session_enabled = true,
auto_save_enabled = nil,
auto_restore_enabled = nil,
auto_session_create_enabled = nil,
log_level = 'info',
auto_session_suppress_dirs = {'~/'}
}
vim.o.sessionoptions="blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal"
require("which-key").setup{}
require('leap').set_default_keymaps()
@ -868,42 +800,6 @@ in
-- You gotta run :SCNvimGenerateAssets for this first
-- require("luasnip").add_snippets("supercollider", require("scnvim/utils").get_snippets())
-- zk
require("zk").setup()
-- vim.api.nvim_set_keymap("n", "<leader>zn", "<Cmd>ZkNew { title = vim.fn.input('Title: ') }<CR>", opts)
-- Open notes.
vim.api.nvim_set_keymap("n", "<leader>zo", "<Cmd>ZkNotes { sort = { 'modified' } }<CR>", opts)
-- Open notes associated with the selected tags.
vim.api.nvim_set_keymap("n", "<leader>zt", "<Cmd>ZkTags<CR>", opts)
local map = vim.api.nvim_set_keymap
-- Search for the notes matching a given query.
vim.api.nvim_set_keymap("n", "<leader>zf", "<Cmd>ZkNotes { sort = { 'modified' }, match = { vim.fn.input('Search: ') } }<CR>", opts)
-- Search for the notes matching the current visual selection.
vim.api.nvim_set_keymap("v", "<leader>zf", ":'<,'>ZkMatch<CR>", opts)
map("n", "<CR>", "<Cmd>lua vim.lsp.buf.definition()<CR>", opts)
-- Create a new note after asking for its title.
-- This overrides the global `<leader>zn` mapping to create the note in the same directory as the current buffer.
-- map("n", "<leader>zn", "<Cmd>ZkNew { dir = vim.fn.expand('%:p:h'), title = vim.fn.input('Title: ') }<CR>", opts)
-- Create a new note in the same directory as the current buffer, using the current selection for title.
-- map("v", "<leader>znt", ":'<,'>ZkNewFromTitleSelection { dir = vim.fn.expand('%:p:h') }<CR>", opts)
-- Create a new note in the same directory as the current buffer, using the current selection for note content and asking for its title.
map("v", "<leader>znc", ":'<,'>ZkNewFromContentSelection { dir = vim.fn.expand('%:p:h'), title = vim.fn.input('Title: ') }<CR>", opts)
-- Open notes linking to the current buffer.
map("n", "<leader>zb", "<Cmd>ZkBacklinks<CR>", opts)
-- Alternative for backlinks using pure LSP and showing the source context.
--map('n', '<leader>zb', '<Cmd>lua vim.lsp.buf.references()<CR>', opts)
-- Open notes linked by the current buffer.
map("n", "<leader>zl", "<Cmd>ZkLinks<CR>", opts)
-- Preview a linked note.
map("n", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>", opts)
-- Open the code actions for a visual selection.
map("v", "<leader>za", ":'<,'>lua vim.lsp.buf.range_code_action()<CR>", opts)
-- zen mode
require('zen-mode').setup{
window = {
@ -954,27 +850,6 @@ in
auto_display = false -- WIP automatic markdown image display, may be prone to breaking
}
-- Setup Navigator.nvim
require('Navigator').setup {
disable_on_zoom = true,
mux = 'auto', -- auto-detect tmux
}
-- Set up Navigator.nvim keybindings
vim.keymap.set({'n', 't'}, '<M-h>', '<CMD>NavigatorLeft<CR>')
vim.keymap.set({'n', 't'}, '<M-j>', '<CMD>NavigatorDown<CR>')
vim.keymap.set({'n', 't'}, '<M-k>', '<CMD>NavigatorUp<CR>')
vim.keymap.set({'n', 't'}, '<M-l>', '<CMD>NavigatorRight<CR>')
-- Disable Ctrl+V in nvim so Kitty can handle paste
vim.keymap.set({'n', 'v', 'i'}, '<C-v>', '<Nop>', {noremap = true, silent = true})
-- Pane resizing with Alt+Shift+hjkl (to match tmux)
vim.keymap.set('n', '<M-S-h>', '<Cmd>vertical resize -2<CR>', {silent = true})
vim.keymap.set('n', '<M-S-j>', '<Cmd>resize -2<CR>', {silent = true})
vim.keymap.set('n', '<M-S-k>', '<Cmd>resize +2<CR>', {silent = true})
vim.keymap.set('n', '<M-S-l>', '<Cmd>vertical resize +2<CR>', {silent = true})
EOF
'';
@ -997,23 +872,15 @@ in
statix
nodePackages.typescript
nodePackages.typescript-language-server
nodePackages.bash-language-server
luajitPackages.lua-lsp
fennel-ls
nixfmt-rfc-style
shfmt
zk
];
plugins = with pkgs.vimPlugins // customPlugins; [
# ui
lualine-nvim
fzf-vim
neo-tree-nvim
outline-nvim
noice-nvim
nui-nvim
trouble-nvim
nerdtree
neovim-ayu
rainbow_parentheses-vim
vim-surround
@ -1050,10 +917,10 @@ in
taskwiki
vim-zettel
hologram-nvim
zk-nvim
# lsp stuff
# nvim-lint
null-ls-nvim
nvim-lspconfig
nvim-cmp
cmp-nvim-lsp
@ -1066,7 +933,7 @@ in
nvim-autopairs
cmp_luasnip
luasnip
conform-nvim
lsp-format
friendly-snippets
lspkind-nvim
@ -1086,7 +953,6 @@ in
nvim-luapad
scnvim
leap
Navigator-nvim
vim-beancount
# vimtex
# custom
@ -1095,7 +961,7 @@ in
# vim-processing
];
withPython3 = true;
extraPython3Packages = pkgs: with pkgs; [ tasklib six packaging ];
extraPython3Packages = pkgs: with pkgs; [ tasklib six ];
vimAlias = true;
};
}

View file

@ -1,3 +1,3 @@
{
home.file.".tmux.conf".source = ./tmux.conf;
home.file.".tmux.confg".source = ./tmux.conf
}

View file

@ -57,29 +57,3 @@ setw -g window-status-bell-style 'fg=yellow bg=green bold'
# messages
set -g message-style 'fg=yellow bg=green bold'
# Unbind Ctrl+V so it passes through to Kitty for paste
unbind C-v
# Vim-aware pane navigation with Alt+hjkl
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n M-h if-shell "$is_vim" "send-keys M-h" "select-pane -L"
bind-key -n M-j if-shell "$is_vim" "send-keys M-j" "select-pane -D"
bind-key -n M-k if-shell "$is_vim" "send-keys M-k" "select-pane -U"
bind-key -n M-l if-shell "$is_vim" "send-keys M-l" "select-pane -R"
# Window navigation with Alt+n/p
bind-key -n M-n next-window
bind-key -n M-p previous-window
# Pane resizing with Alt+Shift+hjkl
bind-key -n M-S-h resize-pane -L 2
bind-key -n M-S-j resize-pane -D 2
bind-key -n M-S-k resize-pane -U 2
bind-key -n M-S-l resize-pane -R 2
# Copy mode setup
bind v copy-mode
setw -g mode-keys vi
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'

View file

@ -66,10 +66,6 @@
address = "192.168.1.240";
prefixLength = 24;
}];
ipv6.addresses = [{
address = "fd7d:587a:4300:1::240";
prefixLength = 64;
}];
ipv4.routes = [{ address = "192.168.1.0"; prefixLength = 24; via = "192.168.1.1"; }];
useDHCP = false;
};

View file

@ -18,7 +18,6 @@
../profiles/wallabag
../profiles/finance
../profiles/sync/website
../profiles/sync/music
../profiles/grasp
# ../profiles/archivebox
# ../profiles/woodpecker-agent
@ -51,16 +50,21 @@
# "/home/anish/usr/nonfiction" # syncthing
"/home/anish/usr/finance" # beancount
"/mnt/two/postgres" # sealight postgres backups TODO remove once moved to capsul
"/mnt/two/photos"
"/mnt/two/music"
];
# seafile
};
environment.systemPackages = with pkgs; [ lm_sensors ];
hardware.fancontrol = {
enable = false;
config = '''';
services.nginx.virtualHosts."mast.mossnet.lan" = {
enableACME = false;
forceSSL = false;
locations."/" = {
extraConfig = ''
proxy_pass http://localhost:5731/;
proxy_set_header X-Forwarded-Host $host;
'';
};
};
age.secrets.box-wg.file = "${self}/secrets/box-wg.age";

View file

@ -38,7 +38,8 @@
pkgs.lib.mkForce [ ]; # Normally ["network-online.target"]
};
programs.gnupg.agent.enable = true;
programs.gnupg.agent.pinentryPackage = pkgs.pinentry-gnome3;
fileSystems."/mnt/ftp" = {
device = "192.168.1.240:/home/ftp";
@ -69,7 +70,7 @@
# lazy enable of ports necessary for KDE connect which is installed via cli home profile (for some reason?)
networking.firewall = {
allowedTCPPorts = [ 22 4173 ]; # allow ssh
allowedTCPPorts = [ 22 ]; # allow ssh
allowedTCPPortRanges = [{
from = 1714;
to = 1764;
@ -93,7 +94,7 @@
mossnet.backup = {
enable = true;
name = "curve";
paths = [ "/home/anish/usr" "/home/anish/.ssh" "/home/anish/.password-store/" ];
paths = [ "/home/anish/usr" "/home/anish/.ssh" ];
};
# enable adb

View file

@ -31,20 +31,20 @@
};
# Reverse proxy for immich
# services.nginx.virtualHosts."photos.sealight.xyz" = {
# enableACME = true;
# forceSSL = true;
services.nginx.virtualHosts."photos.sealight.xyz" = {
enableACME = true;
forceSSL = true;
# locations."/" = {
# extraConfig = ''
# proxy_pass http://10.0.69.4:8567;
# proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header X-Forwarded-Proto $scheme;
# '';
# };
# };
locations."/" = {
extraConfig = ''
proxy_pass http://10.0.69.4:8567;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
'';
};
};
services.postgresql.package = pkgs.postgresql_15;
services.postgresqlBackup = {

View file

@ -32,9 +32,7 @@ in
};
environment.systemPackages = with pkgs; [
pinentry-rofi
pinentry-gnome3
pinentry-gtk2
cached-nix-shell
];

View file

@ -38,7 +38,7 @@ in {
dbus = {
enable = true;
packages = [ pkgs.dconf pkgs.gcr ];
packages = [ pkgs.dconf ];
};
};
programs.dconf.enable = true;
@ -60,14 +60,13 @@ in {
#unstable.sublime-music
# olm-3.2.16 is now insecure
# some reason I can't set insecure packages that will be respected
nheko
# nheko
unstable.signal-desktop
unstable.tuba
unstable.newsflash
unstable.liferea
unstable.gh
unstable.flyctl
unstable.sublime-music
kooha
light
@ -220,8 +219,6 @@ in {
siji
font-awesome
proggyfonts
nerd-fonts.fira-code
nerd-fonts.droid-sans-mono
nerd-fonts.iosevka
(nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" "Iosevka" ]; })
];
}

View file

@ -53,9 +53,9 @@ in {
# private-address = "192.168.1.0/24";
cache-min-ttl = 0;
serve-expired = "yes";
interface = [ "0.0.0.0" "::" ];
interface = [ "0.0.0.0" ];
access-control =
[ "127.0.0.0/8 allow" "192.168.1.0/24 allow" "10.0.69.0/24 allow" "::1 allow" "fd7d:587a:4300:1::/64 allow" ];
[ "127.0.0.0/8 allow" "192.168.1.0/24 allow" "10.0.69.0/24 allow" ];
access-control-view = "10.0.69.0/24 wireguard";
# so-reuseport = "yes";
tls-upstream = "yes";

View file

@ -1,14 +1,11 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = [ pkgs.ffmpeg ];
mossnet.gonic.enable = true;
mossnet.gonic.settings = ''
music-path /mnt/two/music/
podcast-path /data/podcasts
cache-path /data/cache
playlists-path /data/playlists
transcode-cache-size 1000
transcode-eject-interval 1440
'';
mossnet.gonic.user = "gonic";
mossnet.gonic.group = "audio";

View file

@ -1,4 +1,4 @@
{ pkgs, config, ... }:
{ ... }:
{
services.immich = {
enable = true;
@ -7,23 +7,16 @@
};
host = "0.0.0.0";
port = 8567;
mediaLocation = "/mnt/two/photos";
openFirewall = true;
settings.server.externalDomain = "https://photos.sealight.xyz";
mediaLocation = "/data/photos";
externalDomain = "https://photos.sealight.xyz";
};
services.nginx.virtualHosts."photos.mossnet.lan" = {
enableACME = false;
forceSSL = false;
locations."/" = {
proxyPass = "http://127.0.0.1:${toString config.services.immich.port}";
proxyWebsockets = true;
recommendedProxySettings = true;
extraConfig = ''
client_max_body_size 50000M;
proxy_read_timeout 600s;
proxy_send_timeout 600s;
send_timeout 600s;
proxy_pass http://127.0.0.1:8567/;
'';
};
};

View file

@ -2,10 +2,10 @@
{
services.jackett = {
enable = true;
host = "0.0.0.0";
port = 8011;
user = "jackett";
group = "transmission";
package = pkgs.unstable.jackett;
};
services.nginx.virtualHosts."jackett.mossnet.lan" = {
enableACME = false;
@ -19,8 +19,10 @@
};
services.lidarr = {
enable = true;
user = "headphones";
group = "audio";
host = "0.0.0.0";
port = 8012;
user = "lidarr";
group = "transmission";
};
services.nginx.virtualHosts."lidarr.mossnet.lan" = {
enableACME = false;
@ -28,7 +30,7 @@
locations."/" = {
extraConfig = ''
proxy_pass http://127.0.0.1:8686/;
proxy_pass http://127.0.0.1:8012/;
'';
};
};

View file

@ -47,9 +47,9 @@
# The registration file is automatically generated after starting the appservice for the first time.
# cp /var/lib/matrix-appservice-discord/discord-registration.yaml /var/lib/matrix-synapse/
# chown matrix-synapse:matrix-synapse /var/lib/matrix-synapse/discord-registration.yaml
# "/var/lib/matrix-synapse/telegram-registration.yaml"
"/var/lib/matrix-synapse/telegram-registration.yaml"
"/var/lib/matrix-synapse/signal-registration.yaml"
#"/var/lib/matrix-as-whatsapp/whatsapp-registration.yaml"
"/var/lib/matrix-as-whatsapp/whatsapp-registration.yaml"
"/var/lib/matrix-as-discord/discord-registration.yaml"
# "/var/lib/matrix-synapse/slack-registration.yaml"
# "/var/lib/matrix-synapse/discord-registration.yaml"

View file

@ -2,17 +2,17 @@
{
# Mautrix-signal settings
# services.signald.enable = true;
# systemd.services.matrix-as-signal = {
# requires = [ "signald.service" ];
# after = [ "signald.service" ];
# unitConfig = {
# JoinsNamespaceOf = "signald.service";
# };
# path = [
# pkgs.ffmpeg # voice messages need `ffmpeg`
# ];
# };
services.signald.enable = true;
systemd.services.matrix-as-signal = {
requires = [ "signald.service" ];
after = [ "signald.service" ];
unitConfig = {
JoinsNamespaceOf = "signald.service";
};
path = [
pkgs.ffmpeg # voice messages need `ffmpeg`
];
};
services.matrix-appservices = {
addRegistrationFiles = false;
@ -25,27 +25,27 @@
# package = pkgs.mautrix-whatsapp;
# };
discord = {
port = 29188;
format = "mautrix-go";
package = pkgs.mautrix-discord;
};
# discord = {
# port = 29188;
# format = "mautrix-go";
# package = pkgs.unstable.mautrix-discord;
# };
# signal = {
# port = 29184;
# format = "mautrix-python";
# package = pkgs.mautrix-signal;
# package = pkgs.unstable.mautrix-signal;
# serviceConfig = {
# # StateDirectory = [ "matrix-as-signal" "signald" ];
# # SupplementaryGroups = [ "signald" ];
# StateDirectory = [ "matrix-as-signal" "signald" ];
# SupplementaryGroups = [ "signald" ];
# TimeoutStopSec = 1; # work around the service ignoring SIGTERM, see https://gitlab.com/coffeetables/nix-matrix-appservices/-/issues/12
# # User = lib.mkForce config.services.signald.user;
# # Group = lib.mkForce config.services.signald.group;
# User = lib.mkForce config.services.signald.user;
# Group = lib.mkForce config.services.signald.group;
# };
# settings.signal = {
# socket_path = config.services.signald.socketPath;
# outgoing_attachment_dir = "/var/lib/signald/tmp";
# };
# # settings.signal = {
# # socket_path = config.services.signald.socketPath;
# # outgoing_attachment_dir = "/var/lib/signald/tmp";
# # };
# };
};
};

View file

@ -22,8 +22,7 @@
bespokesynth
lsp-plugins
helio-workstation
# projectm # milkdrop visualizer
# i think it's projectm-sdl-cpp now
projectm # milkdrop visualizer
# DAWs
# ardour
@ -31,7 +30,7 @@
# renoise
];
services.pulseaudio.enable = false;
hardware.pulseaudio.enable = lib.mkForce false;
security.rtkit.enable = false;
services.pipewire = {

View file

@ -5,7 +5,6 @@
package = pkgs.radicale;
settings = {
server.hosts = [ "0.0.0.0:5252" ];
auth.type = "none";
};
};

View file

@ -5,19 +5,16 @@
serviceConfig.Type = "oneshot";
path = [
pkgs.coreutils
pkgs.openssh
pkgs.gawk
pkgs.rsync
pkgs.beets
];
script = builtins.readFile ./get-music.sh;
serviceConfig = {
User = "anish";
};
};
systemd.timers.get-music-sync = {
systemd.timers.get-music-timer = {
wantedBy = [ "timers.target" ];
partOf = [ "get-music-sync.service" ];
timerConfig.OnCalendar = [ "hourly" ];
timerConfig.OnCalendar = [ "daily" ];
};
}

64
hosts/profiles/sync/music/get-music.sh Executable file → Normal file
View file

@ -1,61 +1,9 @@
#!/usr/bin/env bash
rsync -r --ignore-existing --log-file=/data/incoming/download-log hypercube@talos.feralhosting.com:private/transmission/data/* /data/incoming
set -euo pipefail
# you need to set defaults for beets
# if already imported -> Skip
# Auto accept changes
# also install it lmao
#beet import /data/incoming
REMOTE_HOST="aynish@talos.feralhosting.com"
REMOTE_PATH="private/transmission/data/"
LOCAL_PATH="/mnt/two/incoming"
TRACKING_FILE="/mnt/two/incoming/.downloaded_albums"
LOG_FILE="/mnt/two/incoming/download-log"
# Create tracking file if it doesn't exist
touch "$TRACKING_FILE"
# Get list of albums on remote server
echo "$(date): Checking for new albums on seedbox..." >>"$LOG_FILE"
REMOTE_ALBUMS=$(rsync --dry-run --list-only "$REMOTE_HOST:$REMOTE_PATH" | grep '^d' | awk '{$1=$2=$3=$4=""; sub(/^ +/, ""); print}' | grep -v '^\.') || true
if [ -z "$REMOTE_ALBUMS" ]; then
echo "$(date): No albums found on remote server" >>"$LOG_FILE"
exit 0
fi
# Check each album against tracking file
NEW_ALBUMS=""
while IFS= read -r album; do
if [ -n "$album" ] && ! grep -qF "$album" "$TRACKING_FILE"; then
NEW_ALBUMS="$NEW_ALBUMS$album\n"
echo "$(date): Found new album: $album" >>"$LOG_FILE"
fi
done <<<"$REMOTE_ALBUMS"
if [ -z "$NEW_ALBUMS" ]; then
echo "$(date): No new albums to download" >>"$LOG_FILE"
exit 0
fi
# Download new albums only
echo "$(date): Starting download of new albums..." >>"$LOG_FILE"
while IFS= read -r album; do
if [ -n "$album" ]; then
echo "$(date): Downloading $album" >>"$LOG_FILE"
if rsync -r --log-file="$LOG_FILE" "$REMOTE_HOST:$REMOTE_PATH$album/" "$LOCAL_PATH/$album/"; then
echo "$album" >>"$TRACKING_FILE"
echo "$(date): Successfully downloaded $album" >>"$LOG_FILE"
# Import to beets
echo "$(date): Importing $album to beets..." >>"$LOG_FILE"
# Set umask to allow group read/write access
umask 002
if beet -p fetchart import -m -l /home/anish/music.log -q -g "$LOCAL_PATH/$album"; then
echo "$(date): Successfully imported $album to beets" >>"$LOG_FILE"
else
echo "$(date): Failed to import $album to beets" >>"$LOG_FILE"
fi
else
echo "$(date): Failed to download $album" >>"$LOG_FILE"
fi
fi
done <<<"$(echo -e "$NEW_ALBUMS")"
echo "$(date): Music sync completed" >>"$LOG_FILE"

View file

@ -1,6 +1,5 @@
{ pkgs, ... }:
{
environment.systemPackages = [ pkgs.beets ];
services.transmission = {
enable = true;
settings = {
@ -10,10 +9,11 @@
script-torrent-done-enabled = true;
# Normally, I would write this into the homedir with home-manager
# And explictly set the dir to be the output of the home-manager location
# But this seems better, if it'll work?
script-torrent-done-filename = pkgs.writeShellScript "beet-import.sh" ''
#!/usr/bin/env bash
beet -p fetchart import -l /home/anish/music.log -q -g "$TR_TORRENT_DIR"
beet import -ql "$TR_TORRENT_DIR"
'';
rpc-url = "/transmission/rpc/";
download-dir = "/mnt/two/new-music";

View file

@ -57,7 +57,7 @@ in {
#...
};
serviceConfig = {
ExecStart = "${pkgs.gonic}/bin/gonic -config-path /etc/gonic/config -scan-watcher-enabled -scan-interval 600";
ExecStart = "${pkgs.gonic}/bin/gonic -config-path /etc/gonic/config";
WorkingDirectory = dataFolder;
TimeoutStopSec = "20";
KillMode = "process";

View file

@ -11,16 +11,7 @@
propagatedBuildInputs = prevAttrs.propagatedBuildInputs ++ [ final.python3.pkgs.jsonschema ]; # allow kobo sync stuff
});
mautrix-signal = prev.mautrix-signal.overrideAttrs (prevAttrs: rec {
buildInputs = prevAttrs.buildInputs ++ [ final.python3.pkgs.aiosqlite ]; # We're using sqlite and upstream doesn't package this dependency
withGoolm = true;
});
# headphones is not very stable...
# this is fixed in newer commits, but no release has gone out
# patching whitespace with sed is insane
headphones = prev.headphones.overrideAttrs (prevAttrs: rec {
patchPhase = ''
sed -i '1395s/^\([[:space:]]*\).*/\1"cat": "3000",/' headphones/searcher.py
'';
buildInputs = prevAttrs.propagatedBuildInputs ++ [ final.python3.pkgs.aiosqlite ]; # We're using sqlite and upstream doesn't package this dependency
});
wallabag = prev.wallabag.overrideAttrs (attrs: {
@ -32,14 +23,6 @@
];
});
olm = prev.olm.overrideAttrs (attrs: {
knownVulnerabilities = [];
});
mautrix-discord = prev.mautrix-discord.overrideAttrs (attrs: rec {
license = "";
});
# Need to do server and agent too, maybe
# woodpecker-cli-next =
# let

29
pkgs/mautrix-discord.nix Normal file
View file

@ -0,0 +1,29 @@
{ lib, buildGoModule, fetchFromGitHub, olm }:
buildGoModule rec {
pname = "mautrix-discord";
version = "unstable-2022-11-04";
src = fetchFromGitHub {
owner = "mautrix";
repo = "discord";
rev = "f53975cc91e3c643a722adf0d3e0dfb98d0127a2";
hash = "sha256-xUALcN5oQfwC6gmOeygCkOAXJrJzNitBxHRFAKKgFvE=";
};
buildInputs = [ olm ];
vendorHash = "sha256-yday2mSnPwuhXWkCG4XY7qoBl3DXHcSvzBoZbjgYz/c=";
ldflags = [ "-s" "-w" ]; # https://github.com/NixOS/nixpkgs/issues/177698
doCheck = false; # No tests available
meta = with lib; {
homepage = "https://go.mau.fi/mautrix-discord";
description = "Matrix to Discord hybrid puppeting/relaybot bridge";
license = licenses.agpl3Plus;
maintainers = with maintainers; [ robin ];
};
}