mrflos-nixos-config-fork/modules/local-dev.nix

92 lines
2.2 KiB
Nix
Raw Normal View History

2023-04-14 20:51:52 +00:00
# Local developpement
2024-01-23 19:52:57 +00:00
{ pkgs, config, lib, ... }: {
2023-04-14 20:51:52 +00:00
virtualisation = {
docker.enable = true;
docker.rootless = {
enable = true;
setSocketVariable = true;
};
libvirtd.enable = true;
lxd.enable = true;
2024-01-03 17:29:16 +00:00
#waydroid.enable = true;
2023-04-14 20:51:52 +00:00
};
2024-01-23 19:52:57 +00:00
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 = {
2024-02-05 17:49:09 +00:00
enable = true;
2024-01-23 19:52:57 +00:00
package = pkgs.mariadb;
};
2023-04-14 20:51:52 +00:00
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
2023-11-03 08:09:19 +00:00
clang
docker-compose
2023-11-03 08:09:19 +00:00
gcc
gitkraken
2024-02-03 04:39:56 +00:00
go
2024-01-23 19:52:57 +00:00
nixfmt
nodejs
php83
php83Packages.composer
php83Packages.php-cs-fixer
2023-11-03 08:09:19 +00:00
python311Packages.virtualenv
rpi-imager
symfony-cli
2023-04-14 20:51:52 +00:00
virt-manager
yarn
2023-11-03 08:09:19 +00:00
zig
2023-04-14 20:51:52 +00:00
];
}