From b9e4385f0c356803aca92d5183473f44295da589 Mon Sep 17 00:00:00 2001 From: xqtc161 Date: Mon, 1 Jul 2024 20:45:31 +0200 Subject: [PATCH] nix fmt; justfile adjustments --- home/modules/firefox.nix | 6 ++-- home/modules/home-pkgs.nix | 2 +- home/modules/yazi.nix | 6 +++- hosts/x86_64-linux/beleth/borg.nix | 22 ++++++++------ hosts/x86_64-linux/beleth/default.nix | 38 ++++++++++++------------- hosts/x86_64-linux/beleth/git.nix | 2 +- hosts/x86_64-linux/beleth/paperless.nix | 14 +++++---- hosts/x86_64-linux/lilith/default.nix | 2 +- justfile | 13 +++++++-- 9 files changed, 62 insertions(+), 43 deletions(-) diff --git a/home/modules/firefox.nix b/home/modules/firefox.nix index 80e42ba..a5ea646 100644 --- a/home/modules/firefox.nix +++ b/home/modules/firefox.nix @@ -19,15 +19,15 @@ with inputs; { sponsorblock # dearrow pronoundb - tabcenter-reborn - firefox-color + tabcenter-reborn + firefox-color unpaywall bitwarden sidebery leechblock-ng darkreader stylus - shinigami-eyes + shinigami-eyes violentmonkey vimium-c noscript diff --git a/home/modules/home-pkgs.nix b/home/modules/home-pkgs.nix index 61da2b2..b1f692d 100644 --- a/home/modules/home-pkgs.nix +++ b/home/modules/home-pkgs.nix @@ -65,7 +65,7 @@ in { pkgs.ghc pkgs.rizin - (pkgs.cutter.withPlugins (ps: with ps; [ jsdec rz-ghidra sigdb ])) + (pkgs.cutter.withPlugins (ps: with ps; [jsdec rz-ghidra sigdb])) pkgs.imhex pkgs.ghidra diff --git a/home/modules/yazi.nix b/home/modules/yazi.nix index 8cfcdb9..c1a0ca8 100644 --- a/home/modules/yazi.nix +++ b/home/modules/yazi.nix @@ -1,5 +1,9 @@ -{config, lib, pkgs, ...}: { + config, + lib, + pkgs, + ... +}: { programs.yazi = { enable = true; enableNushellIntegration = true; diff --git a/hosts/x86_64-linux/beleth/borg.nix b/hosts/x86_64-linux/beleth/borg.nix index a8e7230..9e36a0f 100644 --- a/hosts/x86_64-linux/beleth/borg.nix +++ b/hosts/x86_64-linux/beleth/borg.nix @@ -1,5 +1,9 @@ -{ config, lib, pkgs, ... }: { - +{ + config, + lib, + pkgs, + ... +}: { # # BACKUP # Check via nix-shell -p borgbackup --run "borg info --rsh 'ssh -p 23 -i /home/moe/.ssh/storagebox_nextcloud_data' u409248-sub1@u409248-sub1.your-storagebox.de:nextcloud_data_backups" @@ -34,14 +38,14 @@ nextcloud_data = { user = "nextcloud"; group = "nextcloud"; - paths = [ "${config.services.nextcloud.datadir}" ]; + paths = ["${config.services.nextcloud.datadir}"]; preHook = '' ${config.services.nextcloud.occ}/bin/nextcloud-occ maintenance:mode --on ''; postHook = '' ${config.services.nextcloud.occ}/bin/nextcloud-occ maintenance:mode --off ''; - repo = "u409248-sub1@u409248-sub1.your-storagebox.de:nextcloud_data_backups"; + repo = "u409248-sub1@u409248-sub1.your-storagebox.de:nextcloud_data_backups"; encryption = { mode = "repokey-blake2"; passCommand = "cat ${config.age.secrets.backup_nextcloud_data_passphrase.path}"; @@ -64,7 +68,7 @@ postHook = '' ${config.services.nextcloud.occ}/bin/nextcloud-occ maintenance:mode --off ''; - repo = "u409248-sub2@u409248-sub2.your-storagebox.de:nextcloud_database_backups"; + repo = "u409248-sub2@u409248-sub2.your-storagebox.de:nextcloud_database_backups"; encryption = { mode = "repokey-blake2"; passCommand = "cat ${config.age.secrets.backup_nextcloud_database_passphrase.path}"; @@ -78,12 +82,12 @@ }; systemd.services."borgbackup-job-nextcloud_data" = { - onFailure = [ "notify-email@%i.service" ]; - onSuccess = [ "notify-email@%i.service" ]; + onFailure = ["notify-email@%i.service"]; + onSuccess = ["notify-email@%i.service"]; }; systemd.services."borgbackup-job-nextcloud_database" = { - onFailure = [ "notify-email@%i.service" ]; - onSuccess = [ "notify-email@%i.service" ]; + onFailure = ["notify-email@%i.service"]; + onSuccess = ["notify-email@%i.service"]; }; } diff --git a/hosts/x86_64-linux/beleth/default.nix b/hosts/x86_64-linux/beleth/default.nix index 654e1d3..6921925 100644 --- a/hosts/x86_64-linux/beleth/default.nix +++ b/hosts/x86_64-linux/beleth/default.nix @@ -95,29 +95,29 @@ with lib; { ''; }; "jellyfin.heroin.trade" = { - extraConfig = '' - reverse_proxy http://127.0.0.1:8096 - ''; + extraConfig = '' + reverse_proxy http://127.0.0.1:8096 + ''; }; "calibre.heroin.trade" = { - extraConfig = '' - reverse_proxy http://localhost:3000 - ''; + extraConfig = '' + reverse_proxy http://localhost:3000 + ''; }; "grafana.heroin.trade" = { - extraConfig = '' - reverse_proxy http://127.0.0.1:2342 - ''; + extraConfig = '' + reverse_proxy http://127.0.0.1:2342 + ''; }; "uptime.heroin.trade" = { - extraConfig = '' - reverse_proxy http://127.0.0.1:3001 - ''; + extraConfig = '' + reverse_proxy http://127.0.0.1:3001 + ''; }; "paperless.heroin.trade" = { - extraConfig = '' - reverse_proxy http://127.0.0.1:28981 - ''; + extraConfig = '' + reverse_proxy http://127.0.0.1:28981 + ''; }; }; }; @@ -161,10 +161,10 @@ with lib; { ]; }; users.users.root.openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJTLJqIVwnqFO64rnc66d234TFOdFXpDS9fJUA4/f4in xqtc@alastor" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN7UkcmSVo+SeB5Obevz3mf3UHruYxn0UHUzoOs2gDBy xqtc@asmodeus" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPf3w5bHAssHthg9SPXVpG4w9v8m16X/0J3bjg08P6EA xqtc@seraphim" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJYa+LoHGGvu12iBufUcr3GD8tsq4LuJdwLjaDkTr0SL xqtc@lilith" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJTLJqIVwnqFO64rnc66d234TFOdFXpDS9fJUA4/f4in xqtc@alastor" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN7UkcmSVo+SeB5Obevz3mf3UHruYxn0UHUzoOs2gDBy xqtc@asmodeus" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPf3w5bHAssHthg9SPXVpG4w9v8m16X/0J3bjg08P6EA xqtc@seraphim" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJYa+LoHGGvu12iBufUcr3GD8tsq4LuJdwLjaDkTr0SL xqtc@lilith" ]; programs.bash.blesh.enable = true; diff --git a/hosts/x86_64-linux/beleth/git.nix b/hosts/x86_64-linux/beleth/git.nix index 2d1781e..4da35ac 100644 --- a/hosts/x86_64-linux/beleth/git.nix +++ b/hosts/x86_64-linux/beleth/git.nix @@ -15,7 +15,7 @@ REQUIRE_SIGNIN_VIEW = true; }; DEFAULT = { - APP_NAME = "Git so good it could be heroin"; + APP_NAME = "Git so good it could be heroin"; }; }; }; diff --git a/hosts/x86_64-linux/beleth/paperless.nix b/hosts/x86_64-linux/beleth/paperless.nix index 3087041..8da0f29 100644 --- a/hosts/x86_64-linux/beleth/paperless.nix +++ b/hosts/x86_64-linux/beleth/paperless.nix @@ -1,7 +1,11 @@ -{config, lib, inputs, ...}: { -services.paperless = { - enable = true; - passwordFile = "/etc/paperless_sc"; -}; + config, + lib, + inputs, + ... +}: { + services.paperless = { + enable = true; + passwordFile = "/etc/paperless_sc"; + }; } diff --git a/hosts/x86_64-linux/lilith/default.nix b/hosts/x86_64-linux/lilith/default.nix index 39678fc..388515b 100644 --- a/hosts/x86_64-linux/lilith/default.nix +++ b/hosts/x86_64-linux/lilith/default.nix @@ -126,7 +126,7 @@ # Define a user account. Don't forget to set a password with ‘passwd’. users.users.xqtc = { isNormalUser = true; - extraGroups = ["wheel" "docker" "libvirtd" "adbusers" ]; # Enable ‘sudo’ for the user. + extraGroups = ["wheel" "docker" "libvirtd" "adbusers"]; # Enable ‘sudo’ for the user. packages = with pkgs; [nushell clamtk]; shell = pkgs.nushell; }; diff --git a/justfile b/justfile index 7ed281b..ac6f2f5 100644 --- a/justfile +++ b/justfile @@ -11,9 +11,16 @@ rebuild: nh os switch . -- -vv --impure -j 4; exit fi - nh os switch . -- -vv --impure -j 4; + nh os switch . -- -vv; beleth: - nixos-rebuild switch --flake '.#beleth' --build-host {{beleth-host}} --target-host {{beleth-host}} - ssh {{beleth-user-host}} "cd; cd nixos-config; git pull; cd; sh build_website.sh" + #!/usr/bin/env bash + arch=$(nix-instantiate --eval -E 'builtins.currentSystem') + arch_sanitized=$(echo $arch | sed 's/^"//;s/"$//') + if [ $arch_sanitized == "x86_64-linux" ]; then + nixos-rebuild switch --flake '.#beleth' --build-host {{beleth-host}} --target-host {{beleth-host}}; + ssh {{beleth-user-host}} "cd; cd nixos-config; git pull; cd; sh build_website.sh"; + exit + fi + @echo "Host arch needs to be 'x86_64-linux'! Aborting...";