xin/gui/default.nix

100 lines
2.6 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, xinlib, ... }:
let
firefox = import ../configs/firefox.nix { inherit pkgs; };
rage = pkgs.writeScriptBin "rage" (import ../bins/rage.nix { inherit pkgs; });
rpr = pkgs.writeScriptBin "rpr"
2023-05-19 06:14:41 -06:00
(import ../bins/rpr.nix { inherit (pkgs) hut gh tea; });
promnesia =
pkgs.python3Packages.callPackage ../pkgs/promnesia.nix { inherit pkgs; };
hpi = pkgs.python3Packages.callPackage ../pkgs/hpi.nix { inherit pkgs; };
promnesiaService = {
promnesia = {
description = "Service for promnesia.server";
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
script = ''
${promnesia}/bin/promnesia serve
'';
};
};
jobs = [{
name = "promnesia-index";
script = "${promnesia}/bin/promnesia index";
2023-02-08 06:27:59 -07:00
startAt = "*:0/5";
path = [ promnesia hpi ];
}];
in with lib; {
2022-08-25 12:21:35 -06:00
imports = [ ./gnome.nix ./kde.nix ./xfce.nix ./arcan.nix ];
options = {
pulse = {
enable = mkOption {
description = "Enable PulseAudio";
default = false;
example = true;
type = types.bool;
};
};
pipewire = {
enable = mkOption {
description = "Enable PipeWire";
default = true;
example = true;
type = types.bool;
};
};
};
config = mkMerge [
(mkIf (config.kde.enable || config.gnome.enable || config.xfce.enable) {
services = {
xserver.enable = true;
pcscd.enable = true;
};
2022-08-25 12:21:35 -06:00
# TODO: TEMP FIX
systemd.services.NetworkManager-wait-online.serviceConfig.ExecStart =
lib.mkForce [ "" "${pkgs.networkmanager}/bin/nm-online -q" ];
fonts.fonts = with pkgs; [
go-font
(callPackage ../pkgs/kurinto.nix { })
];
sound.enable = true;
environment.systemPackages = with pkgs; [
bc
black
brave
drawterm
go-font
hpi
pcsctools
promnesia
rage
rpr
vlc
zeal
(callPackage ../pkgs/tailscale-systray.nix { })
(callPackage ../pkgs/govulncheck.nix { })
(callPackage ../configs/helix.nix { })
];
programs = { } // firefox.programs;
systemd.user.services =
(lib.listToAttrs (builtins.map xinlib.jobToUserService jobs))
// promnesiaService;
security.rtkit.enable = true;
})
2022-08-25 12:21:35 -06:00
(mkIf config.pipewire.enable {
services.pipewire = {
enable = true;
pulse.enable = true;
jack.enable = true;
alsa.enable = true;
};
})
];
}