chore: reformat codebase

This commit is contained in:
Gabriel Arazas 2023-06-08 21:19:17 +08:00
parent 9d99235d94
commit 1bdda28ffe
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
7 changed files with 94 additions and 82 deletions

View File

@ -231,18 +231,22 @@ in
# We're using wg-quick here as this host is using network managers that can # We're using wg-quick here as this host is using network managers that can
# differ between workflows (i.e., GNOME and KDE Plasma using NetworkManager, # differ between workflows (i.e., GNOME and KDE Plasma using NetworkManager,
# others might be using systemd-networkd). # others might be using systemd-networkd).
networking.wg-quick.interfaces.wireguard0 = let networking.wg-quick.interfaces.wireguard0 =
let
domains = [ domains = [
"~plover.foodogsquared.one" "~plover.foodogsquared.one"
"~0.27.172.in-addr.arpa" "~0.27.172.in-addr.arpa"
]; ];
in { in
{
privateKeyFile = config.sops.secrets."ni/wireguard/private-key".path; privateKeyFile = config.sops.secrets."ni/wireguard/private-key".path;
listenPort = wireguardPort; listenPort = wireguardPort;
dns = with interfaces.internal; [ IPv4.adress IPv6.address ]; dns = with interfaces.internal; [ IPv4.adress IPv6.address ];
postUp = let postUp =
let
resolvectl = "${lib.getBin pkgs.systemd}/bin/resolvectl"; resolvectl = "${lib.getBin pkgs.systemd}/bin/resolvectl";
in '' in
''
${resolvectl} domain %i ${lib.concatStringsSep " " domains} ${resolvectl} domain %i ${lib.concatStringsSep " " domains}
''; '';

View File

@ -165,7 +165,8 @@ in
${replaceSecretBin} '#mailboxSecurityKey#' '${secretsPath "dns/${domain}/mailbox-security-key"}' '${domainZoneFile'}' ${replaceSecretBin} '#mailboxSecurityKey#' '${secretsPath "dns/${domain}/mailbox-security-key"}' '${domainZoneFile'}'
${replaceSecretBin} '#mailboxSecurityKeyRecord#' '${secretsPath "dns/${domain}/mailbox-security-key-record"}' '${domainZoneFile'}' ${replaceSecretBin} '#mailboxSecurityKeyRecord#' '${secretsPath "dns/${domain}/mailbox-security-key-record"}' '${domainZoneFile'}'
''; '';
serviceConfig.LoadCredential = let serviceConfig.LoadCredential =
let
certDirectory = certs."${dnsDomainName}".directory; certDirectory = certs."${dnsDomainName}".directory;
in in
[ [

View File

@ -137,7 +137,8 @@ in
# Gitea service module will have to set up certain things first which is # Gitea service module will have to set up certain things first which is
# why we have to go first. # why we have to go first.
preStart = let preStart =
let
giteaBin = "${lib.getBin config.services.gitea.package}/bin/gitea"; giteaBin = "${lib.getBin config.services.gitea.package}/bin/gitea";
giteaAdminUsername = lib.escapeShellArg "foodogsquared"; giteaAdminUsername = lib.escapeShellArg "foodogsquared";
in in

View File

@ -62,7 +62,8 @@ in
# Modifying it a little bit for per-user schema. # Modifying it a little bit for per-user schema.
systemd.services.keycloak = { systemd.services.keycloak = {
preStart = let preStart =
let
psqlBin = "${lib.getBin config.services.postgresql.package}/bin/psql"; psqlBin = "${lib.getBin config.services.postgresql.package}/bin/psql";
in in
lib.mkAfter '' lib.mkAfter ''

View File

@ -61,7 +61,7 @@ let
note of the commands used for each type as documented from note of the commands used for each type as documented from
`config.home.mutableFile.<name>.type`. `config.home.mutableFile.<name>.type`.
''; '';
default = []; default = [ ];
example = [ "--depth" "1" ]; example = [ "--depth" "1" ];
}; };
}; };
@ -136,7 +136,8 @@ in
script = pkgs.writeShellScript "fetch-mutable-files" '' script = pkgs.writeShellScript "fetch-mutable-files" ''
${lib.concatStringsSep "\n" mutableFilesCmds} ${lib.concatStringsSep "\n" mutableFilesCmds}
''; '';
in builtins.toString script; in
builtins.toString script;
}; };
Install.WantedBy = [ "default.target" ]; Install.WantedBy = [ "default.target" ];

View File

@ -6,9 +6,11 @@
home-manager.url = "github:nix-community/home-manager"; home-manager.url = "github:nix-community/home-manager";
}; };
outputs = { nixpkgs, home-manager, ... }: let outputs = { nixpkgs, home-manager, ... }:
let
system = "x85_64-linux"; system = "x85_64-linux";
in { in
{
nixosConfigurations.desktop = nixpkgs.lib.nixosSystem { nixosConfigurations.desktop = nixpkgs.lib.nixosSystem {
inherit system; inherit system;
modules = [ ./hosts/desktop ]; modules = [ ./hosts/desktop ];

View File

@ -354,12 +354,14 @@ in
}; };
systemd.user.services.fetch-mutable-files = { systemd.user.services.fetch-mutable-files = {
Service.ExecStartPost = let Service.ExecStartPost =
let
script = pkgs.writeShellScript "post-fetch-mutable-files" '' script = pkgs.writeShellScript "post-fetch-mutable-files" ''
# Automate installation of Doom Emacs. # Automate installation of Doom Emacs.
${config.xdg.configHome}/emacs/bin/doom install --no-config --no-fonts --install --force ${config.xdg.configHome}/emacs/bin/doom install --no-config --no-fonts --install --force
${config.xdg.configHome}/emacs/bin/doom sync ${config.xdg.configHome}/emacs/bin/doom sync
''; '';
in builtins.toString script; in
builtins.toString script;
}; };
} }