-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add appName To options for flake. #1993
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
flake-module.nix
Outdated
appName = lib.mkOption { | ||
description ='' | ||
The derivation name. | ||
Can be omitted if pname and version are set, in which case it is automatically set to ''${pname}-''${version}. | ||
''; | ||
type= lib.types.str; | ||
default="app"; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation here is messed up.
Also Can be omitted if pname and version are set, in which case it is automatically set to ''${pname}-''${version}.
can be removed
flake-module.nix
Outdated
@@ -139,6 +148,7 @@ ihpFlake: | |||
pkgs = pkgs; | |||
rtsFlags = cfg.rtsFlags; | |||
optimizationLevel = cfg.optimizationLevel; | |||
appName=cfg.appName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
appName=cfg.appName; | |
appName = cfg.appName; |
flake-module.nix
Outdated
@@ -152,6 +162,7 @@ ihpFlake: | |||
pkgs = pkgs; | |||
rtsFlags = cfg.rtsFlags; | |||
optimizationLevel = "0"; | |||
appName=cfg.appName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
appName=cfg.appName; | |
appName = cfg.appName; |
Fixed comments, indentation and whitespace. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍
When hosting multiple ihp apps on a particular server it is helpful for debugging/maintenance/tooling to be able to inspect which binaries are in the production servers /nix/store by their name (not just hash). This is consistent with all other nixpkgs that contain the hash and the package name in the store.
For managed production clusters it is also nice for roll back to be able to give semver names to app packages so that it is easy to instantly roll back to a prev version of app binary on a prod server if required. This PR adds option of appName to ihp flake-modules so users can specify the appName. The appName option gets passed all the way to ihp's (un)optimized-prod-server package
mkDerivation
(where it is calledname
and is a standard attribute for nix's mkDerivation.). We could call itname
at the top level so it matches specifically but in the context of the app level flake it is probably less ambiguous to call itappName
.Furthermore having an appName option at top level flake has been found useful for a number of other IHP production helpers i.e. scripts to synchronize databases and deploy to servers etc. that can leverage the appName variable as well.