From fa37518d7b6fb2d197d7933233cde37ffeec7cdf Mon Sep 17 00:00:00 2001 From: Mike Vink Date: Wed, 18 Oct 2023 22:27:26 +0200 Subject: make neovim run as daemon --- flake.nix | 11 +++-------- machines/serber.nix | 4 ++-- mut/bin/nvim-server-or-client | 7 +++++++ mut/dwm | 2 +- overlays/suckless.nix | 2 +- 5 files changed, 14 insertions(+), 12 deletions(-) create mode 100755 mut/bin/nvim-server-or-client diff --git a/flake.nix b/flake.nix index de880b8..ae1a82a 100644 --- a/flake.nix +++ b/flake.nix @@ -26,7 +26,7 @@ # Gets module from ./machines/ and uses the lib to define which other modules # the machine needs. - mkSystem = name: machineModule: with lib; + mkSystem = name: machineConfig: with lib; let machine = ivi.machines.${name}; in @@ -35,7 +35,7 @@ specialArgs = {inherit machine inputs;}; modules = with lib; machine.modules - ++ [machineModule] + ++ [machineConfig] ++ [({ config, ... }: { nixpkgs.overlays = with lib; [(composeManyExtensions [ (import ./overlays/vimPlugins.nix {inherit pkgs;}) @@ -47,12 +47,7 @@ in with lib; { inherit lib; nixosConfigurations = with lib; - mapAttrs - (hostname: machineConfig: - mkSystem - hostname - machineConfig) - (modulesIn ./machines); + mapAttrs mkSystem (modulesIn ./machines); deploy.nodes = mapAttrs diff --git a/machines/serber.nix b/machines/serber.nix index 48ccf27..09208ee 100644 --- a/machines/serber.nix +++ b/machines/serber.nix @@ -1,4 +1,4 @@ -{ modulesPath, config, pkgs, sops, ... }: { +{ modulesPath, config, pkgs, lib, ... }: with lib; { imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; networking = { @@ -32,7 +32,7 @@ boot.initrd.kernelModules = [ "nvme" ]; fileSystems."/" = { device = "/dev/sda1"; fsType = "ext4"; }; - sops.age.sshKeyPaths = [/etc/ssh/ssh_host_ed25519_key]; + sops.age.sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"]; system.stateVersion = "23.05"; boot.tmp.cleanOnBoot = true; diff --git a/mut/bin/nvim-server-or-client b/mut/bin/nvim-server-or-client new file mode 100755 index 0000000..08c01cb --- /dev/null +++ b/mut/bin/nvim-server-or-client @@ -0,0 +1,7 @@ +#!/bin/sh +if ! test -S /tmp/nvimsocket +then + echo starting server + setsid nvim --listen /tmp/nvimsocket --headless & +fi +setsid nvim --server /tmp/nvimsocket --remote-ui diff --git a/mut/dwm b/mut/dwm index 6afb429..ec5a7a5 160000 --- a/mut/dwm +++ b/mut/dwm @@ -1 +1 @@ -Subproject commit 6afb429981cec5a882aceb04e94a6e3c2f4c98a8 +Subproject commit ec5a7a541dab1c1e239fa61e9da33327e07683f3 diff --git a/overlays/suckless.nix b/overlays/suckless.nix index a607a45..4171a0c 100644 --- a/overlays/suckless.nix +++ b/overlays/suckless.nix @@ -6,7 +6,7 @@ })); dwm = (prev.dwm.overrideAttrs (oldAttrs: rec { src = /. + home + "/flake/mut/dwm"; - version = "0.1.0"; + version = "0.1.2"; })); dwmblocks =(prev.stdenv.mkDerivation rec { pname = "dwmblocks"; -- cgit v1.2.3