aboutsummaryrefslogtreecommitdiff
path: root/nix/machines/vm-synology
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--nix/machines/nixos/x86_64-linux/vm-synology.nix (renamed from nix/machines/vm-synology/default.nix)49
-rw-r--r--nix/machines/vm-synology/backups.nix73
-rw-r--r--nix/machines/vm-synology/ingress.nix16
-rw-r--r--nix/machines/vm-synology/nginx.nix10
-rw-r--r--nix/profiles/disk/vm.nix (renamed from nix/machines/vm-synology/disk.nix)0
-rw-r--r--nix/profiles/git-server.nix (renamed from nix/machines/vm-synology/git.nix)0
-rw-r--r--nix/profiles/hardware/synology.nix (renamed from nix/machines/vm-synology/hardware.nix)9
7 files changed, 12 insertions, 145 deletions
diff --git a/nix/machines/vm-synology/default.nix b/nix/machines/nixos/x86_64-linux/vm-synology.nix
index ec508d8..02030fc 100644
--- a/nix/machines/vm-synology/default.nix
+++ b/nix/machines/nixos/x86_64-linux/vm-synology.nix
@@ -1,36 +1,35 @@
-{ pkgs, ... }:
+{ self, pkgs, ... }:
{
age = {
secrets = {
restic_gcs_credentials = {
- file = ../../../secrets/restic_gcs_credentials.age;
+ file = "${self}/secrets/restic_gcs_credentials.age";
};
restic_password = {
- file = ../../../secrets/restic_password.age;
+ file = "${self}/secrets/restic_password.age";
};
cloudflared-tunnel = {
- file = ../../../secrets/cloudflared_cragmont.age;
+ file = "${self}/secrets/cloudflared_cragmont.age";
};
cloudflared-cert = {
- file = ../../../secrets/cloudflared_cert.age;
+ file = "${self}/secrets/cloudflared_cert.age";
};
};
};
imports = [
- ./backups.nix
- ./git.nix
- ./hardware.nix
- ./ingress.nix
- ./nginx.nix
- ../common/network.nix
+ "${self}/nix/profiles/git-server.nix"
+ "${self}/nix/profiles/hardware/synology.nix"
+ "${self}/nix/profiles/disk/vm.nix"
+ "${self}/nix/profiles/server.nix"
+ # ./backups.nix
+ # ./ingress.nix
+ # ./nginx.nix
];
# Use the systemd-boot EFI boot loader.
- boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "vm-synology";
- boot.kernelPackages = pkgs.linuxPackages_latest;
nix = {
package = pkgs.nixVersions.latest;
@@ -46,31 +45,9 @@
};
};
- time.timeZone = "America/Los_Angeles";
-
- # Don't require password for sudo
- security.sudo.wheelNeedsPassword = false;
-
- # Virtualization settings
- virtualisation.docker.enable = true;
-
- # Select internationalisation properties.
- i18n = {
- defaultLocale = "en_US.UTF-8";
- };
-
# Define a user account. Don't forget to set a password with ‘passwd’.
users.mutableUsers = false;
- # List packages installed in system profile. To search, run:
- # $ nix search wget
- environment.systemPackages = with pkgs; [
- curl
- git
- vim
- jq
- ];
-
# Enable the OpenSSH daemon.
services.openssh.enable = true;
services.openssh.settings.PasswordAuthentication = true;
@@ -80,8 +57,6 @@
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINBkozy+X96u5ciX766bJ/AyQ3xm1tXZTIr5+4PVFZFi"
];
- networking.firewall.enable = false;
-
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It‘s perfectly fine and recommended to leave
diff --git a/nix/machines/vm-synology/backups.nix b/nix/machines/vm-synology/backups.nix
deleted file mode 100644
index cf3c65b..0000000
--- a/nix/machines/vm-synology/backups.nix
+++ /dev/null
@@ -1,73 +0,0 @@
-{
- config,
- pkgs,
- ...
-}:
-let
- environmentFile = toString (
- pkgs.writeText "restic-gcs-env" ''
- GOOGLE_PROJECT_ID=fcuny-infra
- GOOGLE_APPLICATION_CREDENTIALS=${config.age.secrets.restic_gcs_credentials.path}
- ''
- );
-in
-{
- services.restic.backups.local = {
- passwordFile = config.age.secrets.restic_password.path;
- repository = "/srv/data/backups/";
- initialize = true;
- paths = [ "/var/lib/gitolite" ];
- exclude = [
- "/var/lib/gitolite/.bash_history"
- "/var/lib/gitolite/.ssh"
- "/var/lib/gitolite/.viminfo"
- ];
- extraBackupArgs = [
- "--exclude-caches"
- "--compression=max"
- ];
- timerConfig = {
- OnCalendar = "daily";
- };
- pruneOpts = [
- "--keep-daily 7"
- "--keep-weekly 4"
- "--keep-monthly 3"
- ];
- };
-
- services.restic.backups.gcs = {
- passwordFile = config.age.secrets.restic_password.path;
- environmentFile = environmentFile;
- repository = "gs:fcuny-infra-backups:/vm-synology/";
- initialize = true;
- paths = [ "/var/lib/gitolite" ];
- exclude = [
- "/var/lib/gitolite/.bash_history"
- "/var/lib/gitolite/.ssh"
- "/var/lib/gitolite/.viminfo"
- ];
- extraBackupArgs = [
- "--exclude-caches"
- "--compression=max"
- ];
- timerConfig = {
- OnCalendar = "daily";
- };
- pruneOpts = [
- "--keep-daily 7"
- "--keep-weekly 4"
- "--keep-monthly 3"
- ];
- };
-
- environment = {
- sessionVariables = {
- RESTIC_REPOSITORY = "/srv/data/backups";
- RESTIC_PASSWORD_FILE = config.age.secrets.restic_password.path;
- };
- systemPackages = with pkgs; [
- restic
- ];
- };
-}
diff --git a/nix/machines/vm-synology/ingress.nix b/nix/machines/vm-synology/ingress.nix
deleted file mode 100644
index b6ae596..0000000
--- a/nix/machines/vm-synology/ingress.nix
+++ /dev/null
@@ -1,16 +0,0 @@
-{ config, ... }:
-{
- services.cloudflared = {
- enable = true;
- certificateFile = config.age.secrets.cloudflared-cert.path;
- tunnels = {
- "cragmont" = {
- credentialsFile = config.age.secrets.cloudflared-tunnel.path;
- default = "http_status:404";
- ingress = {
- "git.fcuny.net".service = "ssh://127.0.0.1:22";
- };
- };
- };
- };
-}
diff --git a/nix/machines/vm-synology/nginx.nix b/nix/machines/vm-synology/nginx.nix
deleted file mode 100644
index 2c3b7fb..0000000
--- a/nix/machines/vm-synology/nginx.nix
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- ...
-}:
-{
- services.fcuny-net = {
- enable = true;
- domain = "fcuny.net";
- enableSSL = false; # Enable if you want HTTPS
- };
-}
diff --git a/nix/machines/vm-synology/disk.nix b/nix/profiles/disk/vm.nix
index 1641339..1641339 100644
--- a/nix/machines/vm-synology/disk.nix
+++ b/nix/profiles/disk/vm.nix
diff --git a/nix/machines/vm-synology/git.nix b/nix/profiles/git-server.nix
index 27eebc7..27eebc7 100644
--- a/nix/machines/vm-synology/git.nix
+++ b/nix/profiles/git-server.nix
diff --git a/nix/machines/vm-synology/hardware.nix b/nix/profiles/hardware/synology.nix
index c894a80..ad1fd3f 100644
--- a/nix/machines/vm-synology/hardware.nix
+++ b/nix/profiles/hardware/synology.nix
@@ -1,10 +1,8 @@
{ lib, modulesPath, ... }:
-
{
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
(modulesPath + "/installer/scan/not-detected.nix")
- ./disk.nix
];
boot.initrd.availableKernelModules = [
@@ -21,12 +19,5 @@
swapDevices = [ ];
- # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
- # (the default) this is the recommended approach. When using systemd-networkd it's
- # still possible to use this option, but it's recommended to use it in conjunction
- # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
- networking.useDHCP = lib.mkDefault true;
- # networking.interfaces.ens3.useDHCP = lib.mkDefault true;
-
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}