diff --git a/flake.nix b/flake.nix index c60cf40..cc23a8a 100644 --- a/flake.nix +++ b/flake.nix @@ -43,10 +43,14 @@ }; homeManagerVersion = "24.05"; # Local Services - localNixCaches = [ - "http://minipc1.lab.internal:5000" - "http://fwlaptop.devices.internal:5000" - ]; + localNixCaches = { + urls = [ + "http://minipc1.lab.internal:5000" + ]; + keys = [ + "minipc1.lab.internal:eIoib1JgcBEd0YKdW95QlRA2eCKDs+WxNhWhkA1wffc=" + ]; + }; localDockerRegistries = [ "minipc1.lab.internal:5001" ]; # Libs lib = (import modules/lib.nix { diff --git a/hosts/hl-minipc1.nix b/hosts/hl-minipc1.nix index 4056274..2b7374d 100644 --- a/hosts/hl-minipc1.nix +++ b/hosts/hl-minipc1.nix @@ -1,6 +1,11 @@ { user }: { pkgs, lib, config, ... }: { imports = [ ./hl-minipc1.hardware-configuration.nix ]; + # Nix Stores + services.nix-serve = { + enable = true; + secretKeyFile = "/var/keys/cache-priv-key.pem"; + }; # firmware updater services.fwupd.enable = true; # Bootloader. @@ -29,38 +34,5 @@ listenAddress = "0.0.0.0"; enableDelete = true; }; - virtualisation.oci-containers = { - backend = "docker"; - containers = { - myevents-app = { - autoStart = true; - image = "localhost:5001/asosnovsky/myevents"; - extraOptions = [ "--gpus" "all" ]; - ports = [ "8000:80" ]; - cmd = [ "app" ]; - environmentFiles = [ - "/mnt/Data/myevents/app.env" - ]; - dependsOn = [ "myevents-db" ]; - }; - myevents-cron = { - autoStart = true; - image = "localhost:5001/asosnovsky/myevents"; - cmd = [ "cron" ]; - environmentFiles = [ - "/mnt/Data/myevents/app.env" - ]; - dependsOn = [ "myevents-db" ]; - }; - myevents-db = { - autoStart = true; - image = "docker.io/postgres"; - hostname = "myevents-db"; - environmentFiles = [ - "/mnt/Data/myevents/db.env" - ]; - }; - }; - }; } diff --git a/modules/main.nix b/modules/main.nix index 4336b26..40f3eee 100644 --- a/modules/main.nix +++ b/modules/main.nix @@ -17,7 +17,7 @@ enable = false; enableDevelopmentKit = false; } -, localNixCaches ? [ ] +, localNixCaches ? { keys = [ ]; urls = [ ]; } , ... }: { ... }: { diff --git a/modules/nix/default.nix b/modules/nix/default.nix index 6547eba..b07705c 100644 --- a/modules/nix/default.nix +++ b/modules/nix/default.nix @@ -1,4 +1,4 @@ -{ user, systemStateVersion, localNixCaches ? [ ] }: +{ user, systemStateVersion, localNixCaches ? { keys = [ ]; urls = [ ]; } }: { pkgs, ... }: { # Nix core @@ -10,16 +10,16 @@ "https://cache.nixos.org" "https://cache.flox.dev" "https://devenv.cachix.org" - ] ++ localNixCaches; + ] ++ localNixCaches.urls; trusted-substituters = [ "https://cache.flox.dev" "https://devenv.cachix.org" - ] ++ localNixCaches; + ] ++ localNixCaches.urls; trusted-users = [ "root" user.name ]; trusted-public-keys = [ "flox-cache-public-1:7F4OyH7ZCnFhcze3fJdfyXYLQw/aV7GEed86nQ7IsOs=" "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=" - ]; + ] ++ localNixCaches.keys; }; # System Packages