forked from Fediversity/Fediversity
pass nix binary explicitly rather than thru PATH
This commit is contained in:
parent
3700b6e383
commit
c98663ae71
3 changed files with 4 additions and 4 deletions
panel
|
@ -8,6 +8,7 @@
|
|||
},
|
||||
}:
|
||||
let
|
||||
inherit (pkgs) lib;
|
||||
manage = pkgs.writeScriptBin "manage" ''
|
||||
exec ${pkgs.lib.getExe pkgs.python3} ${toString ./src/manage.py} $@
|
||||
'';
|
||||
|
@ -22,7 +23,7 @@ in
|
|||
env = {
|
||||
NPINS_DIRECTORY = toString ../npins;
|
||||
# explicitly use nix, as e.g. lix does not have configurable-impure-env
|
||||
NIX_DIR = pkgs.nix;
|
||||
NIX_BIN = lib.getExe pkgs.nix;
|
||||
REPO_DIR = toString ../.;
|
||||
CREDENTIALS_DIRECTORY = builtins.toString ./.credentials;
|
||||
DATABASE_URL = "sqlite:///${toString ./src}/db.sqlite3";
|
||||
|
|
|
@ -193,7 +193,7 @@ if user_settings_file is not None:
|
|||
# Replacing the `USER_SETTINGS_FILE` mechanism following the comment there would probably be a good thing.
|
||||
|
||||
# a dir of nix supporting experimental feature `configurable-impure-env`.
|
||||
nix_bin_dir=f"{env['NIX_DIR']}/bin/"
|
||||
nix_bin=env['NIX_BIN']
|
||||
# path of the root flake to trigger nixops from, see #94.
|
||||
# to deploy this should be specified, for dev just use a relative path.
|
||||
repo_dir = env["REPO_DIR"]
|
||||
|
|
|
@ -58,12 +58,11 @@ class ConfigurationForm(LoginRequiredMixin, FormView):
|
|||
# serialize back and forth now we still need to manually inject the dummy user
|
||||
deployment = json.dumps(dummy_user | json.loads(submission))
|
||||
env = {
|
||||
"PATH": settings.nix_bin_dir,
|
||||
# pass in form info to our deployment
|
||||
"DEPLOYMENT": deployment,
|
||||
}
|
||||
cmd = [
|
||||
"nix",
|
||||
settings.nix_bin,
|
||||
"develop",
|
||||
# workaround to pass in info to nixops4 thru env vars, tho impure :(
|
||||
"--extra-experimental-features",
|
||||
|
|
Loading…
Add table
Reference in a new issue