fix: bad references for server linux

This commit is contained in:
Noah Masur 2022-12-22 00:31:25 +00:00
parent d021baa1bb
commit b4ddb149cc
14 changed files with 30 additions and 20 deletions

View File

@ -11,6 +11,7 @@ nixpkgs.lib.nixosSystem {
../../modules ../../modules
../../nixos ../../nixos
globals globals
wsl.nixosModules.wsl
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
physical = true; physical = true;
@ -27,6 +28,7 @@ nixpkgs.lib.nixosSystem {
wallpaper = "${wallpapers}/gruvbox/road.jpg"; wallpaper = "${wallpapers}/gruvbox/road.jpg";
gtk.theme.name = nixpkgs.lib.mkDefault "Adwaita-dark"; gtk.theme.name = nixpkgs.lib.mkDefault "Adwaita-dark";
passwordHash = nixpkgs.lib.fileContents ../../private/password.sha512; passwordHash = nixpkgs.lib.fileContents ../../private/password.sha512;
wsl.enable = false;
media.enable = true; media.enable = true;
firefox.enable = true; firefox.enable = true;
@ -35,6 +37,7 @@ nixpkgs.lib.nixosSystem {
discord.enable = true; discord.enable = true;
nautilus.enable = true; nautilus.enable = true;
obsidian.enable = true; obsidian.enable = true;
mail.enable = true;
mail.aerc.enable = true; mail.aerc.enable = true;
mail.himalaya.enable = true; mail.himalaya.enable = true;
gaming.enable = true; gaming.enable = true;

View File

@ -27,6 +27,7 @@ darwin.lib.darwinSystem {
nixpkgs.overlays = [ firefox-darwin.overlay ] ++ overlays; nixpkgs.overlays = [ firefox-darwin.overlay ] ++ overlays;
# Set registry to flake packages, used for nix X commands # Set registry to flake packages, used for nix X commands
nix.registry.nixpkgs.flake = nixpkgs; nix.registry.nixpkgs.flake = nixpkgs;
mail.enable = true;
mail.aerc.enable = true; mail.aerc.enable = true;
mail.himalaya.enable = true; mail.himalaya.enable = true;
kitty.enable = true; kitty.enable = true;

View File

@ -15,12 +15,14 @@ nixpkgs.lib.nixosSystem {
../../modules ../../modules
../../nixos ../../nixos
(removeAttrs globals [ "mail.server" ]) (removeAttrs globals [ "mail.server" ])
wsl.nixosModules.wsl
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
server = true; server = true;
gui.enable = false; gui.enable = false;
theme = { colors = (import ../../colorscheme/gruvbox).dark; }; theme = { colors = (import ../../colorscheme/gruvbox).dark; };
nixpkgs.overlays = overlays; nixpkgs.overlays = overlays;
wsl.enable = false;
# FQDNs for various services # FQDNs for various services
networking.hostName = "oracle"; networking.hostName = "oracle";

View File

@ -7,11 +7,11 @@ nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = { }; specialArgs = { };
modules = [ modules = [
../../modules
../../nixos
globals globals
wsl.nixosModules.wsl wsl.nixosModules.wsl
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
../../modules
../../nixos
{ {
networking.hostName = "wsl"; networking.hostName = "wsl";
# Set registry to flake packages, used for nix X commands # Set registry to flake packages, used for nix X commands
@ -33,6 +33,7 @@ nixpkgs.lib.nixosSystem {
false; # Including Windows PATH will slow down Neovim command mode false; # Including Windows PATH will slow down Neovim command mode
}; };
mail.enable = true;
mail.aerc.enable = true; mail.aerc.enable = true;
mail.himalaya.enable = true; mail.himalaya.enable = true;
dotfiles.enable = true; dotfiles.enable = true;

View File

@ -3,6 +3,7 @@
imports = [ ./himalaya.nix ./aerc.nix ]; imports = [ ./himalaya.nix ./aerc.nix ];
options = { options = {
mail.enable = lib.mkEnableOption "Mail service.";
mail.user = lib.mkOption { mail.user = lib.mkOption {
type = lib.types.str; type = lib.types.str;
description = "User name for the email address."; description = "User name for the email address.";
@ -14,7 +15,7 @@
}; };
}; };
config = lib.mkIf (config.mail.user != null && config.mail.server != null) { config = lib.mkIf config.mail.enable {
home-manager.users.${config.user} = { home-manager.users.${config.user} = {
programs.mbsync = { enable = true; }; programs.mbsync = { enable = true; };

View File

@ -0,0 +1,5 @@
{ ... }: {
imports = [ ./calibre.nix ];
}

View File

@ -21,7 +21,7 @@
package = pkgs."${config.gtk.theme.package}"; package = pkgs."${config.gtk.theme.package}";
}; };
in lib.mkIf (pkgs.stdenv.isLinux && config.gui.enable) { in lib.mkIf config.gui.enable {
# Enable the X11 windowing system. # Enable the X11 windowing system.
services.xserver = { services.xserver = {

View File

@ -1,8 +1,5 @@
{ config, pkgs, lib, ... }: { { config, pkgs, lib, ... }: {
# Timezone required for Redshift schedule
imports = [ ../nixos/timezone.nix ];
config = config =
lib.mkIf (config.gui.enable && config.physical && pkgs.stdenv.isLinux) { lib.mkIf (config.gui.enable && config.physical && pkgs.stdenv.isLinux) {

View File

@ -44,14 +44,14 @@
systemd.services.litestream = { systemd.services.litestream = {
after = [ "backup-secret.service" ]; after = [ "backup-secret.service" ];
requires = [ "backup-secret.service" ]; requires = [ "backup-secret.service" ];
environment.AWS_ACCESS_KEY_ID = config.backupS3.accessKeyId; environment.AWS_ACCESS_KEY_ID = config.backup.s3.accessKeyId;
}; };
# # Backup library to object storage # # Backup library to object storage
# services.restic.backups.calibre = { # services.restic.backups.calibre = {
# user = "calibre-web"; # user = "calibre-web";
# repository = # repository =
# "s3://${config.backupS3.endpoint}/${config.backupS3.bucket}/calibre"; # "s3://${config.backup.s3.endpoint}/${config.backup.s3.bucket}/calibre";
# paths = [ # paths = [
# "/var/books" # "/var/books"
# "/var/lib/calibre-web/app.db" # "/var/lib/calibre-web/app.db"
@ -59,7 +59,7 @@
# ]; # ];
# initialize = true; # initialize = true;
# timerConfig = { OnCalendar = "00:05:00"; }; # timerConfig = { OnCalendar = "00:05:00"; };
# environmentFile = backupS3File; # environmentFile = backup.s3File;
# }; # };
}; };

View File

@ -53,7 +53,7 @@
let libraryPath = "/var/lib/calibre-web"; # Default location let libraryPath = "/var/lib/calibre-web"; # Default location
in { in {
description = "Backup Calibre data"; description = "Backup Calibre data";
environment.AWS_ACCESS_KEY_ID = config.backupS3.accessKeyId; environment.AWS_ACCESS_KEY_ID = config.backup.s3.accessKeyId;
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
User = "calibre-web"; User = "calibre-web";
@ -63,8 +63,8 @@
script = '' script = ''
${pkgs.awscli2}/bin/aws s3 sync \ ${pkgs.awscli2}/bin/aws s3 sync \
${libraryPath}/ \ ${libraryPath}/ \
s3://${config.backupS3.bucket}/calibre/ \ s3://${config.backup.s3.bucket}/calibre/ \
--endpoint-url=https://${config.backupS3.endpoint} --endpoint-url=https://${config.backup.s3.endpoint}
''; '';
}; };

View File

@ -75,7 +75,7 @@ in {
path = "${giteaPath}/data/gitea.db"; path = "${giteaPath}/data/gitea.db";
replicas = [{ replicas = [{
url = url =
"s3://${config.backupS3.bucket}.${config.backupS3.endpoint}/gitea"; "s3://${config.backup.s3.bucket}.${config.backup.s3.endpoint}/gitea";
}]; }];
}]; }];
}; };

View File

@ -2,7 +2,7 @@
options = { options = {
n8nServer = lib.mkOption { n8nServer = lib.mkOption {
type = lib.types.str; type = lib.types.nullOr lib.types.str;
description = "Hostname for n8n automation"; description = "Hostname for n8n automation";
default = null; default = null;
}; };

View File

@ -69,7 +69,7 @@
path = "${config.services.nextcloud.datadir}/data/nextcloud.db"; path = "${config.services.nextcloud.datadir}/data/nextcloud.db";
replicas = [{ replicas = [{
url = url =
"s3://${config.backupS3.bucket}.${config.backupS3.endpoint}/nextcloud"; "s3://${config.backup.s3.bucket}.${config.backup.s3.endpoint}/nextcloud";
}]; }];
}]; }];
}; };

View File

@ -77,7 +77,7 @@ in {
path = "${vaultwardenPath}/db.sqlite3"; path = "${vaultwardenPath}/db.sqlite3";
replicas = [{ replicas = [{
url = url =
"s3://${config.backupS3.bucket}.${config.backupS3.endpoint}/vaultwarden"; "s3://${config.backup.s3.bucket}.${config.backup.s3.endpoint}/vaultwarden";
}]; }];
}]; }];
}; };
@ -101,7 +101,7 @@ in {
# Backup other Vaultwarden data to object storage # Backup other Vaultwarden data to object storage
systemd.services.vaultwarden-backup = { systemd.services.vaultwarden-backup = {
description = "Backup Vaultwarden files"; description = "Backup Vaultwarden files";
environment.AWS_ACCESS_KEY_ID = config.backupS3.accessKeyId; environment.AWS_ACCESS_KEY_ID = config.backup.s3.accessKeyId;
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
User = "vaultwarden"; User = "vaultwarden";
@ -111,8 +111,8 @@ in {
script = '' script = ''
${pkgs.awscli2}/bin/aws s3 sync \ ${pkgs.awscli2}/bin/aws s3 sync \
${vaultwardenPath}/ \ ${vaultwardenPath}/ \
s3://${config.backupS3.bucket}/vaultwarden/ \ s3://${config.backup.s3.bucket}/vaultwarden/ \
--endpoint-url=https://${config.backupS3.endpoint} \ --endpoint-url=https://${config.backup.s3.endpoint} \
--exclude "*db.sqlite3*" \ --exclude "*db.sqlite3*" \
--exclude ".db.sqlite3*" --exclude ".db.sqlite3*"
''; '';