Skip to content

Commit

Permalink
Maintenance
Browse files Browse the repository at this point in the history
Update flake inputs
Run nix fmt
Run statix
  • Loading branch information
Lillecarl committed Aug 24, 2024
1 parent 597a806 commit 3736f39
Show file tree
Hide file tree
Showing 10 changed files with 204 additions and 356 deletions.
271 changes: 134 additions & 137 deletions flake.lock

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,6 @@
inputs.flake-utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-vscode-extensions = {
url = "github:nix-community/nix-vscode-extensions";
inputs.flake-utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-eval-jobs = {
url = "github:nix-community/nix-eval-jobs/main";
inputs.flake-parts.follows = "flake-parts";
Expand Down Expand Up @@ -225,7 +220,6 @@
overlays = [
(import ./lib/overlay.nix self.outPath)
(import ./pkgs)
inputs.nix-vscode-extensions.overlays.default
inputs.nur.overlay
inputs.nix-snapshotter.overlays.default
];
Expand Down
2 changes: 1 addition & 1 deletion hosts/_shared/networking.nix
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@

br13 = {
matchConfig.Name = config.systemd.network.netdevs.${config.lib.lobr.name}.netdevConfig.Name;
name = config.lib.lobr.name;
inherit (config.lib.lobr) name;
address = [ "${config.lib.lobr.ip}/${config.lib.lobr.mask}" ];
};
};
Expand Down
2 changes: 0 additions & 2 deletions pkgs/vscodeExtensions.json

This file was deleted.

31 changes: 0 additions & 31 deletions update.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#! /usr/bin/env python3

# inspired by https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vscode/extensions/update_installed_exts.sh
# but I like my package definitions explicit, so here we go.

import json
Expand Down Expand Up @@ -29,35 +28,6 @@ def updatenix():
nix["flake", "update", "--flake", gitroot].run_fg()


def updatevscode():
os.chdir(gitroot)
extpath = Path(os.path.join(gitroot, "pkgs", "vscodeExtensions.json"))
data = json.loads(extpath.read_text())

for ext in data:
URL = "https://{0}.gallery.vsassets.io/_apis/public/gallery/publisher/{0}/extension/{1}/latest/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage".format(
ext["publisher"], ext["name"]
)
NAME = "{0}-{1}.zip".format(ext["publisher"], ext["name"])

# Download package to nix store
print("Downloading {0}.{1} to nix store".format(ext["publisher"], ext["name"]))
prefetch = nix_prefetch_url("--name", NAME, "--print-path", URL).splitlines()

PKGHASH = prefetch[0]
PKGPATH = prefetch[1]
PKGPATH = prefetch[1]
print(PKGPATH)
oldver = ext["version"]
ext["version"] = json.loads(unzip("-qc", PKGPATH, "extension/package.json"))[
"version"
]
if oldver != ext["version"]:
print("Updating from {0} to {1}".format(oldver, ext["version"]))
ext["sha256"] = PKGHASH
extpath.write_text(json.dumps(data, indent=2) + os.linesep)


def updategit():
os.chdir(os.path.join(gitroot, "pkgs"))

Expand Down Expand Up @@ -99,7 +69,6 @@ def updategit():

def main():
updatenix()
updatevscode()
updategit()
os.chdir(gitroot)
nix("run", "nixpkgs#statix", "fix")
Expand Down
98 changes: 48 additions & 50 deletions users/lillecarl/dotfiles/.config/nvim/lua/config/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,63 +61,61 @@ function M.setup(config)
end
end

if not vim.g.vscode then
local wk = require("which-key")
-- <M-t> is alt+t
-- <C-t> is ctrl+t
-- <T-t> is meta+t
wk.register({
["<M-t>"] = { "<cmd>NvimTreeToggle<cr>", "Toggle nvim-tree" },
["<C-t>"] = { "<cmd>NvimTreeToggle<cr>", "Toggle nvim-tree" },
["<T-t>"] = { "<cmd>NvimTreeToggle<cr>", "Toggle nvim-tree" },
["<M-g>"] = {
function()
print("message")
vim.notify("OFF", vim.log.levels.OFF, { title = "OFF" })
vim.notify("ERROR", vim.log.levels.ERROR, { title = "ERROR" })
vim.notify("WARN", vim.log.levels.WARN, { title = "WARN" })
vim.notify("INFO", vim.log.levels.INFO, { title = "INFO" })
vim.notify("DEBUG", vim.log.levels.DEBUG, { title = "DEBUG" })
vim.notify("TRACE", vim.log.levels.TRACE, { title = "TRACE" })
end,
"Run test function",
},
["<M-h>"] = { "<cmd>wincmd h<cr>", "Go to the left window" },
["<M-j>"] = { "<cmd>wincmd j<cr>", "Go to the down window" },
["<M-k>"] = { "<cmd>wincmd k<cr>", "Go to the up window" },
["<M-l>"] = { "<cmd>wincmd l<cr>", "Go to the right window" },
["<M-c>"] = { "<cmd>bdelete<cr>", "Close buffer" },
["<M-x>"] = { "<cmd>xall<cr>", "Save all and exit" },
["<C-c>"] = { "<cmd>qall!<cr>", "Close all and exit" },
})
end
local wk = require("which-key")
-- <M-t> is alt+t
-- <C-t> is ctrl+t
-- <T-t> is meta+t
wk.register({
["<M-t>"] = { "<cmd>NvimTreeToggle<cr>", "Toggle nvim-tree" },
["<C-t>"] = { "<cmd>NvimTreeToggle<cr>", "Toggle nvim-tree" },
["<T-t>"] = { "<cmd>NvimTreeToggle<cr>", "Toggle nvim-tree" },
["<M-g>"] = {
function()
print("message")
vim.notify("OFF", vim.log.levels.OFF, { title = "OFF" })
vim.notify("ERROR", vim.log.levels.ERROR, { title = "ERROR" })
vim.notify("WARN", vim.log.levels.WARN, { title = "WARN" })
vim.notify("INFO", vim.log.levels.INFO, { title = "INFO" })
vim.notify("DEBUG", vim.log.levels.DEBUG, { title = "DEBUG" })
vim.notify("TRACE", vim.log.levels.TRACE, { title = "TRACE" })
end,
"Run test function",
},
["<M-h>"] = { "<cmd>wincmd h<cr>", "Go to the left window" },
["<M-j>"] = { "<cmd>wincmd j<cr>", "Go to the down window" },
["<M-k>"] = { "<cmd>wincmd k<cr>", "Go to the up window" },
["<M-l>"] = { "<cmd>wincmd l<cr>", "Go to the right window" },
["<M-c>"] = { "<cmd>bdelete<cr>", "Close buffer" },
["<M-x>"] = { "<cmd>xall<cr>", "Save all and exit" },
["<C-c>"] = { "<cmd>qall!<cr>", "Close all and exit" },
})
end

vim.api.nvim_create_user_command("Die", "xall", {})
vim.api.nvim_create_user_command("Die", "xall", {})

local augrp = vim.api.nvim_create_augroup("RealBufferBind", {})
local realBufferBind = function(ev)
if ev.event == "FileType" then
local blocked_filetypes = {
"TelescopePrompt",
"TelescopeResults",
"WhichKey",
"notify",
"noice",
"nofile",
}
local augrp = vim.api.nvim_create_augroup("RealBufferBind", {})
local realBufferBind = function(ev)
if ev.event == "FileType" then
local blocked_filetypes = {
"TelescopePrompt",
"TelescopeResults",
"WhichKey",
"notify",
"noice",
"nofile",
}

for _, i in ipairs(blocked_filetypes) do
if vim.bo.filetype == i then
return
end
for _, i in ipairs(blocked_filetypes) do
if vim.bo.filetype == i then
return
end
end

-- Create a user autocmd group that runs when we enter a real buffer
-- Useful for configuring binds without disturbing extensions
vim.api.nvim_exec_autocmds("User", { group = augrp })
end

-- Create a user autocmd group that runs when we enter a real buffer
-- Useful for configuring binds without disturbing extensions
vim.api.nvim_exec_autocmds("User", { group = augrp })

vim.api.nvim_create_autocmd({ "FileType", "VimEnter", "BufAdd" }, {
callback = realBufferBind,
})
Expand Down
20 changes: 9 additions & 11 deletions users/lillecarl/dotfiles/.config/nvim/lua/plugins/init.lua
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
local M = {}

function M.setup(config)
if not vim.g.vscode then
require("plugins.multiplug")
require("plugins.conform").setup(config)
require("plugins.telescope").setup(config)
require("plugins.copilot")
require("plugins.tree-sitter")
require("plugins.cmp")
require("plugins.lspconfig").setup(config)
require("plugins.copilotchat").setup(config)
require("plugins.aerial")
end
require("plugins.multiplug")
require("plugins.conform").setup(config)
require("plugins.telescope").setup(config)
require("plugins.copilot")
require("plugins.tree-sitter")
require("plugins.cmp")
require("plugins.lspconfig").setup(config)
require("plugins.copilotchat").setup(config)
require("plugins.aerial")
end

return M
1 change: 0 additions & 1 deletion users/lillecarl/gui/swaytools.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ in

timeouts = [
{ timeout = 300; command = lockScript; }
{ timeout = 600; command = "${pkgs.hyprland}/bin/hyprctl dispatch dpms off"; }
];
};

Expand Down
106 changes: 0 additions & 106 deletions users/lillecarl/gui/vscode.nix

This file was deleted.

23 changes: 12 additions & 11 deletions users/lillecarl/terminal/neovim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,19 @@ in
tiktoken_core
];

extraLuaConfig = let
config = {
ui = {
# For Neovide
font = {
inherit (fonts.monospace) name;
size = fonts.sizes.terminal;
extraLuaConfig =
let
config = {
ui = {
# For Neovide
font = {
inherit (fonts.monospace) name;
size = fonts.sizes.terminal;
};
};
};
};
};
in
''
in
''
require('init').setup(${lib.generators.toLua {} config})
'';
Expand Down

0 comments on commit 3736f39

Please sign in to comment.