WIP: Groundwork for impermanence setup for nixos and home
This commit is contained in:
@@ -210,6 +210,7 @@
|
|||||||
[
|
[
|
||||||
{ nixpkgs.hostPlatform = system; }
|
{ nixpkgs.hostPlatform = system; }
|
||||||
./nixos
|
./nixos
|
||||||
|
inputs.impermanence.nixosModules.impermanence
|
||||||
];
|
];
|
||||||
|
|
||||||
in
|
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 = {
|
programs.nixvim = {
|
||||||
plugins.conform-nvim = {
|
plugins.conform-nvim = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
lua = [ "stylua" ];
|
lua = [ "stylua" ];
|
||||||
@@ -13,6 +12,40 @@
|
|||||||
python = [ "black" ];
|
python = [ "black" ];
|
||||||
rust = [ "rustfmt" ];
|
rust = [ "rustfmt" ];
|
||||||
rasi = [ "prettierd" ];
|
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 = {
|
format_on_save = {
|
||||||
@@ -21,7 +54,6 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Install formatters
|
# Install formatters
|
||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; [
|
||||||
stylua
|
stylua
|
||||||
@@ -29,6 +61,7 @@
|
|||||||
black
|
black
|
||||||
rustfmt
|
rustfmt
|
||||||
prettierd
|
prettierd
|
||||||
|
clang-tools # provides clang-format
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
installRustc = true;
|
installRustc = true;
|
||||||
};
|
};
|
||||||
pylsp.enable = true; # Python language server
|
pylsp.enable = true; # Python language server
|
||||||
|
clangd.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Keymaps for LSP actions
|
# Keymaps for LSP actions
|
||||||
@@ -85,6 +86,7 @@
|
|||||||
lua-language-server
|
lua-language-server
|
||||||
nil
|
nil
|
||||||
rust-analyzer
|
rust-analyzer
|
||||||
|
clang-tools
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
./locale.nix
|
./locale.nix
|
||||||
./tailscale.nix
|
./tailscale.nix
|
||||||
./ssh.nix
|
./ssh.nix
|
||||||
|
./impermanence.nix
|
||||||
]
|
]
|
||||||
++ lib.optionals (!isServer) [
|
++ lib.optionals (!isServer) [
|
||||||
./regreet.nix
|
./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