Add package function-schema and module-schema. Add check for module jsonschema.
This commit is contained in:
@@ -22,8 +22,8 @@
|
||||
'';
|
||||
};
|
||||
clanDir = lib.mkOption {
|
||||
type = lib.types.either lib.types.path lib.types.str;
|
||||
default = ".";
|
||||
type = lib.types.path;
|
||||
default = ./.;
|
||||
description = ''
|
||||
the location of the flake repo, used to calculate the location of facts and secrets
|
||||
'';
|
||||
|
||||
78
nixosModules/waypipe.nix
Normal file
78
nixosModules/waypipe.nix
Normal file
@@ -0,0 +1,78 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options.clan.services.waypipe = {
|
||||
enable = lib.mkEnableOption "waypipe";
|
||||
user = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "user";
|
||||
description = "User the program is run under";
|
||||
};
|
||||
flags = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [
|
||||
"--vsock"
|
||||
"-s"
|
||||
"3049"
|
||||
"server"
|
||||
];
|
||||
description = "Flags that will be passed to waypipe";
|
||||
};
|
||||
command = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ (lib.getExe pkgs.foot) ];
|
||||
description = "Commands that waypipe should run";
|
||||
};
|
||||
};
|
||||
config = lib.mkIf config.clan.services.waypipe.enable {
|
||||
# Waypipe needs pipewire
|
||||
services.pipewire = {
|
||||
enable = lib.mkDefault true;
|
||||
alsa.enable = lib.mkDefault true;
|
||||
alsa.support32Bit = lib.mkDefault true;
|
||||
pulse.enable = lib.mkDefault true;
|
||||
};
|
||||
# General default settings
|
||||
fonts.enableDefaultPackages = lib.mkDefault true;
|
||||
hardware.opengl.enable = lib.mkDefault true;
|
||||
# Assume it is run inside a clan context
|
||||
clan.virtualisation.waypipe = lib.mkDefault true;
|
||||
|
||||
# User account
|
||||
services.getty.autologinUser = lib.mkDefault config.clan.services.waypipe.user;
|
||||
security.sudo.wheelNeedsPassword = false;
|
||||
|
||||
users.users.user = lib.mkIf (config.clan.services.waypipe.user == "user") {
|
||||
isNormalUser = true;
|
||||
uid = 1000;
|
||||
password = "";
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"video"
|
||||
];
|
||||
shell = "/run/current-system/sw/bin/bash";
|
||||
};
|
||||
|
||||
systemd.user.services.waypipe = {
|
||||
serviceConfig.PassEnvironment = "DISPLAY";
|
||||
serviceConfig.Environment = ''
|
||||
XDG_SESSION_TYPE=wayland \
|
||||
NIXOS_OZONE_WL=1 \
|
||||
GDK_BACKEND=wayland \
|
||||
QT_QPA_PLATFORM=wayland \
|
||||
CLUTTER_BACKEND = "wayland" \
|
||||
SDL_VIDEODRIVER=wayland
|
||||
'';
|
||||
script = ''
|
||||
${lib.getExe pkgs.waypipe} \
|
||||
${lib.escapeShellArgs config.clan.services.waypipe.flags} \
|
||||
${lib.escapeShellArgs config.clan.services.waypipe.command}
|
||||
'';
|
||||
wantedBy = [ "default.target" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user