[HACK] FediPanel: do not call nix develop

This commit is contained in:
Nicolas Jeannerod 2025-06-04 16:03:54 +02:00
parent 80f08ffa28
commit a64e81236e
Signed by untrusted user: Niols
GPG key ID: 35DB9EC8886E1CB8
3 changed files with 12 additions and 7 deletions

View file

@ -21,7 +21,7 @@ let
name = "panel"; name = "panel";
cfg = config.services.${name}; cfg = config.services.${name};
package = pkgs.callPackage ./package.nix { }; package = pkgs.callPackage ./package.nix { nixops4 = config.services.panel.nixops4Package; };
environment = import ../env.nix { inherit lib pkgs; } // { environment = import ../env.nix { inherit lib pkgs; } // {
DATABASE_URL = "sqlite:////var/lib/${name}/db.sqlite3"; DATABASE_URL = "sqlite:////var/lib/${name}/db.sqlite3";
@ -133,6 +133,11 @@ in
type = types.attrsOf types.path; type = types.attrsOf types.path;
default = { }; default = { };
}; };
nixops4Package = mkOption {
description = ''
A package providing NixOps4.
'';
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -179,6 +184,8 @@ in
path = [ path = [
python-environment python-environment
manage-service manage-service
config.services.panel.nixops4Package
pkgs.openssh
]; ];
preStart = '' preStart = ''
# Auto-migrate on first run or if the package has changed # Auto-migrate on first run or if the package has changed

View file

@ -4,6 +4,7 @@
python3, python3,
python3Packages, python3Packages,
callPackage, callPackage,
nixops4,
runCommand, runCommand,
sources ? import ../../npins, sources ? import ../../npins,
}: }:
@ -85,6 +86,7 @@ python3.pkgs.buildPythonPackage {
in in
[ [
sqlite sqlite
nixops4
] ]
++ pythonPackages; ++ pythonPackages;

View file

@ -89,16 +89,12 @@ class DeploymentStatus(ConfigurationForm):
def deployment(self, config: BaseModel): def deployment(self, config: BaseModel):
env = { env = {
"PATH": settings.bin_path, "PATH": os.environ['PATH'] + ":" + settings.bin_path,
"HOME": '/run/fedipanel',
# pass in form info to our deployment # pass in form info to our deployment
"DEPLOYMENT": config.json() "DEPLOYMENT": config.json()
} }
cmd = [ cmd = [
"nix",
"develop",
"--extra-experimental-features",
"configurable-impure-env",
"--command",
"nixops4", "nixops4",
"apply", "apply",
"check-deployment-panel", "check-deployment-panel",