Compare commits

...

2 Commits

Author SHA1 Message Date
Joshua Potter 12584e10fa Add simple formatter with par. 2024-01-23 10:03:30 -07:00
Joshua Potter e8ae478148 Add phobos device back. 2024-01-23 09:39:35 -07:00
4 changed files with 59 additions and 0 deletions

View File

@ -33,6 +33,7 @@
nodeNixpkgs = {
framework = tapir.pkgs;
deimos = tapir.pkgs;
phobos = tapir.pkgs;
thebe = tapir.pkgs;
};
nodeSpecialArgs = {
@ -42,6 +43,9 @@
deimos = {
inherit (tapir) sops-nix;
};
phobos = {
inherit (tapir) home-manager;
};
thebe = {
inherit (tapir) sops-nix;
};
@ -61,6 +65,7 @@
# Remote machines. Deploy using `colmena apply`
deimos.imports = [ ./hive/deimos ];
phobos.imports = [ ./hive/phobos ];
thebe.imports = [ ./hive/thebe ];
};

39
hive/phobos/default.nix Normal file
View File

@ -0,0 +1,39 @@
{ lib, system, home-manager, ... }:
{
imports = lib.optional (builtins.pathExists ./do-userdata.nix) ./do-userdata.nix ++ [
../../digital-ocean/configuration.nix
home-manager.nixosModules.home-manager
];
deployment.targetHost = "144.126.218.252";
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.jrpotter = import ../../users/jrpotter;
# Used to pass non-default parameters to submodules.
extraSpecialArgs = {
inherit system;
stateVersion = "23.11";
};
};
networking.hostName = "phobos";
programs.mosh.enable = true;
services.openssh.enable = true;
users.users.jrpotter = {
isNormalUser = true;
extraGroups = [
"docker"
"networkmanager"
"libvirtd"
"wheel"
];
};
system.stateVersion = "23.11";
}

View File

@ -0,0 +1,13 @@
local M = {}
function M.set_fmt_map()
vim.keymap.set('v', 'g|', function()
local width = vim.bo.textwidth
if width == 0 and vim.w.colorcolumn then
width = tonumber(vim.w.colorcolumn:match("[^,]+"))
end
return string.format("!par w%d<cr>", width ~= 0 and width or 80)
end, { expr = true })
end
return M

View File

@ -119,6 +119,7 @@ in
config = {
home.packages = with pkgs; [
par
ripgrep
];
@ -156,6 +157,7 @@ in
# Lua loader to search for our /nix/store/.../?.lua files.
(lib.mkBefore ''
package.path = '${config}/?.lua;' .. package.path
require('utils.fmt').set_fmt_map()
'')
# Extra Lua configuration to be appended to `init.lua`.
(lib.mkAfter ''