commit 61e5bd24ee690d25623b8245177d8360813f283c
parent 315c9c10cab2edf9bc0f2e4a2288c0d5601d2233
Author: Francesco Saccone <francesco@francescosaccone.com>
Date: Mon, 14 Apr 2025 17:20:26 +0200
refactor: divide 'wayland' module in 'ly' and 'sway' modules
Signed-off-by: Francesco Saccone <francesco@francescosaccone.com>
Diffstat:
5 files changed, 60 insertions(+), 37 deletions(-)
diff --git a/hosts/laptop/default.nix b/hosts/laptop/default.nix
@@ -10,6 +10,9 @@
doas = {
enable = true;
};
+ ly = {
+ enable = true;
+ };
monero = {
enable = true;
mining = {
@@ -27,10 +30,10 @@
openssh.agent = {
enable = true;
};
- tlp = {
+ sway = {
enable = true;
};
- wayland = {
+ tlp = {
enable = true;
};
};
diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix
@@ -6,10 +6,11 @@
./darkhttpd
./doas
./git
+ ./ly
./monero
./networkmanager
./openssh
+ ./sway
./tlp
- ./wayland
];
}
diff --git a/modules/nixos/ly/default.nix b/modules/nixos/ly/default.nix
@@ -0,0 +1,25 @@
+{
+ lib,
+ options,
+ config,
+ pkgs,
+ ...
+}:
+{
+ options.modules.ly = {
+ enable = lib.mkOption {
+ description = "Whether to enable Ly display manager.";
+ default = false;
+ type = lib.types.bool;
+ };
+ };
+
+ config = lib.mkIf config.modules.ly.enable {
+ services.displayManager = {
+ ly = {
+ enable = true;
+ package = pkgs.ly;
+ };
+ };
+ };
+}
diff --git a/modules/nixos/sway/default.nix b/modules/nixos/sway/default.nix
@@ -0,0 +1,28 @@
+{
+ lib,
+ options,
+ config,
+ pkgs,
+ ...
+}:
+{
+ options.modules.sway = {
+ enable = lib.mkOption {
+ description = "Whether to enable Sway.";
+ default = false;
+ type = lib.types.bool;
+ };
+ };
+
+ config = lib.mkIf config.modules.sway.enable {
+ services.displayManager = {
+ defaultSession = "Sway";
+ };
+
+ programs.sway = {
+ enable = true;
+ package = pkgs.sway;
+ extraPackages = lib.mkForce [ ];
+ };
+ };
+}
diff --git a/modules/nixos/wayland/default.nix b/modules/nixos/wayland/default.nix
@@ -1,34 +0,0 @@
-{
- lib,
- options,
- config,
- pkgs,
- ...
-}:
-{
- options.modules.wayland = {
- enable = lib.mkOption {
- description = ''
- Whether to enable Ly and Sway, effectively enabling Wayland.
- '';
- default = false;
- type = lib.types.bool;
- };
- };
-
- config = lib.mkIf config.modules.wayland.enable {
- services.displayManager = {
- defaultSession = "Sway";
- ly = {
- enable = true;
- package = pkgs.ly;
- };
- };
-
- programs.sway = {
- enable = true;
- package = pkgs.sway;
- extraPackages = lib.mkForce [ ];
- };
- };
-}