refactor(nixosmodules): move desktop configs to a module
This commit is contained in:
parent
fc7d95acfd
commit
1a3ef0605b
7 changed files with 62 additions and 42 deletions
|
@ -11,9 +11,6 @@ with pkgs;
|
||||||
./programs/hyprlock.nix
|
./programs/hyprlock.nix
|
||||||
./programs/hyprshade.nix
|
./programs/hyprshade.nix
|
||||||
./programs/kitty.nix
|
./programs/kitty.nix
|
||||||
./programs/spotifyd.nix
|
|
||||||
./hardware/audio.nix
|
|
||||||
./hardware/bluetooth.nix
|
|
||||||
./programs/waybar.nix
|
./programs/waybar.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
{
|
|
||||||
security.rtkit.enable = true;
|
|
||||||
services.pipewire = {
|
|
||||||
enable = true;
|
|
||||||
extraConfig = { };
|
|
||||||
jack.enable = true;
|
|
||||||
pulse.enable = true;
|
|
||||||
alsa = {
|
|
||||||
enable = true;
|
|
||||||
support32Bit = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
hardware.bluetooth = {
|
|
||||||
enable = true;
|
|
||||||
powerOnBoot = true;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
{ hostname, ... }:
|
|
||||||
{
|
|
||||||
home-manager.users.rafiq.services.spotifyd = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
global = {
|
|
||||||
device_name = "${hostname}";
|
|
||||||
device_type = "computer";
|
|
||||||
zeroconf_port = 5353;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
networking.firewall.allowedTCPPorts = [
|
|
||||||
5353 # spotifyd
|
|
||||||
];
|
|
||||||
networking.firewall.allowedUDPPorts = [
|
|
||||||
5353 # spotifyd
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -1,4 +1,3 @@
|
||||||
{ inputs, ... }:
|
|
||||||
{
|
{
|
||||||
boot-config.bootloader = "systemd-boot";
|
boot-config.bootloader = "systemd-boot";
|
||||||
hardware-config.cpu = "amd";
|
hardware-config.cpu = "amd";
|
||||||
|
@ -7,6 +6,8 @@
|
||||||
fs-config.mountHeliosData = true;
|
fs-config.mountHeliosData = true;
|
||||||
nw-config.wol.enable = true;
|
nw-config.wol.enable = true;
|
||||||
nw-config.wol.interface = "enp12s0";
|
nw-config.wol.interface = "enp12s0";
|
||||||
|
de.enable = true;
|
||||||
|
de.type = "hyprland";
|
||||||
|
|
||||||
fileSystems."/" = {
|
fileSystems."/" = {
|
||||||
device = "/dev/disk/by-uuid/e5005ea6-6c5a-4ab3-9767-ce7772582024";
|
device = "/dev/disk/by-uuid/e5005ea6-6c5a-4ab3-9767-ce7772582024";
|
||||||
|
|
59
modules/nixos/de.nix
Normal file
59
modules/nixos/de.nix
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
moduleName = "de";
|
||||||
|
cfg = config."${moduleName}";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
"${moduleName}" = {
|
||||||
|
enable = lib.mkEnableOption "Enable ${moduleName}.";
|
||||||
|
type = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "";
|
||||||
|
example = "hyprland";
|
||||||
|
description = "What desktop environment should be installed on the host.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable (
|
||||||
|
lib.mkMerge [
|
||||||
|
{
|
||||||
|
# Enable audio and other common config
|
||||||
|
security.rtkit.enable = true;
|
||||||
|
services.pipewire = {
|
||||||
|
enable = true;
|
||||||
|
extraConfig = { };
|
||||||
|
jack.enable = true;
|
||||||
|
pulse.enable = true;
|
||||||
|
alsa = {
|
||||||
|
enable = true;
|
||||||
|
support32Bit = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
hardware.bluetooth = {
|
||||||
|
enable = true;
|
||||||
|
powerOnBoot = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
(lib.mkIf config.hmModules.enable {
|
||||||
|
home-manager.users."${config.nixosModules.mainUser}".services.spotifyd = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
global = {
|
||||||
|
device_name = "${config.nixosModules.hostname}";
|
||||||
|
device_type = "computer";
|
||||||
|
zeroconf_port = 5353;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
networking.firewall.allowedTCPPorts = [ 5353 ];
|
||||||
|
networking.firewall.allowedUDPPorts = [ 5353 ];
|
||||||
|
})
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
|
@ -10,6 +10,7 @@ in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./boot.nix
|
./boot.nix
|
||||||
|
./de.nix
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
./nix-config.nix
|
./nix-config.nix
|
||||||
./gaming.nix
|
./gaming.nix
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue