2024-08-03 20:40:07 +02:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
nix-config,
|
|
|
|
lib,
|
2024-09-10 05:08:01 +02:00
|
|
|
pkgs,
|
2024-08-03 20:40:07 +02:00
|
|
|
...
|
|
|
|
}:
|
2023-06-23 21:48:29 +02:00
|
|
|
|
2023-08-31 20:08:35 +02:00
|
|
|
let
|
2024-04-06 14:08:06 +02:00
|
|
|
inherit (lib) mkIf;
|
2024-07-17 11:55:08 +02:00
|
|
|
inherit (config.modules.system) username;
|
2024-04-06 14:08:06 +02:00
|
|
|
inherit (config.boot) enableContainers;
|
2024-04-05 01:38:57 +02:00
|
|
|
|
2023-08-31 20:08:35 +02:00
|
|
|
template = {
|
2023-06-03 21:29:49 +02:00
|
|
|
privateNetwork = true;
|
2023-06-16 20:21:23 +02:00
|
|
|
ephemeral = true;
|
2023-10-11 00:38:13 +02:00
|
|
|
restartIfChanged = false;
|
2023-06-03 21:29:49 +02:00
|
|
|
|
|
|
|
bindMounts = {
|
2023-06-22 17:43:19 +02:00
|
|
|
"/mnt" = {
|
2024-04-05 01:38:57 +02:00
|
|
|
hostPath = "/home/${username}/containers/wine";
|
2023-06-03 21:29:49 +02:00
|
|
|
isReadOnly = false;
|
|
|
|
};
|
2023-06-03 21:36:26 +02:00
|
|
|
|
|
|
|
waylandDisplay = rec {
|
|
|
|
hostPath = "/run/user/1000";
|
|
|
|
mountPoint = hostPath;
|
|
|
|
};
|
|
|
|
|
|
|
|
x11Display = rec {
|
|
|
|
hostPath = "/tmp/.X11-unix";
|
|
|
|
mountPoint = hostPath;
|
|
|
|
};
|
2023-06-16 20:22:57 +02:00
|
|
|
|
|
|
|
dri = rec {
|
|
|
|
hostPath = "/dev/dri";
|
|
|
|
mountPoint = hostPath;
|
|
|
|
};
|
2023-06-03 21:29:49 +02:00
|
|
|
};
|
|
|
|
|
2023-06-16 20:22:57 +02:00
|
|
|
allowedDevices = [
|
|
|
|
{
|
|
|
|
modifier = "rw";
|
|
|
|
node = "/dev/dri/renderD128";
|
|
|
|
}
|
|
|
|
];
|
2024-04-05 15:36:21 +02:00
|
|
|
|
|
|
|
specialArgs = {
|
2024-04-05 16:09:51 +02:00
|
|
|
inherit nix-config;
|
2024-04-05 15:36:21 +02:00
|
|
|
};
|
2023-08-31 20:08:35 +02:00
|
|
|
};
|
2023-08-31 20:16:29 +02:00
|
|
|
in
|
|
|
|
{
|
2024-09-10 05:08:01 +02:00
|
|
|
environment.systemPackages = mkIf (pkgs.system == "x86_64-linux") (
|
|
|
|
with nix-config.inputs.sakaya.packages.${pkgs.system}; [ sakaya ]
|
|
|
|
);
|
|
|
|
|
2024-07-17 11:55:08 +02:00
|
|
|
containers = mkIf enableContainers {
|
2024-04-06 14:08:06 +02:00
|
|
|
wine = template // {
|
|
|
|
hostAddress = "192.168.100.34";
|
|
|
|
localAddress = "192.168.100.49";
|
2024-10-21 15:07:43 +02:00
|
|
|
config =
|
|
|
|
{
|
|
|
|
nix-config,
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (nix-config.inputs.sakaya.packages.${pkgs.system}) sakaya;
|
|
|
|
inherit (config.modules.system) username;
|
|
|
|
inherit (lib) getExe;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
imports = with nix-config.nixosModules; [
|
|
|
|
shell
|
|
|
|
desktop
|
|
|
|
system
|
|
|
|
stylix
|
|
|
|
fonts
|
|
|
|
];
|
|
|
|
|
|
|
|
home-manager.sharedModules = with nix-config.homeModules; [
|
|
|
|
fish
|
|
|
|
git
|
|
|
|
gtk
|
|
|
|
kitty
|
|
|
|
neovim
|
|
|
|
xresources
|
|
|
|
yazi
|
|
|
|
];
|
|
|
|
|
|
|
|
nixpkgs.overlays = builtins.attrValues nix-config.overlays;
|
|
|
|
|
|
|
|
environment = {
|
|
|
|
systemPackages =
|
|
|
|
(with pkgs; [
|
|
|
|
wineWowPackages.waylandFull
|
|
|
|
winetricks
|
2024-10-22 07:40:41 +02:00
|
|
|
]);
|
2024-10-21 15:07:43 +02:00
|
|
|
|
|
|
|
variables = {
|
|
|
|
TERM = "xterm-kitty";
|
|
|
|
};
|
|
|
|
|
|
|
|
sessionVariables = {
|
|
|
|
WAYLAND_DISPLAY = "wayland-1";
|
|
|
|
QT_QPA_PLATFORM = "wayland";
|
|
|
|
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
|
|
|
|
SDL_VIDEODRIVER = "wayland";
|
|
|
|
CLUTTER_BACKEND = "wayland";
|
|
|
|
MOZ_ENABLE_WAYLAND = "1";
|
|
|
|
XDG_RUNTIME_DIR = "/run/user/1000";
|
|
|
|
DISPLAY = ":0";
|
|
|
|
QT_IM_MODULE = "fcitx";
|
|
|
|
XMODIFIERS = "@im=fcitx";
|
|
|
|
SDL_IM_MODULE = "fcitx";
|
|
|
|
GLFW_IM_MODULE = "ibus";
|
|
|
|
LC_ALL = "ja_JP.UTF-8";
|
|
|
|
TZ = "Asia/Tokyo";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
hardware.graphics.enable = true;
|
|
|
|
|
2024-10-22 07:40:08 +02:00
|
|
|
networking.firewall.allowedTCPPorts = [ 39493 ];
|
2024-10-21 15:07:43 +02:00
|
|
|
|
|
|
|
systemd.services.sakaya = {
|
|
|
|
enable = true;
|
|
|
|
description = "sakaya server";
|
2024-10-22 07:40:08 +02:00
|
|
|
unitConfig.Type = "simple";
|
2024-10-21 15:07:43 +02:00
|
|
|
path = with pkgs; [ su ];
|
2024-10-22 07:40:08 +02:00
|
|
|
serviceConfig.ExecStart = "/usr/bin/env su ${username} --command=${getExe sakaya}";
|
2024-10-21 15:07:43 +02:00
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
};
|
|
|
|
};
|
2023-06-11 15:51:26 +02:00
|
|
|
};
|
2024-10-11 22:28:15 +02:00
|
|
|
|
|
|
|
wordpress = {
|
|
|
|
privateNetwork = true;
|
|
|
|
ephemeral = true;
|
|
|
|
autoStart = true;
|
|
|
|
|
|
|
|
hostAddress = "192.168.100.24";
|
|
|
|
localAddress = "192.168.100.39";
|
|
|
|
|
|
|
|
specialArgs = {
|
|
|
|
inherit nix-config;
|
|
|
|
};
|
|
|
|
|
2024-10-21 15:07:43 +02:00
|
|
|
config =
|
|
|
|
{ nix-config, pkgs, ... }:
|
|
|
|
{
|
|
|
|
imports = with nix-config.nixosModules; [
|
|
|
|
system
|
|
|
|
];
|
|
|
|
|
|
|
|
users.defaultUserShell = pkgs.fish;
|
|
|
|
|
|
|
|
programs = {
|
|
|
|
fish.enable = true;
|
|
|
|
neovim.enable = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
environment = {
|
|
|
|
systemPackages = with pkgs; [ kitty ];
|
|
|
|
shells = with pkgs; [ fish ];
|
|
|
|
|
|
|
|
variables = {
|
|
|
|
TERM = "xterm-kitty";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
networking = {
|
|
|
|
firewall.allowedTCPPorts = [ 80 ];
|
|
|
|
};
|
|
|
|
|
|
|
|
services.wordpress.sites.localhost = { };
|
|
|
|
};
|
2024-10-11 22:28:15 +02:00
|
|
|
};
|
2023-06-03 21:29:49 +02:00
|
|
|
};
|
|
|
|
}
|