about summary refs log tree commit diff
path: root/nix/machines
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--nix/machines/darwin-shared.nix12
-rw-r--r--nix/machines/hardware/vm-synology.nix36
-rw-r--r--nix/machines/vm-aarch64.nix17
-rw-r--r--nix/machines/vm-shared.nix9
-rw-r--r--nix/machines/vm-synology.nix1
5 files changed, 42 insertions, 33 deletions
diff --git a/nix/machines/darwin-shared.nix b/nix/machines/darwin-shared.nix
index 6c727f8..344ff00 100644
--- a/nix/machines/darwin-shared.nix
+++ b/nix/machines/darwin-shared.nix
@@ -1,18 +1,6 @@
 { pkgs, ... }: {
   nix = {
     package = pkgs.nixVersions.stable;
-
-    gc = {
-      user = "root";
-      automatic = true;
-      interval = [{
-        Hour = 7;
-        Minute = 0;
-        Weekday = 0;
-      }];
-      options = "--delete-older-than 7d";
-    };
-
     settings = {
       trusted-users = [ "@admin" "fcuny" ];
       experimental-features = [ "nix-command" "flakes" ];
diff --git a/nix/machines/hardware/vm-synology.nix b/nix/machines/hardware/vm-synology.nix
new file mode 100644
index 0000000..5511e98
--- /dev/null
+++ b/nix/machines/hardware/vm-synology.nix
@@ -0,0 +1,36 @@
+# Do not modify this file!  It was generated by ‘nixos-generate-config’
+# and may be overwritten by future invocations.  Please make changes
+# to /etc/nixos/configuration.nix instead.
+{ lib, modulesPath, ... }:
+
+{
+  imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
+
+  boot.initrd.availableKernelModules =
+    [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
+  boot.initrd.kernelModules = [ ];
+  boot.kernelModules = [ "kvm-amd" ];
+  boot.extraModulePackages = [ ];
+
+  fileSystems."/" = {
+    device = "/dev/disk/by-label/nixos";
+    fsType = "ext4";
+  };
+
+  fileSystems."/boot" = {
+    device = "/dev/disk/by-label/boot";
+    fsType = "vfat";
+    options = [ "fmask=0022" "dmask=0022" ];
+  };
+
+  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";
+}
diff --git a/nix/machines/vm-aarch64.nix b/nix/machines/vm-aarch64.nix
index 8e84ed5..1c2e479 100644
--- a/nix/machines/vm-aarch64.nix
+++ b/nix/machines/vm-aarch64.nix
@@ -1,16 +1 @@
-{ ... }: {
-  imports = [ ./hardware/vm-aarch64-utm.nix ./vm-shared.nix ];
-
-  # Interface is this on my M1
-  networking.interfaces.enp0s10.useDHCP = true;
-
-  # Qemu
-  services.spice-vdagentd.enable = true;
-
-  # For now, we need this since hardware acceleration does not work.
-  environment.variables.LIBGL_ALWAYS_SOFTWARE = "1";
-
-  # Lots of stuff that uses aarch64 that claims doesn't work, but actually works.
-  nixpkgs.config.allowUnfree = true;
-  nixpkgs.config.allowUnsupportedSystem = true;
-}
+{ ... }: { imports = [ ./hardware/vm-aarch64-utm.nix ./vm-shared.nix ]; }
diff --git a/nix/machines/vm-shared.nix b/nix/machines/vm-shared.nix
index 04eedf0..acff195 100644
--- a/nix/machines/vm-shared.nix
+++ b/nix/machines/vm-shared.nix
@@ -3,11 +3,10 @@
 
   nix = {
     package = pkgs.nixVersions.latest;
-    extraOptions = ''
-      experimental-features = nix-command flakes
-      keep-outputs = true
-      keep-derivations = true
-    '';
+    settings = {
+      trusted-users = [ "@admin" "fcuny" ];
+      experimental-features = [ "nix-command" "flakes" ];
+    };
   };
 
   # Use the systemd-boot EFI boot loader.
diff --git a/nix/machines/vm-synology.nix b/nix/machines/vm-synology.nix
new file mode 100644
index 0000000..a38af50
--- /dev/null
+++ b/nix/machines/vm-synology.nix
@@ -0,0 +1 @@
+{ ... }: { imports = [ ./hardware/vm-synology.nix ./vm-shared.nix ]; }