mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 04:58:01 +00:00
539a798009
I revisited NixOS this week and I've rewritten my NixOS config from scratch. I must say I really like Nix flakes. For whatever reason it just clicked and I understood more programming with Nix despite my previous experience which is not good. Could be just the fact I had a break for a long time from completely using Nix (I still used it on non-NixOS distros). Eh... I still took some things from the original inspiration of this configuration so there's that.
52 lines
1.5 KiB
Nix
52 lines
1.5 KiB
Nix
# This is where extra desktop goodies can be found.
|
|
# As a note, this is not where you set the aesthetics of your graphical sessions.
|
|
# That can be found in the `themes` module.
|
|
{ config, options, lib, pkgs, ... }:
|
|
|
|
let
|
|
cfg = config.modules.desktop;
|
|
in
|
|
{
|
|
options.modules.desktop = {
|
|
enable = lib.mkEnableOption "Enables all desktop-related services and default programs.";
|
|
audio.enable = lib.mkEnableOption "Enables all desktop audio-related services such as Pipewire.";
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable (lib.mkMerge [
|
|
({
|
|
# Enable Flatpak for additional options for installing desktop applications.
|
|
services.flatpak.enable = true;
|
|
xdg.portal = {
|
|
enable = true;
|
|
gtkUsePortal = true;
|
|
wlr.enable = true;
|
|
};
|
|
|
|
# Enable font-related options for more smoother and consistent experience.
|
|
fonts.enableDefaultFonts = true;
|
|
})
|
|
|
|
(lib.mkIf cfg.audio.enable {
|
|
# Enable the preferred audio workflow.
|
|
hardware.pulseaudio.enable = false;
|
|
security.rtkit.enable = true;
|
|
services.pipewire = {
|
|
enable = true;
|
|
alsa.enable = true;
|
|
alsa.support32Bit = true;
|
|
pulse.enable = true;
|
|
jack.enable = true;
|
|
};
|
|
|
|
# Enable running GNOME apps outside GNOME.
|
|
programs.dconf.enable = true;
|
|
|
|
# Enable MPD-related services.
|
|
services.mpd.enable = true;
|
|
environment.systemPackages = with pkgs; [
|
|
ncmpcpp # Has the worst name for a music client WTF?
|
|
];
|
|
})
|
|
]);
|
|
}
|