commit d008a3c1567217485efc72fb60e3480b875e8948
parent 9199ef069ba828749579170f921277326d5d05c0
Author: Silas Brack <silasbrack@gmail.com>
Date: Sun, 13 Oct 2024 17:33:05 +0200
Fixes
Diffstat:
4 files changed, 23 insertions(+), 35 deletions(-)
diff --git a/apps/my_app/flake.nix b/apps/my_app/flake.nix
@@ -21,8 +21,25 @@
};
in {
packages.default = pkgs.buildGleamApplication {
- src = ./.;
- erlangPackage = pkgs.erlang_27;
+ src = ./.;
+ erlangPackage = pkgs.erlang_27;
+ };
+ devShells.system.default = {
+ buildInputs = [
+ pkgs.gleam
+ pkgs.erlang_27
+ pkgs.rebar3
+ pkgs.inotify-tools
+ pkgs.nodejs_22
+ ];
+ shellHook = ''
+ export PORT=52393
+ export PGHOST="127.0.0.1"
+ export PGPASSWORD="postgres"
+ export PGPORT=44537
+ export PGUSER="silas"
+ export PGDB="mydb"
+ '';
};
})
);
diff --git a/apps/my_app/module.nix b/apps/my_app/module.nix
@@ -6,10 +6,10 @@ let
pkg = import ./.;
migrations = pkg.migrations;
server = pkg.server;
- cfg = config.services.myapp;
+ cfg = config.services.my_app;
in {
options = {
- services.myapp = {
+ services.my_app = {
enable = mkEnableOption "My App";
package = mkOption {
@@ -25,7 +25,7 @@ in {
user = mkOption {
type = types.str;
- default = "myapp_user";
+ default = "my_app_user";
description = "User account under which my app runs.";
};
diff --git a/apps/my_app/shell.nix b/apps/my_app/shell.nix
@@ -1,29 +0,0 @@
-let
- pkgs = import <nixpkgs> {};
- # pkgs = import (builtins.fetchTarball {
- # name = "nixos-24.05";
- # url = "https://github.com/nixos/nixpkgs/archive/63dacb46bf939521bdc93981b4cbb7ecb58427a0.tar.gz";
- # sha256 = "1lr1h35prqkd1mkmzriwlpvxcb34kmhc9dnr48gkm8hh089hifmx";
- # }) {};
- # pkgs = import (builtins.fetchTarball {
- # name = "nixos-unstable";
- # url = "https://github.com/nixos/nixpkgs/archive/896d74a4f75c23bca045a48ea7d0c1f16f604943.tar.gz";
- # sha256 = "1j9rhjql4qjm9xky90m0chdcjhkm3dsijqr0kc6n3xaw7f21wgj4";
- # }) {};
-in pkgs.mkShell {
- buildInputs = [
- pkgs.gleam
- pkgs.erlang_27
- pkgs.rebar3
- pkgs.inotify-tools
- pkgs.nodejs_22
- ];
- shellHook = ''
- export PORT=52393
- export PGHOST="127.0.0.1"
- export PGPASSWORD="postgres"
- export PGPORT=44537
- export PGUSER="silas"
- export PGDB="mydb"
- '';
-}
diff --git a/flake.nix b/flake.nix
@@ -88,7 +88,7 @@
];
};
- services.myapp = {
+ services.my_app = {
enable = true;
package = my_app.packages."x86_64-linux".default;
port = 8009;