From a8c6c9d7f9a5e695fa013475936b72ca4d225ca0 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 9 Dec 2024 19:22:43 +0800 Subject: [PATCH] nixos/suites: update config --- modules/nixos/_private/suites/dev.nix | 4 +-- modules/nixos/_private/suites/filesystem.nix | 36 ++++++++++++++------ 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/modules/nixos/_private/suites/dev.nix b/modules/nixos/_private/suites/dev.nix index a63d8790..995d3e5b 100644 --- a/modules/nixos/_private/suites/dev.nix +++ b/modules/nixos/_private/suites/dev.nix @@ -161,7 +161,6 @@ in { # than nothing. virtualisation.podman = { enable = true; - dockerCompat = true; autoPrune = { enable = true; dates = "weekly"; @@ -186,7 +185,6 @@ in { (lib.mkIf cfg.virtual-machines.enable { environment.systemPackages = with pkgs; [ virt-top # Monitoring your virtual machines on a terminal, yeah. - virt-manager # An interface for those who are lazy to read a reference manual and create a 1000-line configuration per machine. quickemu # Faster than a speed'o'sound. ]; @@ -197,6 +195,8 @@ in { qemu.package = pkgs.qemu_full; qemu.ovmf.enable = true; }; + + programs.virt-manager.enable = true; }) (lib.mkIf cfg.neovim.enable { diff --git a/modules/nixos/_private/suites/filesystem.nix b/modules/nixos/_private/suites/filesystem.nix index e628b141..b5bd10b2 100644 --- a/modules/nixos/_private/suites/filesystem.nix +++ b/modules/nixos/_private/suites/filesystem.nix @@ -18,6 +18,7 @@ in archive.enable = lib.mkEnableOption "automounting offline archive"; external-hdd.enable = lib.mkEnableOption "automounting personal external hard drive"; personal-webstorage.enable = lib.mkEnableOption "automounting of personal WebDAV directory"; + laptop-ssd.enable = lib.mkEnableOption "automounting a leftover laptop SSD"; }; }; @@ -34,13 +35,13 @@ in }) (lib.mkIf cfg.setups.archive.enable { - state.paths.archive = "/mnt/archives"; + state.paths.archive = "/media/archives"; fileSystems."${config.state.paths.archive}" = { - device = "/dev/disk/by-partlabel/disk-archive-root"; + device = lib.mkDefault "/dev/disk/by-partlabel/disk-archive-root"; fsType = "btrfs"; noCheck = true; - options = [ + options = lib.mkDefault [ # These are btrfs-specific mount options which can found in btrfs.5 # manual page. "subvol=/root" @@ -59,22 +60,19 @@ in }) (lib.mkIf cfg.setups.external-hdd.enable { - state.paths.external-hdd = "/mnt/external-storage"; + state.paths.external-hdd = "/media/external-storage"; fileSystems."${config.state.paths.external-hdd}" = { - device = "/dev/disk/by-partlabel/disk-live-installer-root"; + device = lib.mkDefault "/dev/disk/by-partlabel/disk-live-installer-root"; fsType = "btrfs"; noCheck = true; - options = [ + options = lib.mkDefault [ "nofail" "noauto" "user" "subvol=/data" "compress=zstd" - "x-systemd.automount" - "x-systemd.device-timeout=2" - "x-systemd.idle-timeout=2" ]; }; }) @@ -89,7 +87,7 @@ in }]; # You have to set up the secrets for this somewhere. - fileSystems."/mnt/personal-webdav" = { + fileSystems."/media/personal-webdav" = { device = "https://dav.mailbox.org/servlet/webdav.infostore"; fsType = "davfs"; noCheck = true; @@ -106,5 +104,23 @@ in ]; }; }) + + (lib.mkIf cfg.setups.laptop-ssd.enable { + state.paths.laptop-ssd = "/media/laptop-ssd"; + + fileSystems."${config.state.paths.laptop-ssd}" = { + device = lib.mkDefault "/dev/disk/by-partlabel/disk-ni-secondary-data"; + fsType = "btrfs"; + noCheck = true; + options = lib.mkDefault [ + "rw" + "user" + "noauto" + "nofail" + + "compress=zstd:10" + ]; + }; + }) ]; }