wip local dev

This commit is contained in:
Florian Schmitt 2024-01-23 22:52:57 +03:00
parent 750b55bd68
commit 1b49cdba2c
2 changed files with 65 additions and 2 deletions

View file

@ -144,6 +144,7 @@ in
(chromium.override {
enableWideVine = true; # DRM support
})
appimage-run
audacious
calibre
digikam

View file

@ -1,6 +1,5 @@
# Local developpement
{ pkgs, config, lib, ... }:
{
{ pkgs, config, lib, ... }: {
virtualisation = {
docker.enable = true;
docker.rootless = {
@ -12,6 +11,68 @@
#waydroid.enable = true;
};
systemd.services.yeswikidev = {
enable = true;
script = ''
${pkgs.systemd}/bin/systemctl start mysql
# etc
'';
serviceConfig = let
startstop = command:
(pkgs.writeShellApplication {
name = "yeswikidev";
runtimeInputs = with pkgs; [ systemd ];
text = ''
systemctl ${command} mysql.service
'';
});
#startstopFullShell = pkgs.writeShellApplication {
# name = "yeswikidev";
# runtimeInputs = with pkgs; [ systemd ];
# text = ''
# systemctl "$1" mysql.service
# '';
#});
#commands = [ "start" "stop" ];
#scripts = map (command: (pkgs.writeShellApplication {
# name = "yeswikidev";
# runtimeInputs = with pkgs; [ systemd ];
# text = ''
# systemctl ${command} mysql.service
# '';
#})) commands;
#execs = {
# ExecStart = "start";
# ExecStop = "stop";
#};
# https://nixos.org/manual/nix/stable/language/builtins
# https://nixos.org/manual/nix/stable/language/builtins#builtins-mapAttrs
#execAttrs = attrNames execs; # ["Start" "Stop"];
#execs2 = mapAttrs (k: v: ()) execs;
in {
# pkgs.writeScript, pkgs.writeScriptBin
#ExecStart = startstop "start";
#ExecStop = startstop "stop";
# OR
# ExecStart = "${startstopFullShell} start";
# ExecStop = "${startstopFullShell} stop";
# OR
# ExecStart = "${scripts[0]}";
# ExecStop = "${scripts[1]}";
};
};
services.mysql = {
package = pkgs.mariadb;
ensureDatabases = [ "yeswiki-db" ];
ensureUsers = [{
name = "yeswiki-db-user";
ensurePermissions = { "yeswiki-db" = "ALL PRIVILEGES"; };
}];
};
systemd.services.mysql.wantedBy = lib.mkForce [];
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
@ -19,6 +80,7 @@
docker-compose
gcc
gitkraken
nixfmt
nodejs
php83
php83Packages.composer