Merge branch 'main' of ssh://codeberg.org/dnscio/nix-config
This commit is contained in:
commit
aeabb65f60
10 changed files with 156 additions and 42 deletions
4
Justfile
4
Justfile
|
|
@ -1,5 +1,5 @@
|
||||||
deploy:
|
deploy:
|
||||||
nixos-rebuild switch --flake .
|
git add . && git commit -am "new revision" && nixos-rebuild switch --flake .
|
||||||
|
|
||||||
debug:
|
debug:
|
||||||
nixos-rebuild switch --flake . --show-trace --verbose
|
nixos-rebuild switch --flake . --show-trace --verbose
|
||||||
|
|
@ -26,7 +26,7 @@ gc:
|
||||||
|
|
||||||
# dnsc-air
|
# dnsc-air
|
||||||
mre:
|
mre:
|
||||||
darwin-rebuild switch --flake .
|
if ! git diff --quiet || ! git diff --staged --quiet; then git add . && git commit -am "new revision"; fi && darwin-rebuild switch --flake .
|
||||||
|
|
||||||
mup:
|
mup:
|
||||||
darwin-rebuild switch --recreate-lock-file --flake .
|
darwin-rebuild switch --recreate-lock-file --flake .
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@
|
||||||
description = "Dennis Schoepf";
|
description = "Dennis Schoepf";
|
||||||
};
|
};
|
||||||
nix.settings.trusted-users = [ "dennis" ];
|
nix.settings.trusted-users = [ "dennis" ];
|
||||||
|
security.pam.services.sudo_local.touchIdAuth = true;
|
||||||
|
|
||||||
# Device specific overlays
|
# Device specific overlays
|
||||||
nixpkgs.overlays = [ ];
|
nixpkgs.overlays = [ ];
|
||||||
|
|
@ -63,6 +64,7 @@
|
||||||
homebrew.casks = lib.mkAfter ([
|
homebrew.casks = lib.mkAfter ([
|
||||||
"cyberduck"
|
"cyberduck"
|
||||||
"krita"
|
"krita"
|
||||||
|
"darktable"
|
||||||
]);
|
]);
|
||||||
|
|
||||||
# Shells
|
# Shells
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
../../modules/actual-server
|
../../modules/actual-server
|
||||||
../../modules/immich
|
../../modules/immich
|
||||||
../../modules/cockpit
|
../../modules/cockpit
|
||||||
|
../../modules/backrest
|
||||||
];
|
];
|
||||||
|
|
||||||
# General
|
# General
|
||||||
|
|
@ -35,7 +36,9 @@
|
||||||
# Secrets
|
# Secrets
|
||||||
age = {
|
age = {
|
||||||
identityPaths = [ "${config.users.users.dennis.home}/.ssh/id_ed25519" ];
|
identityPaths = [ "${config.users.users.dennis.home}/.ssh/id_ed25519" ];
|
||||||
secrets."restic/password".file = ../../secrets/restic/password.age;
|
secrets."restic/password" = {
|
||||||
|
file = ../../secrets/restic/password.age;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Nix Settings
|
# Nix Settings
|
||||||
|
|
@ -64,10 +67,12 @@
|
||||||
allowedTCPPorts = [
|
allowedTCPPorts = [
|
||||||
22
|
22
|
||||||
443
|
443
|
||||||
|
9004
|
||||||
];
|
];
|
||||||
allowedUDPPorts = [
|
allowedUDPPorts = [
|
||||||
22
|
22
|
||||||
443
|
443
|
||||||
|
9004
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -147,6 +152,10 @@
|
||||||
reverse_proxy http://127.0.0.1:9003
|
reverse_proxy http://127.0.0.1:9003
|
||||||
tls internal
|
tls internal
|
||||||
'';
|
'';
|
||||||
|
virtualHosts."backup.home.lan".extraConfig = ''
|
||||||
|
reverse_proxy http://127.0.0.1:9004
|
||||||
|
tls internal
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# Environment variables
|
# Environment variables
|
||||||
|
|
|
||||||
98
modules/backrest/default.nix
Normal file
98
modules/backrest/default.nix
Normal file
|
|
@ -0,0 +1,98 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
# Declarative backrest config referencing the existing restic repo.
|
||||||
|
# The password is read at runtime from the agenix secret path via
|
||||||
|
# BACKREST_VAR_RESTIC_PASSWORD, which backrest expands as ${RESTIC_PASSWORD}
|
||||||
|
# inside the repo env block.
|
||||||
|
backrestConfig = builtins.toJSON {
|
||||||
|
version = 4;
|
||||||
|
modno = 1;
|
||||||
|
instance = "dnsc-server";
|
||||||
|
repos = [
|
||||||
|
{
|
||||||
|
id = "dnsc-storage";
|
||||||
|
uri = "sftp:dnsc-storage:restic/dnsc-server";
|
||||||
|
env = [ "RESTIC_PASSWORD_FILE=${config.age.secrets."restic/password".path}" ];
|
||||||
|
flags = [
|
||||||
|
"-o 'sftp.args=-i /root/.ssh/id_ed25519 -o StrictHostKeyChecking=accept-new'"
|
||||||
|
];
|
||||||
|
autoInitialize = false;
|
||||||
|
guid = "15448172d015919712f015508d40e28d13db4c9e877bf545454c8289ad621069";
|
||||||
|
prunePolicy = {
|
||||||
|
schedule = {
|
||||||
|
disabled = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
checkPolicy = {
|
||||||
|
schedule = {
|
||||||
|
disabled = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
plans = [
|
||||||
|
{
|
||||||
|
id = "dnsc-storage-plan";
|
||||||
|
repo = "dnsc-storage";
|
||||||
|
paths = config.services.restic.backups."dnsc-storage".paths;
|
||||||
|
schedule = {
|
||||||
|
disabled = true;
|
||||||
|
};
|
||||||
|
retention = {
|
||||||
|
policyKeepLastN = 3;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
auth = {
|
||||||
|
disabled = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
environment.systemPackages = lib.mkAfter (
|
||||||
|
with pkgs;
|
||||||
|
[
|
||||||
|
backrest
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
# Write the declarative config into the backrest state dir at activation time.
|
||||||
|
# The file must be in a writable location because backrest creates a .bak
|
||||||
|
# alongside it when migrating. /var/lib/backrest is owned by the backrest user.
|
||||||
|
system.activationScripts.backrestConfig = {
|
||||||
|
deps = [ "users" ];
|
||||||
|
text = ''
|
||||||
|
install -d -m 750 /var/lib/backrest
|
||||||
|
install -m 640 \
|
||||||
|
${pkgs.writeText "backrest-config.json" backrestConfig} \
|
||||||
|
/var/lib/backrest/config.json
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.backrest = {
|
||||||
|
enable = true;
|
||||||
|
description = "Restic GUI";
|
||||||
|
after = [ "network.target" ];
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
|
||||||
|
environment = {
|
||||||
|
BACKREST_PORT = "9004";
|
||||||
|
BACKREST_RESTIC_COMMAND = "${pkgs.restic}/bin/restic";
|
||||||
|
BACKREST_CONFIG = "/var/lib/backrest/config.json";
|
||||||
|
BACKREST_DATA = "/var/lib/backrest/data";
|
||||||
|
};
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "simple";
|
||||||
|
User = "root";
|
||||||
|
ExecStart = "${pkgs.backrest}/bin/backrest";
|
||||||
|
Restart = "on-failure";
|
||||||
|
RestartSec = "5s";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
orientation = "right";
|
orientation = "right";
|
||||||
show-recents = false;
|
show-recents = false;
|
||||||
persistent-apps = [
|
persistent-apps = [
|
||||||
"/Applications/Zen.app"
|
"/Applications/Helium.app"
|
||||||
"/Applications/Ghostty.app"
|
"/Applications/Ghostty.app"
|
||||||
"/System/Applications/System Settings.app/"
|
"/System/Applications/System Settings.app/"
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -56,15 +56,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
extraPlugins = [
|
extraPlugins = [
|
||||||
(pkgs.vimUtils.buildVimPlugin {
|
pkgs.vimPlugins.vim-cool
|
||||||
name = "edge.vim";
|
|
||||||
src = pkgs.fetchFromGitHub {
|
|
||||||
"owner" = "Yohannfra";
|
|
||||||
"repo" = "edge.vim";
|
|
||||||
"rev" = "c5a165269d2643c12e62841776e8ba55e0f05e28";
|
|
||||||
"hash" = "sha256-nXXcg2ggYN75ZSOgB8isxCbN8YigldO05Ja0/WigjAs=";
|
|
||||||
};
|
|
||||||
})
|
|
||||||
];
|
];
|
||||||
|
|
||||||
autoCmd = [
|
autoCmd = [
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,11 @@
|
||||||
package = pkgs.nil;
|
package = pkgs.nil;
|
||||||
packageFallback = true;
|
packageFallback = true;
|
||||||
};
|
};
|
||||||
|
gopls = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.gopls;
|
||||||
|
packageFallback = true;
|
||||||
|
};
|
||||||
ts_ls = {
|
ts_ls = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.typescript-language-server;
|
package = pkgs.typescript-language-server;
|
||||||
|
|
@ -41,6 +46,7 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.astro-language-server;
|
package = pkgs.astro-language-server;
|
||||||
packageFallback = true;
|
packageFallback = true;
|
||||||
|
config.init_options.typescript.tsdk = "${pkgs.typescript}/lib/node_modules/typescript/lib";
|
||||||
};
|
};
|
||||||
eslint = {
|
eslint = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
||||||
|
|
@ -26,13 +26,12 @@
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
|
||||||
lualine_b = [
|
lualine_b = [
|
||||||
{
|
{
|
||||||
__unkeyed-1 = "filename";
|
__unkeyed-1 = "filename";
|
||||||
file_status = true;
|
file_status = true;
|
||||||
newfile_status = false;
|
newfile_status = false;
|
||||||
path = 1;
|
path = 4;
|
||||||
shorting_target = 120;
|
shorting_target = 120;
|
||||||
symbols = {
|
symbols = {
|
||||||
modified = "[+]";
|
modified = "[+]";
|
||||||
|
|
@ -43,8 +42,6 @@
|
||||||
}
|
}
|
||||||
"encoding"
|
"encoding"
|
||||||
];
|
];
|
||||||
lualine_c = [ ];
|
|
||||||
lualine_x = [ ];
|
|
||||||
lualine_y = [
|
lualine_y = [
|
||||||
"branch"
|
"branch"
|
||||||
"diff"
|
"diff"
|
||||||
|
|
@ -52,9 +49,9 @@
|
||||||
];
|
];
|
||||||
lualine_z = [
|
lualine_z = [
|
||||||
"location"
|
"location"
|
||||||
"progress"
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# Sets up my custom colorscheme
|
# Sets up my custom colorscheme
|
||||||
luaConfig.pre = /* lua */ ''
|
luaConfig.pre = /* lua */ ''
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@
|
||||||
repository = "sftp:dnsc-storage:restic/dnsc-server";
|
repository = "sftp:dnsc-storage:restic/dnsc-server";
|
||||||
createWrapper = true;
|
createWrapper = true;
|
||||||
paths = [
|
paths = [
|
||||||
"/home/dennis/notes"
|
|
||||||
"/main/share"
|
"/main/share"
|
||||||
"/data/actual-server"
|
"/data/actual-server"
|
||||||
];
|
];
|
||||||
|
|
@ -32,7 +31,7 @@
|
||||||
"--keep-last 3"
|
"--keep-last 3"
|
||||||
];
|
];
|
||||||
timerConfig = {
|
timerConfig = {
|
||||||
onCalendar = "daily";
|
OnCalendar = "daily";
|
||||||
Persistent = true;
|
Persistent = true;
|
||||||
RandomizedDelaySec = "5h";
|
RandomizedDelaySec = "5h";
|
||||||
};
|
};
|
||||||
|
|
|
||||||
11
modules/tmuxinator/personal-layouts/dnsc.yml
Normal file
11
modules/tmuxinator/personal-layouts/dnsc.yml
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
name: dnsc-io
|
||||||
|
root: ~/dev/dnsc-io
|
||||||
|
windows:
|
||||||
|
- dev:
|
||||||
|
layout: main-horizontal
|
||||||
|
panes:
|
||||||
|
- nvim +"lua Snacks.picker.files({ hidden = true })"
|
||||||
|
- run:
|
||||||
|
layout: main-vertical
|
||||||
|
panes:
|
||||||
|
- "pnpm dev"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue