mirror of
https://codeberg.org/muon/home.git
synced 2025-12-06 08:07:45 +00:00
Add hyprland
Add unfree
This commit is contained in:
parent
d676358f1a
commit
31ffdc94e8
18 changed files with 185 additions and 44 deletions
|
|
@ -1,5 +1,3 @@
|
|||
{ pkgs, lib, ... }: {
|
||||
config = {
|
||||
networking.networkmanager.enable = true;
|
||||
};
|
||||
networking.networkmanager.enable = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
{ pkgs, lib, config, ... }: {
|
||||
options = {
|
||||
mods.user.name = lib.mkOption {
|
||||
default = "muon";
|
||||
description = "username of the main system user";
|
||||
};
|
||||
options.mods.user.name = lib.mkOption {
|
||||
default = "muon";
|
||||
description = "username of the main system user";
|
||||
};
|
||||
|
||||
config = {
|
||||
|
|
|
|||
|
|
@ -4,5 +4,8 @@
|
|||
./system
|
||||
./desktop
|
||||
./theme
|
||||
|
||||
# </3
|
||||
./unfree
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,26 @@
|
|||
{ pkgs, lib, config, ... }: {
|
||||
{ pkgs, lib, config, ... }:
|
||||
let
|
||||
cfg = config.mods.desktop;
|
||||
in {
|
||||
imports = [
|
||||
./xorg.nix
|
||||
./sound.nix
|
||||
];
|
||||
|
||||
options = {
|
||||
mods.desktop.enable = lib.mkEnableOption "enables graphical desktop environment";
|
||||
options.mods.desktop = {
|
||||
enable = lib.mkEnableOption "enables graphical desktop environment";
|
||||
wayland.enable = lib.mkEnableOption "enables hyprland";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.mods.desktop.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
mods.xorg.enable = true;
|
||||
mods.sound.enable = true;
|
||||
mods.desktop.wayland.enable = lib.mkDefault false;
|
||||
programs.hyprland = if cfg.wayland.enable then {
|
||||
enable = true;
|
||||
xwayland.enable = true;
|
||||
} else {
|
||||
enable = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
{ pkgs, lib, config, ... }: {
|
||||
options = {
|
||||
mods.sound.enable = lib.mkEnableOption "enables sound";
|
||||
};
|
||||
options.mods.sound.enable = lib.mkEnableOption "enables sound";
|
||||
|
||||
config = lib.mkIf config.mods.sound.enable {
|
||||
services.pipewire = {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
{ pkgs, lib, config, ... }: {
|
||||
options = {
|
||||
mods.xorg.enable = lib.mkEnableOption "enables xorg";
|
||||
};
|
||||
options.mods.xorg.enable = lib.mkEnableOption "enables xorg";
|
||||
|
||||
config = lib.mkIf config.mods.xorg.enable {
|
||||
services.xserver.enable = true;
|
||||
|
|
|
|||
19
modules/nixos/unfree/default.nix
Normal file
19
modules/nixos/unfree/default.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
let
|
||||
cfg = config.mods.unfree;
|
||||
mkPackages = mod:
|
||||
if cfg.${mod}.enable then
|
||||
cfg.${mod}.packages else [];
|
||||
|
||||
in {
|
||||
imports = [
|
||||
./steam.nix
|
||||
./nvidia.nix
|
||||
];
|
||||
|
||||
nixpkgs.config.allowUnfreePredicate = pkg:
|
||||
builtins.elem (lib.getName pkg) (
|
||||
(mkPackages "steam") ++
|
||||
(mkPackages "nvidia")
|
||||
);
|
||||
}
|
||||
42
modules/nixos/unfree/nvidia.nix
Normal file
42
modules/nixos/unfree/nvidia.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
let
|
||||
cfg = config.mods.unfree.nvidia;
|
||||
in {
|
||||
options.mods.unfree.nvidia = {
|
||||
enable = lib.mkEnableOption {
|
||||
default = false;
|
||||
description = "enables proprietary nvidia drivers";
|
||||
};
|
||||
packages = lib.mkOption {
|
||||
default = [ "nvidia-x11" ];
|
||||
description = "unfree packages";
|
||||
};
|
||||
driver = lib.mkOption {
|
||||
default = "stable";
|
||||
description = "nvidiaPackages driver kernel package";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# nixos.wiki/wiki/Nvidia
|
||||
hardware.opengl = {
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
driSupport32Bit = true;
|
||||
};
|
||||
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
|
||||
powerManagement.enable = false;
|
||||
powerManagement.finegrained = false;
|
||||
|
||||
open = false;
|
||||
nvidiaSettings = false;
|
||||
|
||||
package = config.boot.kernelPackages.nvidiaPackages."${cfg.driver}";
|
||||
};
|
||||
};
|
||||
}
|
||||
24
modules/nixos/unfree/steam.nix
Normal file
24
modules/nixos/unfree/steam.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ pkgs, lib, config, ... }: {
|
||||
options.mods.unfree.steam = {
|
||||
enable = lib.mkEnableOption {
|
||||
default = false;
|
||||
description = "enables proprietary steam software";
|
||||
};
|
||||
packages = lib.mkOption {
|
||||
default = [
|
||||
"steam"
|
||||
"steam-original"
|
||||
"steam-run"
|
||||
];
|
||||
description = "unfree packages";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.mods.unfree.steam.enable {
|
||||
# nixos.wiki/wiki/Steam
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue