Skip to content

Commit

Permalink
Moved keyremapper and gui into the user and system module folders res…
Browse files Browse the repository at this point in the history
…pectively.
  • Loading branch information
Tygo-van-den-Hurk committed Jul 24, 2024
1 parent 01ef4c2 commit da09f92
Show file tree
Hide file tree
Showing 36 changed files with 252 additions and 262 deletions.
3 changes: 3 additions & 0 deletions home-manager/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{

home-manager.useUserPackages = true;
5 changes: 5 additions & 0 deletions home-manager/get.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
let

people = (import ./list.nix);

in
4 changes: 4 additions & 0 deletions home-manager/list.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# an alphabetical list of the users of home manager this repository:
[
./tygo-van-den-hurk
]
13 changes: 4 additions & 9 deletions modules/default.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
## imports all the modules in this directory as specified by the machine-settings.
#! breaking this file could break multiple systems. Only remove modules if you are sure they are unused by all systems.
arguments @ { config, pkgs, lib, machine-settings, programs, input, ... } : let

in {

arguments @ { config, pkgs, lib, machine-settings, input, ... } : ( builtins.trace "Loading: ${toString ./.}..." {

imports = [
./system-level
./user-level
./common

#| Modules to load a sub module from
( import ./gui arguments )
( import ./key-remapper arguments )
];
}

})

31 changes: 0 additions & 31 deletions modules/gui/default.nix

This file was deleted.

20 changes: 0 additions & 20 deletions modules/gui/gnome/default.nix

This file was deleted.

7 changes: 0 additions & 7 deletions modules/gui/hyprland/README.md

This file was deleted.

104 changes: 0 additions & 104 deletions modules/gui/hyprland/default.nix

This file was deleted.

39 changes: 0 additions & 39 deletions modules/gui/i3wm/default.nix

This file was deleted.

16 changes: 0 additions & 16 deletions modules/gui/kde/default.nix

This file was deleted.

1 change: 1 addition & 0 deletions modules/system-level/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ arguments @ { config, pkgs, lib, machine-settings, ... } : ( builtins.trace "Loa

imports = [
./gaming
./gui
./local-ai
./nvidia
./onedrive
Expand Down
File renamed without changes.
40 changes: 40 additions & 0 deletions modules/system-level/gui/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## imports the right GUI as specified by the machine-settings.
#! breaking this file could break multiple systems. Only remove modules if you are sure they are unused by all systems.
arguments @ { config, pkgs, lib, machine-settings, ... } : let

module-settings = machine-settings.system.modules.gui;

in let

enabled-GUIs = (lib.attrNames ( lib.attrsets.concatMapAttrs ( GUI-name: GUI-settings:
if (! builtins.isAttrs GUI-settings) then (
abort (
"The GUI attribute \"${GUI-name}\" found in machine settings is not a SET, "
+ "but a \"${builtins.typeOf GUI-settings}\". This is not expected, or allowed." )
) else if (GUI-settings.enable == true) then {
"${GUI-name}" = GUI-settings.enable;
} else {}
) module-settings ));

amount-of-GUIs-enabled = builtins.trace "MY TRACE: ${builtins.toJSON enabled-GUIs}" (builtins.length enabled-GUIs);

in ( if ( amount-of-GUIs-enabled > 1 ) then (

let
sperator = ("\n\t - ");
combined-list = (builtins.concatStringsSep sperator enabled-GUIs);
enabled-GUIs-string = (sperator + combined-list);
list-enabled-GUIs-string = ("Enabled GUIs:${enabled-GUIs-string}\nYou can only pick one GUI.");
in abort ( "More then 1 GUI was selected." + list-enabled-GUIs-string)

) else if ( amount-of-GUIs-enabled > 0 ) then ( builtins.trace "Loading: ${toString ./.}..." {

imports = [
./i3wm
./gnome
./kde
./hyprland
];

}) else {})

File renamed without changes.
18 changes: 18 additions & 0 deletions modules/system-level/gui/gnome/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Defines Gnome settings.

arguments @ { config, pkgs, lib, machine-settings, ... } : let

this-module-is-enabled = machine-settings.system.modules.gui.gnome.enable;

in ( if ( this-module-is-enabled == true ) then (builtins.trace "Loading: ${toString ./.}..." {

#| required settings
services.xserver.enable = lib.mkDefault true;
services.xserver.displayManager.gdm.enable = lib.mkDefault true;
services.xserver.desktopManager.gnome.enable = lib.mkDefault true;

#| Patches
hardware.pulseaudio.enable = lib.mkDefault true;
services.pipewire.enable = lib.mkDefault true;

}) else {})
10 changes: 10 additions & 0 deletions modules/system-level/gui/hyprland/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Hyperland


## Resources

Here are some resources you could use to configure Hyprland:

| Resource | Title | Link |
|----------|--------------------------------------|---------------------------------------------------------|
| Vimjoyer | Nixos and Hyprland - Best Match Ever | [YouTube](https://www.youtube.com/watch?v=61wGzIv12Ds) |
39 changes: 39 additions & 0 deletions modules/system-level/gui/hyprland/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## Defines Hyperland settings.
#! This is just for non-NVIDIA users. If you have an NVIDIA GPU, you must add some patches.
arguments @ { config, pkgs, lib, machine-settings, programs, ... } : let

module-settings = machine-settings.system.modules.gui.hyprland;

in ( if ( module-settings.enable == true ) then ( builtins.trace "Loading: ${toString ./.}..." {

imports = [ ./nvidia-patches.nix ./extra-packages.nix ];

services.xserver.enable = lib.mkDefault true;
services.xserver.libinput.touchpad.naturalScrolling = lib.mkDefault true;
services.xserver.displayManager.sddm.enable = lib.mkDefault true;
services.xserver.displayManager.sddm.wayland.enable = lib.mkDefault true;

programs.hyprland = {
enable = lib.mkDefault true;
xwayland.enable = lib.mkDefault true;
};

environment.sessionVariables.NIXOS_OZONE_WL = lib.mkDefault "1"; # hint electron apps to use wayland

# xdg.portal = { # Portals
# enable = true;
# extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
# };

sound.enable = lib.mkDefault true;

security.rtkit.enable = lib.mkDefault true;

services.pipewire = {
enable = lib.mkDefault true;
alsa.enable = lib.mkDefault true;
alsa.support32Bit = lib.mkDefault true;
pulse.enable = lib.mkDefault true;
};

}) else {} )
Loading

0 comments on commit da09f92

Please sign in to comment.