From b6a7394c2af9329c413cd144b360cdf9a5c0ea2f Mon Sep 17 00:00:00 2001 From: Dmitriy Kholkin Date: Tue, 8 Jul 2025 22:25:13 +0300 Subject: [PATCH] fix: nixos-vm and test quadlet container --- flake.nix | 5 ++- hosts/NixOS-VM/default.nix | 58 ++++---------------------- modules/nixos/containers/filestash.nix | 34 ++++++++------- 3 files changed, 32 insertions(+), 65 deletions(-) diff --git a/flake.nix b/flake.nix index fad2154..bb4bc8e 100644 --- a/flake.nix +++ b/flake.nix @@ -119,7 +119,6 @@ ]; hostModuleDir = ./hosts; hosts = { - NixOS-VM.system = "x86_64-linux"; # home-workstation andromedae = { system = "x86_64-linux"; @@ -144,6 +143,10 @@ system = "x86_64-linux"; useHomeManager = false; }; + NixOS-VM = { + system = "x86_64-linux"; + useHomeManager = false; + }; }; }; diff --git a/hosts/NixOS-VM/default.nix b/hosts/NixOS-VM/default.nix index ee09a62..8d1f961 100644 --- a/hosts/NixOS-VM/default.nix +++ b/hosts/NixOS-VM/default.nix @@ -1,8 +1,4 @@ -{ - modulesPath, - pkgs, - ... -}: +{ modulesPath, ... }: { imports = [ (modulesPath + "/profiles/qemu-guest.nix") @@ -11,9 +7,9 @@ ataraxia.defaults.role = "base"; - boot.kernelParams = [ - "systemd.setenv=SYSTEMD_SULOGIN_FORCE=1" - ]; + # boot.kernelParams = [ + # "systemd.setenv=SYSTEMD_SULOGIN_FORCE=1" + # ]; virtualisation.memorySize = 4096; virtualisation.cores = 4; @@ -23,48 +19,12 @@ "-vga qxl" "-display gtk" ]; - users.users.test = { - isNormalUser = true; - }; + virtualisation.diskSize = 8192; - boot.supportedFilesystems = [ "zfs" ]; - boot.zfs.forceImportRoot = false; - networking.hostId = "84977205"; + boot.loader.grub.enable = false; - environment.systemPackages = with pkgs; [ - # test overlay - sing-box - ]; + ataraxia.virtualisation.podman = true; + ataraxia.containers.filestash.enable = true; - # Test persist module - persist.enable = true; - persist.cache.clean.enable = true; - persist.state.directories = [ "/etc" ]; - persist.cache.directories = [ "/cache" ]; - home-manager.users.ataraxia = { - home.stateVersion = "24.11"; - persist.enable = true; - persist.cache.clean.enable = false; - persist.state.directories = [ "test-home" ]; - persist.cache.directories = [ - "test-1" - "test-2" - ]; - persist.state.files = [ "home" ]; - }; - home-manager.users.test = { - home.stateVersion = "24.11"; - persist.enable = true; - persist.cache.clean.enable = true; - persist.cache.directories = [ - "test-3" - "test-4" - ]; - persist.cache.files = [ - "home" - "home3" - ]; - }; - - system.stateVersion = "24.11"; + system.stateVersion = "25.05"; } diff --git a/modules/nixos/containers/filestash.nix b/modules/nixos/containers/filestash.nix index aefd451..43dc431 100644 --- a/modules/nixos/containers/filestash.nix +++ b/modules/nixos/containers/filestash.nix @@ -1,6 +1,7 @@ { config, lib, ... }: let inherit (lib) mkEnableOption mkIf; + inherit (config.virtualisation.quadlet) networks; cfg = config.ataraxia.containers.filestash; nas-path = "/media/nas/media-stack"; @@ -11,23 +12,26 @@ in }; config = mkIf cfg.enable { - virtualisation.oci-containers.containers.filestash = { + virtualisation.quadlet.containers.filestash = { autoStart = true; - environment = { - PUID = "1000"; - PGID = "100"; - UMASK = "002"; - TZ = "Europe/Moscow"; - APPLICATION_URL = "files.ataraxiadev.com"; - CANARY = "true"; + containerConfig = { + environments = { + PUID = "1000"; + PGID = "100"; + UMASK = "002"; + TZ = "Europe/Moscow"; + APPLICATION_URL = "files.ataraxiadev.com"; + CANARY = "true"; + }; + # Tags: latest + image = "docker.io/machines/filestash@sha256:923c3399768fada3424bb6f3bc01521dad30e9a7a840cfb2eba3610b6acafffe"; + networks = [ networks.br-services.ref ]; + publishPorts = [ "127.0.0.1:8334:8334/tcp" ]; + volumes = [ + "${nas-path}/configs/filestash:/app/data/state" + "${nas-path}:/mnt" + ]; }; - # Tags: latest - image = "docker.io/machines/filestash@sha256:923c3399768fada3424bb6f3bc01521dad30e9a7a840cfb2eba3610b6acafffe"; - ports = [ "127.0.0.1:8334:8334/tcp" ]; - volumes = [ - "${nas-path}/configs/filestash:/app/data/state" - "${nas-path}:/mnt" - ]; }; }; }