WIP: Groundwork for impermanence setup for nixos and home
This commit is contained in:
@@ -210,6 +210,7 @@
|
||||
[
|
||||
{ nixpkgs.hostPlatform = system; }
|
||||
./nixos
|
||||
inputs.impermanence.nixosModules.impermanence
|
||||
];
|
||||
|
||||
in
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
{ primaryUser, ... }:
|
||||
{
|
||||
home.persistence."/persist/home/${primaryUser}" = {
|
||||
hideMounts = true;
|
||||
directories = [
|
||||
".config/nix"
|
||||
".local/share/zoxide"
|
||||
];
|
||||
files = [
|
||||
".local/share/fish/fish_history"
|
||||
];
|
||||
};
|
||||
}
|
||||
+35
-2
@@ -5,7 +5,6 @@
|
||||
programs.nixvim = {
|
||||
plugins.conform-nvim = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
formatters_by_ft = {
|
||||
lua = [ "stylua" ];
|
||||
@@ -13,6 +12,40 @@
|
||||
python = [ "black" ];
|
||||
rust = [ "rustfmt" ];
|
||||
rasi = [ "prettierd" ];
|
||||
c = [ "clang_format" ];
|
||||
cpp = [ "clang_format" ];
|
||||
};
|
||||
|
||||
formatters.clang_format = {
|
||||
# If the file has a project .clang-format (walking up from the
|
||||
# file itself, not nvim's cwd), use it - this is how a real
|
||||
# kernel checkout, or any other C/C++ project's own style,
|
||||
# gets respected automatically. Otherwise fall back to an
|
||||
# inline approximation of kernel style instead of plain LLVM,
|
||||
# since that's the sane default for one-off C files.
|
||||
prepend_args = {
|
||||
__raw = ''
|
||||
function(self, ctx)
|
||||
local found = vim.fs.find(
|
||||
{ ".clang-format", "_clang-format" },
|
||||
{ path = ctx.filename, upward = true }
|
||||
)[1]
|
||||
if found then
|
||||
return { "-style=file" }
|
||||
end
|
||||
return {
|
||||
"-style={BasedOnStyle: LLVM, IndentWidth: 8, UseTab: Always, "
|
||||
.. "TabWidth: 8, BreakBeforeBraces: Linux, ColumnLimit: 80, "
|
||||
.. "IndentCaseLabels: false, PointerAlignment: Right, "
|
||||
.. "DerivePointerAlignment: false, SpaceBeforeParens: ControlStatements, "
|
||||
.. "SpacesInParentheses: false, SpaceAfterCStyleCast: false, "
|
||||
.. "AllowShortIfStatementsOnASingleLine: false, AllowShortBlocksOnASingleLine: false, "
|
||||
.. "AllowShortFunctionsOnASingleLine: None, AllowShortLoopsOnASingleLine: false, "
|
||||
.. "ReflowComments: false}"
|
||||
}
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
format_on_save = {
|
||||
@@ -21,7 +54,6 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Install formatters
|
||||
extraPackages = with pkgs; [
|
||||
stylua
|
||||
@@ -29,6 +61,7 @@
|
||||
black
|
||||
rustfmt
|
||||
prettierd
|
||||
clang-tools # provides clang-format
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
installRustc = true;
|
||||
};
|
||||
pylsp.enable = true; # Python language server
|
||||
clangd.enable = true;
|
||||
};
|
||||
|
||||
# Keymaps for LSP actions
|
||||
@@ -85,6 +86,7 @@
|
||||
lua-language-server
|
||||
nil
|
||||
rust-analyzer
|
||||
clang-tools
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
./locale.nix
|
||||
./tailscale.nix
|
||||
./ssh.nix
|
||||
./impermanence.nix
|
||||
]
|
||||
++ lib.optionals (!isServer) [
|
||||
./regreet.nix
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
_: {
|
||||
environment.persistence."/persist" = {
|
||||
hideMounts = true;
|
||||
files = [
|
||||
"/etc/machine-id"
|
||||
"/etc/ssh/ssh_host_ed25519_key"
|
||||
"/etc/ssh/ssh_host_ed25519_key.pub"
|
||||
"/etc/ssh/ssh_host_rsa_key"
|
||||
"/etc/ssh/ssh_host_rsa_key.pub"
|
||||
];
|
||||
directories = [
|
||||
"/var/lib/nixos"
|
||||
"/var/lib/systemd"
|
||||
"/var/log"
|
||||
"/var/lib/tailscale"
|
||||
];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user