summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Vink <59492084+ivi-vink@users.noreply.github.com>2025-01-18 13:10:46 +0100
committerMike Vink <59492084+ivi-vink@users.noreply.github.com>2025-01-18 13:10:46 +0100
commit5c844a75c6f5debb3b627f8df7789df495d63adb (patch)
tree1af80648ace7c429c16431310888cbce2dd7f68a
parent9746fd5f2c6dfea4660c908204e74451f797956a (diff)
fixup
-rw-r--r--machines/vm-aarch64.nix65
-rw-r--r--mut/dwm/config.h2
l---------mut/lf/icons2
-rw-r--r--mut/neovim/lua/my/init.lua16
-rw-r--r--mut/neovim/lua/my/packages/cmp.lua142
-rw-r--r--mut/neovim/lua/my/packages/init.lua2
m---------mut/surf0
-rw-r--r--overlays/suckless.nix4
8 files changed, 56 insertions, 177 deletions
diff --git a/machines/vm-aarch64.nix b/machines/vm-aarch64.nix
index 9738eb6..67af835 100644
--- a/machines/vm-aarch64.nix
+++ b/machines/vm-aarch64.nix
@@ -1,8 +1,15 @@
# https://github.com/mitchellh/nixos-config/blob/main/machines/vm-aarch64-prl.nix
-{ self, config, pkgs, lib, ... }: with lib; {
- imports =
- [ (self + "/profiles/vmware-guest.nix")
- ];
+{
+ self,
+ config,
+ pkgs,
+ lib,
+ ...
+}:
+with lib; {
+ imports = [
+ (self + "/profiles/vmware-guest.nix")
+ ];
system.stateVersion = "24.05";
virtualisation.vmware.guest.enable = true;
virtualisation.docker.enable = false;
@@ -13,10 +20,10 @@
hosts = ["unix:///run/user/${toString config.my.uid}/docker.sock" "tcp://127.0.0.1:2376"];
};
};
- systemd.user.services.docker.serviceConfig.Environment="DOCKERD_ROOTLESS_ROOTLESSKIT_FLAGS=\"-p 0.0.0.0:2376:2376/tcp\"";
+ systemd.user.services.docker.serviceConfig.Environment = "DOCKERD_ROOTLESS_ROOTLESSKIT_FLAGS=\"-p 0.0.0.0:2376:2376/tcp\"";
systemd.user.services.docker.serviceConfig.ExecStart = let
- cfg = config.virtualisation.docker.rootless;
- in
+ cfg = config.virtualisation.docker.rootless;
+ in
mkForce "${cfg.package}/bin/dockerd-rootless --config-file=${(pkgs.formats.json {}).generate "daemon.json" cfg.daemon.settings}";
networking.hostName = "vm-aarch64";
programs.nix-ld.enable = true;
@@ -28,6 +35,9 @@
dwm
'';
hm.services.ssh-agent.enable = true;
+ environment.variables = {
+ WEBKIT_DISABLE_COMPOSITING_MODE = 1;
+ };
environment.systemPackages = with pkgs; [
kubernetes-helm
(azure-cli.withExtensions [azure-cli.extensions.aks-preview azure-cli.extensions.account])
@@ -41,8 +51,9 @@
kubelogin
just
(ffmpeg.override {
- withXcb = true;
- })
+ withXcb = true;
+ })
+ surf
mpv
];
@@ -51,7 +62,7 @@
my.shell = pkgs.nushell;
environment.shells = [pkgs.bashInteractive pkgs.zsh pkgs.nushell];
- environment.pathsToLink = [ "/share/zsh" ];
+ environment.pathsToLink = ["/share/zsh"];
programs.zsh.enable = true;
services.openssh.enable = true;
@@ -63,7 +74,7 @@
# Disable the default module and import our override. We have
# customizations to make this work on aarch64.
- disabledModules = [ "virtualisation/vmware-guest.nix" ];
+ disabledModules = ["virtualisation/vmware-guest.nix"];
# Interface is this on M1
networking.interfaces.ens160.useDHCP = true;
@@ -98,23 +109,23 @@
boot.loader.systemd-boot.consoleMode = "0";
# Hardware
- boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "sr_mod" ];
- boot.initrd.kernelModules = [ ];
- boot.kernelModules = [ ];
- boot.extraModulePackages = [ ];
-
- fileSystems."/" =
- { device = "/dev/disk/by-label/nixos";
- fsType = "ext4";
- };
+ boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "sr_mod"];
+ boot.initrd.kernelModules = [];
+ boot.kernelModules = [];
+ boot.extraModulePackages = [];
+
+ fileSystems."/" = {
+ device = "/dev/disk/by-label/nixos";
+ fsType = "ext4";
+ };
- fileSystems."/boot" =
- { device = "/dev/disk/by-label/boot";
- fsType = "vfat";
- options = [ "fmask=0022" "dmask=0022" ];
- };
+ fileSystems."/boot" = {
+ device = "/dev/disk/by-label/boot";
+ fsType = "vfat";
+ options = ["fmask=0022" "dmask=0022"];
+ };
- swapDevices = [ ];
+ swapDevices = [];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
@@ -124,5 +135,5 @@
# networking.interfaces.ens160.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
- nix.settings.trusted-users = [ my.username ];
+ nix.settings.trusted-users = [my.username];
}
diff --git a/mut/dwm/config.h b/mut/dwm/config.h
index 2528ebf..5adcb46 100644
--- a/mut/dwm/config.h
+++ b/mut/dwm/config.h
@@ -3,7 +3,7 @@
/* Constants */
#define TERMINAL "ghostty"
#define TERMCLASS "Ghostty"
-#define BROWSER "chromium"
+#define BROWSER "surf"
/* appearance */
static unsigned int borderpx = 3; /* border pixel of windows */
diff --git a/mut/lf/icons b/mut/lf/icons
index 42ddab4..bfda8b7 120000
--- a/mut/lf/icons
+++ b/mut/lf/icons
@@ -1 +1 @@
-/nix/store/n1xbv1dwkvsv7v96kbril3lys6aq7x63-home-manager-files/.config/lf/icons \ No newline at end of file
+/nix/store/5zd3dr059cxpcd594g44bn7cm7rp5hdh-home-manager-files/.config/lf/icons \ No newline at end of file
diff --git a/mut/neovim/lua/my/init.lua b/mut/neovim/lua/my/init.lua
index 993519f..b72ad31 100644
--- a/mut/neovim/lua/my/init.lua
+++ b/mut/neovim/lua/my/init.lua
@@ -326,6 +326,14 @@ local browse_git_remote = function(fugitive_data)
end
end
assert((home and org and project and repo) or (home and repo))
+ P(home, org, project, repo)
+
+ local homes = {
+ ["ssh.dev.azure.com"] = "dev.azure.com",
+ }
+ if homes[home] then
+ home = homes[home]
+ end
local urls = {
["bitbucket.org"] = {
@@ -344,16 +352,16 @@ local browse_git_remote = function(fugitive_data)
},
["dev.azure.com"] = {
["tree"] = function(home, org, project, repo)
- return "https://" .. home .. "/" .. org .. "/_git/" .. repo .. "?version=GB" .. fugitive_data.commit .. "&path=/" .. path
+ return "https://" .. home .. "/" .. org .. "/" .. project .. "/_git/" .. repo .. "?version=GB" .. fugitive_data.commit .. "&path=/" .. path
end,
["blob"] = function(home, org, project, repo)
- return "https://" .. home .. "/" .. org .. "/_git/" .. repo .. "?version=GB" .. fugitive_data.commit .. "&path=/" .. path
+ return "https://" .. home .. "/" .. org .. "/" .. project.. "/_git/" .. repo .. "?version=GB" .. fugitive_data.commit .. "&path=/" .. path
end,
["commit"] = function(home, org, project, repo)
- return "https://" .. home .. "/" .. org .. "/_git/" .. repo .. "/commit/" .. fugitive_data.commit
+ return "https://" .. home .. "/" .. org .. "/" .. project.. "/_git/" .. repo .. "/commit/" .. fugitive_data.commit
end,
["ref"] = function(home, org, project, repo)
- return "https://" .. home .. "/" .. org .. "/_git/" .. repo .. "/commit/" .. fugitive_data.commit
+ return "https://" .. home .. "/" .. org .. "/" .. project.. "/_git/" .. repo .. "/commit/" .. fugitive_data.commit
end,
},
["gitlab.com"] = {
diff --git a/mut/neovim/lua/my/packages/cmp.lua b/mut/neovim/lua/my/packages/cmp.lua
deleted file mode 100644
index c959244..0000000
--- a/mut/neovim/lua/my/packages/cmp.lua
+++ /dev/null
@@ -1,142 +0,0 @@
-local cmp = require("cmp")
-local cmp_types = require("cmp.types")
-local luasnip = require("luasnip")
-
-vim.keymap.set("n", "<leader>xf",
- function()
- local fname = vim.fn.fnamemodify(vim.fn.bufname(vim.api.nvim_get_current_buf()), ":p:h")
- vim.api.nvim_feedkeys(":e " .. fname, "c", false)
- vim.defer_fn(function()
- vim.api.nvim_feedkeys("/", "c", false)
- end, 10)
- end)
-
-function snip(args)
- luasnip.lsp_expand(args.body)
-end
-
-function has_words_before()
- local line, col = unpack(vim.api.nvim_win_get_cursor(0))
- local word = unpack(vim.api.nvim_buf_get_lines(0, line-1, line, true))
- local before = word:sub(col, col)
- local is_whitespace = before:match("%s")
-
- local is_not_first_col = (not (col == 0))
- local is_not_whitespace = (is_whitespace == nil)
- local result = is_not_first_col and is_not_whitespace
- return result
-end
-
-function in_edit_mode(line)
- return line:match("^.* %.?.*$") or line:match("^ed?i?t? .*$")
-end
-
-function endswith(line, char)
- return line:match(".*" .. char .. "$")
-end
-
-function replace_tail(line)
- local result, n = line:gsub("(.*/)[^/]*/$","%1")
- if n then
- return result
- else
- return line
- end
-end
-
-cmp.setup({
- experimental={ghost_text= true},
- snippet={expand="snip"},
- preselect=cmp.PreselectMode.None,
- sources=cmp.config.sources({
- {name= "nvim_lsp"},
- {name= "path"},
- {name= "luasnip"}
- }),
- mapping={
- ["<Tab>"]=cmp.mapping(
- function(fallback)
- if cmp.visible() then
- cmp.select_next_item()
- elseif luasnip.expand_or_jumpable() then
- luasnip.expand_or_jump()
- elseif has_words_before() then
- cmp.complete()
- else
- fallback()
- end
- end, {"i", "s"}),
- ["<S-Tab>"]=cmp.mapping(
- function(fallback)
- if cmp.visible() then
- cmp.select_prev_item()
- elseif luasnip.jumpable(-1) then
- luasnip.jump (1)
- else
- fallback()
- end
- end, { "i", "s" }),
- ["<C-b>"]=cmp.mapping.scroll_docs(-4),
- [ "<C-f>" ]= cmp.mapping.scroll_docs(4),
- [ "<C-j>" ]= cmp.mapping.complete(),
- [ "<CR>" ]= cmp.mapping.confirm({
- behavior=cmp.ConfirmBehavior.Insert,
- select=true}),
- },
-})
-
--- This tries to emulate somewhat ido mode to find files
--- todo sorting based on least recently used
-cmp.setup.cmdline(":",
-{enabled=function()
- local val = in_edit_mode(vim.fn.getcmdline())
- if not val then cmp.close() end
- return val
-end,
-sources=cmp.config.sources({ {name="path"} }),
-completion={completeopt="menu,menuone,noinsert"},
-mapping={
- ["<C-n>"]=cmp.mapping(
- function(fallback)
- if cmp.visible() then
- cmp.select_next_item()
- else
- cmp.complete()
- end
- end, { "i", "c" }),
- ["<C-p>"]=cmp.mapping(
- function(fallback)
- if cmp.visible() then
- cmp.select_prev_item()
- else
- cmp.complete()
- end
- end, { "i", "c" }),
- ["<BS>"]=cmp.mapping(
- function(fallback)
- local line = vim.fn.getcmdline()
- if not endswith(line, "/") then
- fallback()
- else
- vim.fn.setcmdline(replace_tail(line))
- vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<C-g><BS>", true, false, true), false)
- vim.defer_fn(cmp.complete, 10)
- end
- end, { "i", "c" }),
- ["<CR>"]=cmp.mapping(
- function(fallback)
- local entry = cmp.get_selected_entry()
- local line = vim.fn.getcmdline()
- if entry and (not in_edit_mode(line)) then
- vim.schedule(fallback)
- else
- cmp.confirm {select=true, behavior=cmp.ConfirmBehavior.Replace}
- if entry and entry.completion_item.label:match("%.*/$") then
- vim.defer_fn(cmp.complete, 10)
- else
- vim.schedule(fallback)
- end
- end
- end, { "i", "c"})
- }
-})
diff --git a/mut/neovim/lua/my/packages/init.lua b/mut/neovim/lua/my/packages/init.lua
index 849527e..9c3a65f 100644
--- a/mut/neovim/lua/my/packages/init.lua
+++ b/mut/neovim/lua/my/packages/init.lua
@@ -1,8 +1,6 @@
require("my.packages.oil")
--- require("my.packages.cmp")
require("my.packages.blink")
require("my.packages.lint")
require("my.packages.luasnip")
require("my.packages.dap")
require("my.packages.go")
--- require("conf.pkgs.lualine")
diff --git a/mut/surf b/mut/surf
new file mode 160000
+Subproject d75c3ded0b1ebb8e2778961c5a928f247798686
diff --git a/overlays/suckless.nix b/overlays/suckless.nix
index d63b2f1..a6826a6 100644
--- a/overlays/suckless.nix
+++ b/overlays/suckless.nix
@@ -17,4 +17,8 @@
install -m755 -D dwmblocks $out/bin/dwmblocks
'';
});
+ surf = (prev.surf.overrideAttrs (oldAttrs: {
+ src = home + "/mut/surf";
+ version = "2.1";
+ }));
})