From ebd7b88909bab49d2c82c340192a31b3612c154d Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Mon, 17 Feb 2025 14:05:23 -0500 Subject: [PATCH] fix references --- hosts-old/aarch64-darwin/default.nix | 2 + hosts-old/aarch64-linux/default.nix | 2 + hosts-old/x86_64-linux/default.nix | 2 + hosts/nixos/swan/default.nix | 7 +- hosts/nixos/tempest/default.nix | 7 ++ platforms/generators/aws/default.nix | 31 +++++++ platforms/generators/default.nix | 9 ++ platforms/home-manager/default.nix | 2 + .../modules/nmasur/presets/programs/doas.nix | 4 +- .../nmasur/presets/programs/dotfiles.nix | 2 +- .../modules/nmasur/presets/programs/fish.nix | 2 +- .../nmasur/presets/programs/jujutsu.nix | 14 +-- .../modules/nmasur/presets/programs/mpv.nix | 4 +- .../nmasur/presets/programs/neovim.nix | 2 +- .../nmasur/presets/programs/nixpkgs.nix | 85 +++++++++---------- .../presets/programs/rofi/brightness.nix | 67 ++++++++------- .../nmasur/presets/programs/rofi/default.nix | 2 +- .../modules/nmasur/presets/services/dunst.nix | 34 ++++---- .../modules/nmasur/presets/services/i3.nix | 4 +- .../nmasur/presets/services/mbsync.nix | 2 +- .../modules/nmasur/profiles/linux-gui.nix | 2 +- .../home-manager/modules/nmasur/settings.nix | 19 +++++ platforms/nix-darwin/default.nix | 2 + platforms/nixos/default.nix | 2 + .../nmasur/presets/services/actualbudget.nix | 2 +- .../modules/nmasur/presets/services/arr.nix | 8 +- .../presets/services/audiobookshelf.nix | 2 +- .../modules/nmasur/presets/services/caddy.nix | 16 ++-- .../nmasur/presets/services/calibre-web.nix | 2 +- .../nmasur/presets/services/cloudflare.nix | 2 +- .../nmasur/presets/services/filebrowser.nix | 4 +- .../modules/nmasur/presets/services/gitea.nix | 4 +- .../nmasur/presets/services/grafana.nix | 2 +- .../nmasur/presets/services/immich.nix | 2 +- .../nmasur/presets/services/influxdb2.nix | 2 +- .../nmasur/presets/services/jellyfin.nix | 6 +- .../nmasur/presets/services/litestream.nix | 2 +- .../presets/services/minecraft-server.nix | 2 +- .../modules/nmasur/presets/services/n8n.nix | 2 +- .../nmasur/presets/services/nextcloud.nix | 4 +- .../nmasur/presets/services/ntfy-sh.nix | 2 +- .../nmasur/presets/services/paperless.nix | 2 +- .../nmasur/presets/services/postgresql.nix | 49 +++++------ .../presets/services/prometheus-exporters.nix | 2 +- .../nmasur/presets/services/template.nix | 18 ---- .../nmasur/presets/services/thelounge.nix | 4 +- .../nmasur/presets/services/transmission.nix | 2 +- .../nmasur/presets/services/uptime-kuma.nix | 2 +- .../nmasur/presets/services/vaultwarden.nix | 2 +- .../presets/services/victoriametrics.nix | 6 +- .../nmasur/presets/services/vm-agent.nix | 4 +- .../nixos/modules/nmasur/presets/zfs.nix | 2 +- .../nixos/modules/nmasur/profiles/aws.nix | 20 ----- .../nixos/modules/nmasur/profiles/nas.nix | 2 +- 54 files changed, 272 insertions(+), 216 deletions(-) create mode 100644 platforms/generators/aws/default.nix create mode 100644 platforms/generators/default.nix create mode 100644 platforms/home-manager/modules/nmasur/settings.nix delete mode 100644 platforms/nixos/modules/nmasur/presets/services/template.nix delete mode 100644 platforms/nixos/modules/nmasur/profiles/aws.nix diff --git a/hosts-old/aarch64-darwin/default.nix b/hosts-old/aarch64-darwin/default.nix index 2303757..94d6522 100644 --- a/hosts-old/aarch64-darwin/default.nix +++ b/hosts-old/aarch64-darwin/default.nix @@ -5,6 +5,8 @@ lib.pipe (lib.filesystem.listFilesRecursive ./.) [ # Get only files ending in default.nix (builtins.filter (name: lib.hasSuffix "default.nix" name)) + # Remove this file + (builtins.filter (name: name != ./default.nix)) # Import each host function map (file: { diff --git a/hosts-old/aarch64-linux/default.nix b/hosts-old/aarch64-linux/default.nix index 24b0b2f..0d927f6 100644 --- a/hosts-old/aarch64-linux/default.nix +++ b/hosts-old/aarch64-linux/default.nix @@ -9,6 +9,8 @@ in lib.pipe (lib.filesystem.listFilesRecursive ./.) [ # Get only files ending in default.nix (builtins.filter (name: lib.hasSuffix "default.nix" name)) + # Remove this file + (builtins.filter (name: name != ./default.nix)) # Import each host function map (file: { diff --git a/hosts-old/x86_64-linux/default.nix b/hosts-old/x86_64-linux/default.nix index 24b0b2f..0d927f6 100644 --- a/hosts-old/x86_64-linux/default.nix +++ b/hosts-old/x86_64-linux/default.nix @@ -9,6 +9,8 @@ in lib.pipe (lib.filesystem.listFilesRecursive ./.) [ # Get only files ending in default.nix (builtins.filter (name: lib.hasSuffix "default.nix" name)) + # Remove this file + (builtins.filter (name: name != ./default.nix)) # Import each host function map (file: { diff --git a/hosts/nixos/swan/default.nix b/hosts/nixos/swan/default.nix index 37c3798..6ce7eb1 100644 --- a/hosts/nixos/swan/default.nix +++ b/hosts/nixos/swan/default.nix @@ -13,13 +13,14 @@ rec { in { audiobooks = "read.${baseName}"; + books = "books.${baseName}"; + content = "cloud.${baseName}"; + download = "download.${baseName}"; files = "files.${baseName}"; paperless = "paper.${baseName}"; photos = "photos.${baseName}"; + prometheus = "prom.${baseName}"; stream = "stream.${baseName}"; - content = "cloud.${baseName}"; - books = "books.${baseName}"; - download = "download.${baseName}"; }; }; diff --git a/hosts/nixos/tempest/default.nix b/hosts/nixos/tempest/default.nix index f706978..383f841 100644 --- a/hosts/nixos/tempest/default.nix +++ b/hosts/nixos/tempest/default.nix @@ -8,6 +8,13 @@ rec { nmasur.settings = { username = "noah"; fullName = "Noah Masur"; + hostnames = + let + baseName = "masu.rs"; + in + { + prometheus = "prom.${baseName}"; + }; }; nmasur.profiles = { diff --git a/platforms/generators/aws/default.nix b/platforms/generators/aws/default.nix new file mode 100644 index 0000000..5507ae2 --- /dev/null +++ b/platforms/generators/aws/default.nix @@ -0,0 +1,31 @@ +{ + config, + pkgs, + lib, + ... +}: + +let + cfg = config.aws; +in +{ + + options.aws.enable = lib.mkEnableOption "AWS EC2"; + + config = lib.mkIf cfg.enable { + + # AWS settings require this + permitRootLogin = "prohibit-password"; + + # Make sure disk size is large enough + # https://github.com/nix-community/nixos-generators/issues/150 + amazonImage.sizeMB = 16 * 1024; + + boot.kernelPackages = pkgs.legacyPackages.x86_64-linux.linuxKernel.packages.linux_6_6; + boot.loader.systemd-boot.enable = lib.mkForce false; + boot.loader.efi.canTouchEfiVariables = lib.mkForce false; + services.amazon-ssm-agent.enable = true; + users.users.ssm-user.extraGroups = [ "wheel" ]; + + }; +} diff --git a/platforms/generators/default.nix b/platforms/generators/default.nix new file mode 100644 index 0000000..a4303ca --- /dev/null +++ b/platforms/generators/default.nix @@ -0,0 +1,9 @@ +{ lib, ... }: +{ + imports = lib.pipe (lib.filesystem.listFilesRecursive ./.) [ + # Get only files ending in .nix + (builtins.filter (name: lib.hasSuffix ".nix" name)) + # Remove this file + (builtins.filter (name: name != ./default.nix)) + ]; +} diff --git a/platforms/home-manager/default.nix b/platforms/home-manager/default.nix index fc248e2..a4303ca 100644 --- a/platforms/home-manager/default.nix +++ b/platforms/home-manager/default.nix @@ -3,5 +3,7 @@ imports = lib.pipe (lib.filesystem.listFilesRecursive ./.) [ # Get only files ending in .nix (builtins.filter (name: lib.hasSuffix ".nix" name)) + # Remove this file + (builtins.filter (name: name != ./default.nix)) ]; } diff --git a/platforms/home-manager/modules/nmasur/presets/programs/doas.nix b/platforms/home-manager/modules/nmasur/presets/programs/doas.nix index 601ddbb..a5f89cb 100644 --- a/platforms/home-manager/modules/nmasur/presets/programs/doas.nix +++ b/platforms/home-manager/modules/nmasur/presets/programs/doas.nix @@ -15,12 +15,12 @@ in config = lib.mkIf cfg.enable { # Alias sudo to doas for convenience - fish.shellAliases = { + programs.fish.shellAliases = { sudo = "doas"; }; # Disable overriding our sudo alias with a TERMINFO alias - kitty.settings.shell_integration = "no-sudo"; + programs.kitty.settings.shell_integration = "no-sudo"; }; } diff --git a/platforms/home-manager/modules/nmasur/presets/programs/dotfiles.nix b/platforms/home-manager/modules/nmasur/presets/programs/dotfiles.nix index 3d85a33..4cee933 100644 --- a/platforms/home-manager/modules/nmasur/presets/programs/dotfiles.nix +++ b/platforms/home-manager/modules/nmasur/presets/programs/dotfiles.nix @@ -12,7 +12,7 @@ in # Allows me to make sure I can work on my dotfiles locally - options.nmasur.preset.programs.dotfiles = { + options.nmasur.presets.programs.dotfiles = { enable = lib.mkEnableOption "Clone dotfiles repository"; repo = lib.mkOption { type = lib.types.str; diff --git a/platforms/home-manager/modules/nmasur/presets/programs/fish.nix b/platforms/home-manager/modules/nmasur/presets/programs/fish.nix index 26d1900..1e6a7c8 100644 --- a/platforms/home-manager/modules/nmasur/presets/programs/fish.nix +++ b/platforms/home-manager/modules/nmasur/presets/programs/fish.nix @@ -21,7 +21,7 @@ in config = lib.mkIf cfg.enable { - cfg.fish_user_key_bindings = # fish + nmasur.presets.programs.fish.fish_user_key_bindings = # fish '' # Shift-Enter (defined by terminal) bind -M insert \x1F accept-autosuggestion diff --git a/platforms/home-manager/modules/nmasur/presets/programs/jujutsu.nix b/platforms/home-manager/modules/nmasur/presets/programs/jujutsu.nix index eb26e4c..5cadfc2 100644 --- a/platforms/home-manager/modules/nmasur/presets/programs/jujutsu.nix +++ b/platforms/home-manager/modules/nmasur/presets/programs/jujutsu.nix @@ -13,13 +13,15 @@ in options.nmasur.presets.programs.jujutsu.enable = lib.mkEnableOption "Jujutsu version control"; config = lib.mkIf cfg.enable { - enable = true; + programs.jujutsu = { + enable = true; - # https://github.com/martinvonz/jj/blob/main/docs/config.md - settings = { - user = { - name = config.programs.git.userName; - email = config.programs.git.userEmail; + # https://github.com/martinvonz/jj/blob/main/docs/config.md + settings = { + user = { + name = config.programs.git.userName; + email = config.programs.git.userEmail; + }; }; }; diff --git a/platforms/home-manager/modules/nmasur/presets/programs/mpv.nix b/platforms/home-manager/modules/nmasur/presets/programs/mpv.nix index ab2304f..d13261a 100644 --- a/platforms/home-manager/modules/nmasur/presets/programs/mpv.nix +++ b/platforms/home-manager/modules/nmasur/presets/programs/mpv.nix @@ -6,12 +6,12 @@ }: let - cfg = config.nmasur.presets.programs.alacritty; + cfg = config.nmasur.presets.programs.mpv; in { - options.nmasur.presets.programs.alacritty.enable = lib.mkEnableOption "Alacritty terminal"; + options.nmasur.presets.programs.mpv.enable = lib.mkEnableOption "mpv video player"; config = lib.mkIf cfg.enable { # Video player diff --git a/platforms/home-manager/modules/nmasur/presets/programs/neovim.nix b/platforms/home-manager/modules/nmasur/presets/programs/neovim.nix index 08bf552..8070760 100644 --- a/platforms/home-manager/modules/nmasur/presets/programs/neovim.nix +++ b/platforms/home-manager/modules/nmasur/presets/programs/neovim.nix @@ -28,7 +28,7 @@ in home.packages = [ cfg.package ]; - cfg.package = lib.mkDefault pkgs.nmasur-neovim.override { + nmasur.presets.programs.neovim.package = lib.mkDefault pkgs.nmasur-neovim.override { colors = cfg.colors; github = cfg.github.enable; terraform = cfg.terraform.enable; diff --git a/platforms/home-manager/modules/nmasur/presets/programs/nixpkgs.nix b/platforms/home-manager/modules/nmasur/presets/programs/nixpkgs.nix index 8b00a96..64bdcb3 100644 --- a/platforms/home-manager/modules/nmasur/presets/programs/nixpkgs.nix +++ b/platforms/home-manager/modules/nmasur/presets/programs/nixpkgs.nix @@ -6,7 +6,6 @@ }: let - inherit (config.nmasur.settings) username; cfg = config.nmasur.presets.programs.nixpkgs; in @@ -110,51 +109,47 @@ in '' ); - # Set automatic generation cleanup for home-manager - nix.gc = { - automatic = config.nix.gc.automatic; - options = config.nix.gc.options; + nix = { + + # Set channel to flake packages, used for nix-shell commands + nixPath = [ "nixpkgs=${pkgs.path}" ]; + + # For security, only allow specific users + settings.allowed-users = [ + "@wheel" # Anyone in the wheel group + config.home.username # The current user + ]; + + # Enable features in Nix commands + extraOptions = '' + experimental-features = nix-command flakes + warn-dirty = false + ''; + + # Set automatic generation cleanup for home-manager + gc = { + automatic = true; + options = "--delete-older-than 10d"; + }; + + settings = { + + # Add community Cachix to binary cache + # Don't use at work because blocked by corporate firewall + builders-use-substitutes = true; + substituters = lib.mkIf (!config.nmasur.profiles.work.enable) [ + "https://nix-community.cachix.org" + ]; + trusted-public-keys = lib.mkIf (!config.nmasur.profiles.work.enable) [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; + + # Scans and hard links identical files in the store + # Not working with macOS: https://github.com/NixOS/nix/issues/7273 + auto-optimise-store = lib.mkIf (!pkgs.stdenv.isDarwin) true; + }; + }; }; - nix = { - - # Set channel to flake packages, used for nix-shell commands - nixPath = [ "nixpkgs=${pkgs.path}" ]; - - # For security, only allow specific users - settings.allowed-users = [ - "@wheel" # Anyone in the wheel group - config.home.username # The current user - ]; - - # Enable features in Nix commands - extraOptions = '' - experimental-features = nix-command flakes - warn-dirty = false - ''; - - gc = { - automatic = true; - options = "--delete-older-than 10d"; - }; - - settings = { - - # Add community Cachix to binary cache - # Don't use at work because blocked by corporate firewall - builders-use-substitutes = true; - substituters = lib.mkIf (!config.nmasur.profiles.work.enable) [ - "https://nix-community.cachix.org" - ]; - trusted-public-keys = lib.mkIf (!config.nmasur.profiles.work.enable) [ - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - ]; - - # Scans and hard links identical files in the store - # Not working with macOS: https://github.com/NixOS/nix/issues/7273 - auto-optimise-store = lib.mkIf (!pkgs.stdenv.isDarwin) true; - }; - - }; } diff --git a/platforms/home-manager/modules/nmasur/presets/programs/rofi/brightness.nix b/platforms/home-manager/modules/nmasur/presets/programs/rofi/brightness.nix index c966f68..dd2288c 100644 --- a/platforms/home-manager/modules/nmasur/presets/programs/rofi/brightness.nix +++ b/platforms/home-manager/modules/nmasur/presets/programs/rofi/brightness.nix @@ -13,43 +13,48 @@ in # Adapted from: # A rofi powered menu to execute brightness choices. - config.brightnessCommand = lib.mkIf config.nmasur.presets.programs.rofi.enable builtins.toString ( - pkgs.writeShellScript "brightness" '' + config.nmasur.presets.services.i3.commands.brightness = + lib.mkIf config.nmasur.presets.programs.rofi.enable + ( + builtins.toString ( + pkgs.writeShellScript "brightness" # bash + '' - dimmer="󰃝" - medium="󰃟" - brighter="󰃠" + dimmer="󰃝" + medium="󰃟" + brighter="󰃠" - chosen=$(printf '%s;%s;%s\n' \ - "$dimmer" \ - "$medium" \ - "$brighter" \ - | ${lib.getExe rofi} \ - -theme-str '@import "brightness.rasi"' \ - -hover-select \ - -me-select-entry ''' \ - -me-accept-entry MousePrimary \ - -dmenu \ - -sep ';' \ - -selected-row 1) + chosen=$(printf '%s;%s;%s\n' \ + "$dimmer" \ + "$medium" \ + "$brighter" \ + | ${lib.getExe rofi} \ + -theme-str '@import "brightness.rasi"' \ + -hover-select \ + -me-select-entry ''' \ + -me-accept-entry MousePrimary \ + -dmenu \ + -sep ';' \ + -selected-row 1) - case "$chosen" in - "$dimmer") - ${lib.getExe pkgs.ddcutil} --display 1 setvcp 10 25; ${pkgs.ddcutil}/bin/ddcutil --disable-dynamic-sleep --display 2 setvcp 10 25 - ;; + case "$chosen" in + "$dimmer") + ${lib.getExe pkgs.ddcutil} --display 1 setvcp 10 25; ${pkgs.ddcutil}/bin/ddcutil --disable-dynamic-sleep --display 2 setvcp 10 25 + ;; - "$medium") - ${lib.getExe pkgs.ddcutil} --display 1 setvcp 10 75; ${pkgs.ddcutil}/bin/ddcutil --disable-dynamic-sleep --display 2 setvcp 10 75 - ;; + "$medium") + ${lib.getExe pkgs.ddcutil} --display 1 setvcp 10 75; ${pkgs.ddcutil}/bin/ddcutil --disable-dynamic-sleep --display 2 setvcp 10 75 + ;; - "$brighter") - ${lib.getExe pkgs.ddcutil} --display 1 setvcp 10 100; ${pkgs.ddcutil}/bin/ddcutil --disable-dynamic-sleep --display 2 setvcp 10 100 - ;; + "$brighter") + ${lib.getExe pkgs.ddcutil} --display 1 setvcp 10 100; ${pkgs.ddcutil}/bin/ddcutil --disable-dynamic-sleep --display 2 setvcp 10 100 + ;; - *) exit 1 ;; - esac + *) exit 1 ;; + esac - '' - ); + '' + ) + ); } diff --git a/platforms/home-manager/modules/nmasur/presets/programs/rofi/default.nix b/platforms/home-manager/modules/nmasur/presets/programs/rofi/default.nix index b61b7f7..457d3d7 100644 --- a/platforms/home-manager/modules/nmasur/presets/programs/rofi/default.nix +++ b/platforms/home-manager/modules/nmasur/presets/programs/rofi/default.nix @@ -38,7 +38,7 @@ in { launcher = ''${lib.getExe rofi} -modes drun -show drun -theme-str '@import "launcher.rasi"' ''; systemdSearch = lib.getExe pkgs.rofi-systemd; - altTab = "${lib.getExe rofi} -show window -modi window"; + applicationSwitch = "${lib.getExe rofi} -show window -modi window"; calculator = "${lib.getExe rofi} -modes calc -show calc"; audioSwitch = lib.getExe ( pkgs.writeShellApplication { diff --git a/platforms/home-manager/modules/nmasur/presets/services/dunst.nix b/platforms/home-manager/modules/nmasur/presets/services/dunst.nix index c5e7686..4f2a49f 100644 --- a/platforms/home-manager/modules/nmasur/presets/services/dunst.nix +++ b/platforms/home-manager/modules/nmasur/presets/services/dunst.nix @@ -13,23 +13,25 @@ in options.nmasur.presets.services.dunst.enable = lib.mkEnableOption "Dunst notification system"; config = lib.mkIf cfg.enable { - enable = false; - settings = { - global = { - width = 300; - height = 200; - offset = "30x50"; - origin = "top-right"; - transparency = 0; - padding = 20; - horizontal_padding = 20; - frame_color = config.theme.colors.base03; - }; + services.dunst = { + enable = false; + settings = { + global = { + width = 300; + height = 200; + offset = "30x50"; + origin = "top-right"; + transparency = 0; + padding = 20; + horizontal_padding = 20; + frame_color = config.theme.colors.base03; + }; - urgency_normal = { - background = config.theme.colors.base00; - foreground = config.theme.colors.base05; - timeout = 10; + urgency_normal = { + background = config.theme.colors.base00; + foreground = config.theme.colors.base05; + timeout = 10; + }; }; }; diff --git a/platforms/home-manager/modules/nmasur/presets/services/i3.nix b/platforms/home-manager/modules/nmasur/presets/services/i3.nix index 96d8d3f..c98ccc8 100644 --- a/platforms/home-manager/modules/nmasur/presets/services/i3.nix +++ b/platforms/home-manager/modules/nmasur/presets/services/i3.nix @@ -190,7 +190,9 @@ in lib.mkIf cfg.commands.systemdSearch != null "exec --no-startup-id ${cfg.commands.systemdSearch}"; "${modifier}+Shift+a" = lib.mkIf cfg.commands.audioSwitch != null "exec --no-startup-id ${cfg.commands.audioSwitch}"; - "Mod1+Tab" = lib.mkIf cfg.commands.altTab != null "exec --no-startup-id ${cfg.commands.altTab}"; + "Mod1+Tab" = + lib.mkIf cfg.commands.applicationSwitch + != null "exec --no-startup-id ${cfg.commands.applicationSwitch}"; "${modifier}+Shift+period" = lib.mkIf cfg.commands.power != null "exec --no-startup-id ${cfg.commands.power}"; "${modifier}+Shift+m" = diff --git a/platforms/home-manager/modules/nmasur/presets/services/mbsync.nix b/platforms/home-manager/modules/nmasur/presets/services/mbsync.nix index 99088f6..69abdf4 100644 --- a/platforms/home-manager/modules/nmasur/presets/services/mbsync.nix +++ b/platforms/home-manager/modules/nmasur/presets/services/mbsync.nix @@ -12,7 +12,7 @@ in { - options.nmasur.preset.services.mbsync = { + options.nmasur.presets.services.mbsync = { enable = lib.mkEnableOption "Mail service."; user = lib.mkOption { type = lib.types.str; diff --git a/platforms/home-manager/modules/nmasur/profiles/linux-gui.nix b/platforms/home-manager/modules/nmasur/profiles/linux-gui.nix index 3013187..e05f82a 100644 --- a/platforms/home-manager/modules/nmasur/profiles/linux-gui.nix +++ b/platforms/home-manager/modules/nmasur/profiles/linux-gui.nix @@ -14,8 +14,8 @@ in config = lib.mkIf cfg.enable { - nmasur.gtk.enable = lib.mkDefault true; nmasur.presets = { + gtk.enable = lib.mkDefault true; programs = { _1password.enable = lib.mkDefault true; aerc.enable = lib.mkDefault true; diff --git a/platforms/home-manager/modules/nmasur/settings.nix b/platforms/home-manager/modules/nmasur/settings.nix new file mode 100644 index 0000000..03ec2ec --- /dev/null +++ b/platforms/home-manager/modules/nmasur/settings.nix @@ -0,0 +1,19 @@ +{ lib, ... }: + +{ + options.nmasur.settings = { + username = lib.mkOption { + type = lib.types.str; + description = "Primary username for the system"; + }; + fullName = lib.mkOption { + type = lib.types.str; + description = "Human readable name of the user"; + }; + hostnames = lib.mkOption { + type = lib.types.attrsOf lib.types.str; + description = "Map of service names to FQDNs"; + default = { }; + }; + }; +} diff --git a/platforms/nix-darwin/default.nix b/platforms/nix-darwin/default.nix index fc248e2..a4303ca 100644 --- a/platforms/nix-darwin/default.nix +++ b/platforms/nix-darwin/default.nix @@ -3,5 +3,7 @@ imports = lib.pipe (lib.filesystem.listFilesRecursive ./.) [ # Get only files ending in .nix (builtins.filter (name: lib.hasSuffix ".nix" name)) + # Remove this file + (builtins.filter (name: name != ./default.nix)) ]; } diff --git a/platforms/nixos/default.nix b/platforms/nixos/default.nix index fc248e2..a4303ca 100644 --- a/platforms/nixos/default.nix +++ b/platforms/nixos/default.nix @@ -3,5 +3,7 @@ imports = lib.pipe (lib.filesystem.listFilesRecursive ./.) [ # Get only files ending in .nix (builtins.filter (name: lib.hasSuffix ".nix" name)) + # Remove this file + (builtins.filter (name: name != ./default.nix)) ]; } diff --git a/platforms/nixos/modules/nmasur/presets/services/actualbudget.nix b/platforms/nixos/modules/nmasur/presets/services/actualbudget.nix index d1a6527..eb49d3c 100644 --- a/platforms/nixos/modules/nmasur/presets/services/actualbudget.nix +++ b/platforms/nixos/modules/nmasur/presets/services/actualbudget.nix @@ -59,7 +59,7 @@ in }; # Allow web traffic to Caddy - caddy.routes = [ + nmasur.presets.services.caddy.routes = [ { match = [ { host = [ hostnames.budget ]; } ]; handle = [ diff --git a/platforms/nixos/modules/nmasur/presets/services/arr.nix b/platforms/nixos/modules/nmasur/presets/services/arr.nix index cf77916..3abf4a2 100644 --- a/platforms/nixos/modules/nmasur/presets/services/arr.nix +++ b/platforms/nixos/modules/nmasur/presets/services/arr.nix @@ -8,7 +8,7 @@ let inherit (config.nmasur.settings) hostnames; - cfg = config.nmasur.presets.services.actualbudget; + cfg = config.nmasur.presets.services.arrs; # This config specifies ports for Prometheus to scrape information arrConfig = { @@ -46,7 +46,7 @@ in config = lib.mkIf cfg.enable { # Required - config.nmasur.profiles.shared-media.enable = true; # Shared user for multiple services + nmasur.profiles.shared-media.enable = true; # Shared user for multiple services # # Broken on 2024-12-07 # # https://discourse.nixos.org/t/solved-sonarr-is-broken-in-24-11-unstable-aka-how-the-hell-do-i-use-nixpkgs-config-permittedinsecurepackages/ @@ -92,7 +92,7 @@ in # Requires updating the base_url config value in each service # If you try to rewrite the URL, the service won't redirect properly - caddy.routes = [ + nmasur.presets.services.caddy.routes = [ { # Group means that routes with the same name are mutually exclusive, # so they are split between the appropriate services. @@ -276,7 +276,7 @@ in }; # Prometheus scrape targets (expose Exportarr to Prometheus) - prometheus.scrapeTargets = map ( + nmasur.presets.services.prometheus-exporters.scrapeTargets = map ( key: "127.0.0.1:${ lib.attrsets.getAttrFromPath [ diff --git a/platforms/nixos/modules/nmasur/presets/services/audiobookshelf.nix b/platforms/nixos/modules/nmasur/presets/services/audiobookshelf.nix index 5667e5f..e038de6 100644 --- a/platforms/nixos/modules/nmasur/presets/services/audiobookshelf.nix +++ b/platforms/nixos/modules/nmasur/presets/services/audiobookshelf.nix @@ -28,7 +28,7 @@ in }; # Allow web traffic to Caddy - caddy.routes = [ + nmasur.presets.services.caddy.routes = [ { match = [ { host = [ globals.hostnames.audiobooks ]; } ]; handle = [ diff --git a/platforms/nixos/modules/nmasur/presets/services/caddy.nix b/platforms/nixos/modules/nmasur/presets/services/caddy.nix index 754d964..b2eef1e 100644 --- a/platforms/nixos/modules/nmasur/presets/services/caddy.nix +++ b/platforms/nixos/modules/nmasur/presets/services/caddy.nix @@ -43,15 +43,15 @@ in type = lib.types.listOf lib.types.str; description = "CIDR blocks to allow for requests"; default = [ ]; - merge = lib.mkMerge; # Ensure that values are merged from default + # merge = lib.mkMerge; # Ensure that values are merged from default }; }; config = lib.mkIf cfg.enable { # Force Caddy to 403 if not coming from allowlisted source - cfg.cidrAllowlist = lib.mkDefault [ "127.0.0.1/32" ]; - cfg.routes = lib.mkBefore [ + nmasur.presets.services.caddy.cidrAllowlist = lib.mkDefault [ "127.0.0.1/32" ]; + nmasur.presets.services.caddy.routes = lib.mkBefore [ { match = [ { not = [ { remote_ip.ranges = cfg.cidrAllowlist; } ]; } ]; handle = [ @@ -72,7 +72,7 @@ in getHostnameFromRoute = route: if (lib.hasAttr "match" route) then (lib.concatMap getHostnameFromMatch route.match) else [ ]; - hostnames_non_unique = lib.concatMap getHostnameFromRoute config.caddy.routes; + hostnames_non_unique = lib.concatMap getHostnameFromRoute cfg.routes; hostnames = lib.unique hostnames_non_unique; # Create attrset of subdomains to their fqdns hostname_map = builtins.listToAttrs ( @@ -90,8 +90,8 @@ in listen = [ ":443" ]; # These routes are pulled from the rest of this repo - routes = config.caddy.routes; - errors.routes = config.caddy.blocks; + routes = cfg.routes; + errors.routes = cfg.blocks; # Uncommenting collects access logs logs = { @@ -104,7 +104,7 @@ in }; }; apps.http.servers.metrics = { }; # Enables Prometheus metrics - apps.tls.automation.policies = config.caddy.tlsPolicies; + apps.tls.automation.policies = cfg.tlsPolicies; # Setup logging to journal and files logging.logs = @@ -223,6 +223,6 @@ in # Caddy exposes Prometheus metrics with the admin API # https://caddyserver.com/docs/api - prometheus.scrapeTargets = [ "127.0.0.1:2019" ]; + nmasur.presets.services.prometheus-exporters.scrapeTargets = [ "127.0.0.1:2019" ]; }; } diff --git a/platforms/nixos/modules/nmasur/presets/services/calibre-web.nix b/platforms/nixos/modules/nmasur/presets/services/calibre-web.nix index 27239c9..6d7fcc2 100644 --- a/platforms/nixos/modules/nmasur/presets/services/calibre-web.nix +++ b/platforms/nixos/modules/nmasur/presets/services/calibre-web.nix @@ -37,7 +37,7 @@ in }; # Allow web traffic to Caddy - caddy.routes = [ + nmasur.presets.services.caddy.routes = [ { match = [ { host = [ hostnames.books ]; } ]; handle = [ diff --git a/platforms/nixos/modules/nmasur/presets/services/cloudflare.nix b/platforms/nixos/modules/nmasur/presets/services/cloudflare.nix index a1d34bd..f68a035 100644 --- a/platforms/nixos/modules/nmasur/presets/services/cloudflare.nix +++ b/platforms/nixos/modules/nmasur/presets/services/cloudflare.nix @@ -70,7 +70,7 @@ in plugins = [ "github.com/caddy-dns/cloudflare@master" ]; hash = "sha256-C7JOGd4sXsRZL561oP84V2/pTg7szEgF4OFOw35yS1s="; }; - caddy.tlsPolicies = [ + nmasur.presets.services.caddy.tlsPolicies = [ { issuers = [ { diff --git a/platforms/nixos/modules/nmasur/presets/services/filebrowser.nix b/platforms/nixos/modules/nmasur/presets/services/filebrowser.nix index f2d1133..6ec576b 100644 --- a/platforms/nixos/modules/nmasur/presets/services/filebrowser.nix +++ b/platforms/nixos/modules/nmasur/presets/services/filebrowser.nix @@ -16,10 +16,10 @@ in services.filebrowser = { enable = true; # Generate password: htpasswd -nBC 10 "" | tr -d ':\n' - password = "$2y$10$ze1cMob0k6pnXRjLowYfZOVZWg4G.dsPtH3TohbUeEbI0sdkG9.za"; + passwordHash = "$2y$10$ze1cMob0k6pnXRjLowYfZOVZWg4G.dsPtH3TohbUeEbI0sdkG9.za"; }; - caddy.routes = [ + nmasur.presets.services.caddy.routes = [ { match = [ { host = [ hostnames.files ]; } ]; handle = [ diff --git a/platforms/nixos/modules/nmasur/presets/services/gitea.nix b/platforms/nixos/modules/nmasur/presets/services/gitea.nix index 185dc4e..50338ff 100644 --- a/platforms/nixos/modules/nmasur/presets/services/gitea.nix +++ b/platforms/nixos/modules/nmasur/presets/services/gitea.nix @@ -61,7 +61,7 @@ in users.users.${username}.extraGroups = [ "gitea" ]; - caddy.routes = [ + nmasur.presets.services.caddy.routes = [ # Prevent public access to Prometheus metrics. { match = [ @@ -95,7 +95,7 @@ in services.cloudflare-dyndns.domains = [ hostnames.git ]; # Scrape the metrics endpoint for Prometheus. - prometheus.scrapeTargets = [ + nmasur.presets.services.prometheus-exporters.scrapeTargets = [ "127.0.0.1:${builtins.toString config.services.gitea.settings.server.HTTP_PORT}" ]; diff --git a/platforms/nixos/modules/nmasur/presets/services/grafana.nix b/platforms/nixos/modules/nmasur/presets/services/grafana.nix index 3056662..fea5855 100644 --- a/platforms/nixos/modules/nmasur/presets/services/grafana.nix +++ b/platforms/nixos/modules/nmasur/presets/services/grafana.nix @@ -2561,7 +2561,7 @@ in }; }; - caddy.routes = [ + nmasur.presets.services.caddy.routes = [ { match = [ { host = [ hostnames.metrics ]; } ]; handle = [ diff --git a/platforms/nixos/modules/nmasur/presets/services/immich.nix b/platforms/nixos/modules/nmasur/presets/services/immich.nix index c9db780..8e439a7 100644 --- a/platforms/nixos/modules/nmasur/presets/services/immich.nix +++ b/platforms/nixos/modules/nmasur/presets/services/immich.nix @@ -29,7 +29,7 @@ in }; }; - caddy.routes = [ + nmasur.presets.services.caddy.routes = [ { match = [ { host = [ hostnames.photos ]; } ]; handle = [ diff --git a/platforms/nixos/modules/nmasur/presets/services/influxdb2.nix b/platforms/nixos/modules/nmasur/presets/services/influxdb2.nix index 7296aad..b8c5722 100644 --- a/platforms/nixos/modules/nmasur/presets/services/influxdb2.nix +++ b/platforms/nixos/modules/nmasur/presets/services/influxdb2.nix @@ -55,7 +55,7 @@ in before = [ "influxdb2.service" ]; }; - caddy.routes = lib.mkIf config.services.influxdb2.enable [ + nmasur.presets.services.caddy.routes = lib.mkIf config.services.influxdb2.enable [ { match = [ { host = [ hostnames.influxdb ]; } ]; handle = [ diff --git a/platforms/nixos/modules/nmasur/presets/services/jellyfin.nix b/platforms/nixos/modules/nmasur/presets/services/jellyfin.nix index 9988476..dd27b4c 100644 --- a/platforms/nixos/modules/nmasur/presets/services/jellyfin.nix +++ b/platforms/nixos/modules/nmasur/presets/services/jellyfin.nix @@ -14,6 +14,8 @@ let in { + options.nmasur.presets.services.jellyfin.enable = lib.mkEnableOption "Jellyfin video streaming"; + config = lib.mkIf cfg.enable { services.jellyfin.group = lib.mkIf config.nmasur.profiles.shared-media.enable "shared"; @@ -21,7 +23,7 @@ in isSystemUser = true; }; - caddy.routes = [ + nmasur.presets.services.caddy.routes = [ # Prevent public access to Prometheus metrics. { match = [ @@ -79,6 +81,6 @@ in systemd.services.jellyfin.serviceConfig.UMask = lib.mkForce "0007"; # Requires MetricsEnable is true in /var/lib/jellyfin/config/system.xml - prometheus.scrapeTargets = [ "127.0.0.1:8096" ]; + nmasur.presets.services.prometheus-exporters.scrapeTargets = [ "127.0.0.1:8096" ]; }; } diff --git a/platforms/nixos/modules/nmasur/presets/services/litestream.nix b/platforms/nixos/modules/nmasur/presets/services/litestream.nix index be19c23..e9933b9 100644 --- a/platforms/nixos/modules/nmasur/presets/services/litestream.nix +++ b/platforms/nixos/modules/nmasur/presets/services/litestream.nix @@ -55,7 +55,7 @@ in # Broken on 2024-08-23 # https://github.com/NixOS/nixpkgs/commit/0875d0ce1c778f344cd2377a5337a45385d6ffa0 - insecurePackages = [ "litestream-0.3.13" ]; + allowInsecurePackages = [ "litestream-0.3.13" ]; # Wait for secret to exist systemd.services.litestream = { diff --git a/platforms/nixos/modules/nmasur/presets/services/minecraft-server.nix b/platforms/nixos/modules/nmasur/presets/services/minecraft-server.nix index 334b33d..8d7da9b 100644 --- a/platforms/nixos/modules/nmasur/presets/services/minecraft-server.nix +++ b/platforms/nixos/modules/nmasur/presets/services/minecraft-server.nix @@ -53,7 +53,7 @@ in networking.firewall.allowedTCPPorts = [ publicPort ]; - cloudflare.noProxyDomains = [ hostnames.minecraft ]; + nmasur.presets.services.cloudflare.noProxyDomains = [ hostnames.minecraft ]; ## Automatically start and stop Minecraft server based on player connections diff --git a/platforms/nixos/modules/nmasur/presets/services/n8n.nix b/platforms/nixos/modules/nmasur/presets/services/n8n.nix index 8431c73..f834f2f 100644 --- a/platforms/nixos/modules/nmasur/presets/services/n8n.nix +++ b/platforms/nixos/modules/nmasur/presets/services/n8n.nix @@ -33,7 +33,7 @@ in services.cloudflare-dyndns.domains = [ hostnames.n8n ]; # Allow web traffic to Caddy - caddy.routes = [ + nmasur.presets.services.caddy.routes = [ { match = [ { host = [ hostnames.n8n ]; } ]; handle = [ diff --git a/platforms/nixos/modules/nmasur/presets/services/nextcloud.nix b/platforms/nixos/modules/nmasur/presets/services/nextcloud.nix index 48ce05c..c8b3cdf 100644 --- a/platforms/nixos/modules/nmasur/presets/services/nextcloud.nix +++ b/platforms/nixos/modules/nmasur/presets/services/nextcloud.nix @@ -63,7 +63,7 @@ in users.users.caddy.extraGroups = [ "nextcloud" ]; # Point Caddy to Nginx - caddy.routes = [ + nmasur.presets.services.caddy.routes = [ { match = [ { host = [ hostnames.content ]; } ]; handle = [ @@ -225,7 +225,7 @@ in url = "https://${hostnames.content}"; passwordFile = config.services.nextcloud.config.adminpassFile; }; - prometheus.scrapeTargets = [ + nmasur.presets.services.prometheus-exporters.scrapeTargets = [ "127.0.0.1:${builtins.toString config.services.prometheus.exporters.nextcloud.port}" ]; # Allows nextcloud-exporter to read passwordFile diff --git a/platforms/nixos/modules/nmasur/presets/services/ntfy-sh.nix b/platforms/nixos/modules/nmasur/presets/services/ntfy-sh.nix index 078d828..e66f11e 100644 --- a/platforms/nixos/modules/nmasur/presets/services/ntfy-sh.nix +++ b/platforms/nixos/modules/nmasur/presets/services/ntfy-sh.nix @@ -21,7 +21,7 @@ in }; }; - caddy.routes = [ + nmasur.presets.services.caddy.routes = [ { match = [ { host = [ hostnames.notifications ]; } ]; handle = [ diff --git a/platforms/nixos/modules/nmasur/presets/services/paperless.nix b/platforms/nixos/modules/nmasur/presets/services/paperless.nix index b362456..06f9902 100644 --- a/platforms/nixos/modules/nmasur/presets/services/paperless.nix +++ b/platforms/nixos/modules/nmasur/presets/services/paperless.nix @@ -30,7 +30,7 @@ in users.users.nextcloud.extraGroups = lib.mkIf config.services.nextcloud.enable [ "paperless" ]; users.users.${username}.extraGroups = [ "paperless" ]; - caddy.routes = [ + nmasur.presets.services.caddy.routes = [ { match = [ { diff --git a/platforms/nixos/modules/nmasur/presets/services/postgresql.nix b/platforms/nixos/modules/nmasur/presets/services/postgresql.nix index bb3dba0..58a8b1e 100644 --- a/platforms/nixos/modules/nmasur/presets/services/postgresql.nix +++ b/platforms/nixos/modules/nmasur/presets/services/postgresql.nix @@ -12,30 +12,31 @@ in { options.nmasur.presets.services.postgresql.enable = lib.mkEnableOption "Postgresql database"; - - services.postgresql = lib.mkIf cfg.enable { - enable = true; - package = pkgs.postgresql_15; - settings = { }; - authentication = '' - local all postgres peer map=root - local all admin peer map=admin - ''; - identMap = '' - root postgres postgres - root root postgres - admin ${username} admin - ''; - ensureUsers = [ - { - name = "admin"; - ensureClauses = { - createdb = true; - createrole = true; - login = true; - }; - } - ]; + config = lib.mkIf cfg.enable { + services.postgresql = { + enable = true; + package = pkgs.postgresql_15; + settings = { }; + authentication = '' + local all postgres peer map=root + local all admin peer map=admin + ''; + identMap = '' + root postgres postgres + root root postgres + admin ${username} admin + ''; + ensureUsers = [ + { + name = "admin"; + ensureClauses = { + createdb = true; + createrole = true; + login = true; + }; + } + ]; + }; }; } diff --git a/platforms/nixos/modules/nmasur/presets/services/prometheus-exporters.nix b/platforms/nixos/modules/nmasur/presets/services/prometheus-exporters.nix index 2d1934d..9ef2046 100644 --- a/platforms/nixos/modules/nmasur/presets/services/prometheus-exporters.nix +++ b/platforms/nixos/modules/nmasur/presets/services/prometheus-exporters.nix @@ -27,7 +27,7 @@ in config = lib.mkIf cfg.enable { # Default scrape the basic host information - cfg.scrapeTargets = [ + nmasur.presets.services.prometheus-exporters.scrapeTargets = [ "127.0.0.1:${builtins.toString config.services.prometheus.exporters.node.port}" "127.0.0.1:${builtins.toString config.services.prometheus.exporters.systemd.port}" "127.0.0.1:${builtins.toString config.services.prometheus.exporters.process.port}" diff --git a/platforms/nixos/modules/nmasur/presets/services/template.nix b/platforms/nixos/modules/nmasur/presets/services/template.nix deleted file mode 100644 index 3961b89..0000000 --- a/platforms/nixos/modules/nmasur/presets/services/template.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: - -let - cfg = config.nmasur.presets.services.; -in - -{ - - options.nmasur.presets.services..enable = lib.mkEnableOption ""; - - config = lib.mkIf cfg.enable { - }; -} diff --git a/platforms/nixos/modules/nmasur/presets/services/thelounge.nix b/platforms/nixos/modules/nmasur/presets/services/thelounge.nix index 866641e..48e55db 100644 --- a/platforms/nixos/modules/nmasur/presets/services/thelounge.nix +++ b/platforms/nixos/modules/nmasur/presets/services/thelounge.nix @@ -5,6 +5,8 @@ let in { + options.nmasur.presets.services.thelounge.enable = lib.mkEnableOption "TheLounge IRC chat service"; + config = lib.mkIf cfg.enable { services.thelounge = { @@ -21,7 +23,7 @@ in # sudo su - thelounge -s /bin/sh -c "thelounge add myuser" # Allow web traffic to Caddy - caddy.routes = [ + nmasur.presets.services.caddy.routes = [ { match = [ { host = [ hostnames.irc ]; } ]; handle = [ diff --git a/platforms/nixos/modules/nmasur/presets/services/transmission.nix b/platforms/nixos/modules/nmasur/presets/services/transmission.nix index 5963b37..dcb9df8 100644 --- a/platforms/nixos/modules/nmasur/presets/services/transmission.nix +++ b/platforms/nixos/modules/nmasur/presets/services/transmission.nix @@ -64,7 +64,7 @@ in }; # Create reverse proxy for web UI - caddy.routes = + nmasur.presets.services.caddy.routes = let # Set if the download domain is the same as the Transmission domain useDownloadDomain = hostnames.download == hostnames.transmission; diff --git a/platforms/nixos/modules/nmasur/presets/services/uptime-kuma.nix b/platforms/nixos/modules/nmasur/presets/services/uptime-kuma.nix index c0e2fe9..799ceb8 100644 --- a/platforms/nixos/modules/nmasur/presets/services/uptime-kuma.nix +++ b/platforms/nixos/modules/nmasur/presets/services/uptime-kuma.nix @@ -19,7 +19,7 @@ in }; # Allow web traffic to Caddy - caddy.routes = [ + nmasur.presets.services.caddy.routes = [ { match = [ { host = [ hostnames.status ]; } ]; handle = [ diff --git a/platforms/nixos/modules/nmasur/presets/services/vaultwarden.nix b/platforms/nixos/modules/nmasur/presets/services/vaultwarden.nix index b5a8192..0ed707b 100644 --- a/platforms/nixos/modules/nmasur/presets/services/vaultwarden.nix +++ b/platforms/nixos/modules/nmasur/presets/services/vaultwarden.nix @@ -51,7 +51,7 @@ in networking.firewall.allowedTCPPorts = [ 3012 ]; - caddy.routes = [ + nmasur.presets.services.caddy.routes = [ { match = [ { host = [ hostnames.secrets ]; } ]; handle = [ diff --git a/platforms/nixos/modules/nmasur/presets/services/victoriametrics.nix b/platforms/nixos/modules/nmasur/presets/services/victoriametrics.nix index 5968ad5..1cc8c2b 100644 --- a/platforms/nixos/modules/nmasur/presets/services/victoriametrics.nix +++ b/platforms/nixos/modules/nmasur/presets/services/victoriametrics.nix @@ -20,7 +20,9 @@ let { job_name = config.networking.hostName; stream_parse = true; - static_configs = [ { targets = config.prometheus.scrapeTargets; } ]; + static_configs = [ + { targets = config.nmasur.presets.services.prometheus-exporters.scrapeTargets; } + ]; } ]; }; @@ -78,7 +80,7 @@ in before = [ "vmauth.service" ]; }; - caddy.routes = [ + nmasur.presets.services.caddy.routes = [ { match = [ { host = [ hostnames.prometheus ]; } ]; handle = [ diff --git a/platforms/nixos/modules/nmasur/presets/services/vm-agent.nix b/platforms/nixos/modules/nmasur/presets/services/vm-agent.nix index 69dc380..82a4b1b 100644 --- a/platforms/nixos/modules/nmasur/presets/services/vm-agent.nix +++ b/platforms/nixos/modules/nmasur/presets/services/vm-agent.nix @@ -20,7 +20,9 @@ let { job_name = config.networking.hostName; stream_parse = true; - static_configs = [ { targets = config.prometheus.scrapeTargets; } ]; + static_configs = [ + { targets = config.nmasur.presets.services.prometheus-exporters.scrapeTargets; } + ]; } ]; }; diff --git a/platforms/nixos/modules/nmasur/presets/zfs.nix b/platforms/nixos/modules/nmasur/presets/zfs.nix index 111a32c..50f4ae6 100644 --- a/platforms/nixos/modules/nmasur/presets/zfs.nix +++ b/platforms/nixos/modules/nmasur/presets/zfs.nix @@ -20,7 +20,7 @@ in boot.kernelParams = [ "nohibernate" ]; # ZFS does not work with hibernation boot.supportedFilesystems = [ "zfs" ]; services.prometheus.exporters.zfs.enable = config.prometheus.exporters.enable; - prometheus.scrapeTargets = [ + nmasur.presets.services.prometheus-exporters.scrapeTargets = [ "127.0.0.1:${builtins.toString config.services.prometheus.exporters.zfs.port}" ]; diff --git a/platforms/nixos/modules/nmasur/profiles/aws.nix b/platforms/nixos/modules/nmasur/profiles/aws.nix deleted file mode 100644 index dd4ca82..0000000 --- a/platforms/nixos/modules/nmasur/profiles/aws.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ config, lib, ... }: - -let - cfg = config.nmasur.profiles.aws; -in -{ - - options.nmasur.profiles.aws.enable = lib.mkEnableOption "AWS EC2"; - - config = lib.mkIf cfg.enable { - - # AWS settings require this - permitRootLogin = "prohibit-password"; - - # Make sure disk size is large enough - # https://github.com/nix-community/nixos-generators/issues/150 - amazonImage.sizeMB = 16 * 1024; - - }; -} diff --git a/platforms/nixos/modules/nmasur/profiles/nas.nix b/platforms/nixos/modules/nmasur/profiles/nas.nix index 6099eb8..188dc51 100644 --- a/platforms/nixos/modules/nmasur/profiles/nas.nix +++ b/platforms/nixos/modules/nmasur/profiles/nas.nix @@ -20,7 +20,7 @@ in msmtp.enable = lib.mkDefault true; }; services = { - arr.enable = lib.mkDefault true; + arrs.enable = lib.mkDefault true; audiobookshelf.enable = lib.mkDefault true; bind.enable = lib.mkDefault true; caddy.enable = lib.mkDefault true;