nixos-config/machines/cherry/ferdium.nix

50 lines
913 B
Nix
Raw Permalink Normal View History

2024-10-22 17:20:17 +02:00
{
config,
pkgs,
lib,
...
}:
with lib;
let
ferdium = pkgs.writeShellScriptBin "ferdium" ''
/var/run/wrappers/bin/sudo -u ferdium -i ${pkgs.ferdium}/bin/ferdium $@
'';
in
{
environment.systemPackages = [
ferdium
(pkgs.makeDesktopItem {
terminal = false;
exec = "${ferdium}/bin/ferdium";
name = "ferdium";
desktopName = "Ferdium";
icon = "${pkgs.ferdium}/share/icons/hicolor/512x512/apps/ferdium.png";
})
pkgs.xorg.xhost
];
users.users.ferdium = {
isNormalUser = false;
isSystemUser = true;
home = "/home/ferdium";
createHome = true;
extraGroups = [
"audio"
"input"
"video"
"pipewire"
];
group = "ferdium";
shell = pkgs.bashInteractive;
};
users.groups.ferdium = { };
security.sudo.extraConfig = ''
${config.users.extraUsers.mainUser.name} ALL=(ferdium) NOPASSWD: ALL
'';
}