From ad17fed0bfacd35230780bc4f949a2dedcb5ae04 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 3 Jan 2024 17:05:54 +0000 Subject: [PATCH] common: profiles: migrate X --- modules/common/profiles/default.nix | 1 + modules/common/profiles/x/default.nix | 27 +++++++++++++++++++++++++++ modules/nixos/default.nix | 1 - modules/nixos/profiles/default.nix | 7 ------- modules/nixos/profiles/x/default.nix | 23 ----------------------- 5 files changed, 28 insertions(+), 31 deletions(-) create mode 100644 modules/common/profiles/x/default.nix delete mode 100644 modules/nixos/profiles/default.nix delete mode 100644 modules/nixos/profiles/x/default.nix diff --git a/modules/common/profiles/default.nix b/modules/common/profiles/default.nix index 034d993..43d5a84 100644 --- a/modules/common/profiles/default.nix +++ b/modules/common/profiles/default.nix @@ -7,5 +7,6 @@ ./gtk ./laptop ./wm + ./x ]; } diff --git a/modules/common/profiles/x/default.nix b/modules/common/profiles/x/default.nix new file mode 100644 index 0000000..907e03c --- /dev/null +++ b/modules/common/profiles/x/default.nix @@ -0,0 +1,27 @@ +{ config, lib, pkgs, type, ... }: +let + cfg = config.my.profiles.x; +in +{ + options.my.profiles.x = with lib; { + enable = mkEnableOption "X profile"; + }; + + config = lib.mkIf cfg.enable (lib.mkMerge [ + (lib.optionalAttrs (type == "home") { + # X configuration + my.home.x.enable = true; + }) + + (lib.optionalAttrs (type == "nixos") { + # Enable the X11 windowing system. + services.xserver.enable = true; + # Nice wallpaper + services.xserver.displayManager.lightdm.background = + let + wallpapers = "${pkgs.plasma5Packages.plasma-workspace-wallpapers}/share/wallpapers"; + in + "${wallpapers}/summer_1am/contents/images/2560x1600.jpg"; + }) + ]); +} diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index 3648631..2eaa2e6 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -5,7 +5,6 @@ imports = [ ./hardware ./home - ./profiles ./programs ./secrets ./services diff --git a/modules/nixos/profiles/default.nix b/modules/nixos/profiles/default.nix deleted file mode 100644 index 6b4db55..0000000 --- a/modules/nixos/profiles/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -# Configuration that spans accross system and home, or are almagations of modules -{ ... }: -{ - imports = [ - ./x - ]; -} diff --git a/modules/nixos/profiles/x/default.nix b/modules/nixos/profiles/x/default.nix deleted file mode 100644 index ea77939..0000000 --- a/modules/nixos/profiles/x/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ config, lib, pkgs, ... }: -let - cfg = config.my.profiles.x; -in -{ - options.my.profiles.x = with lib; { - enable = mkEnableOption "X profile"; - }; - - config = lib.mkIf cfg.enable { - # Enable the X11 windowing system. - services.xserver.enable = true; - # Nice wallpaper - services.xserver.displayManager.lightdm.background = - let - wallpapers = "${pkgs.plasma5Packages.plasma-workspace-wallpapers}/share/wallpapers"; - in - "${wallpapers}/summer_1am/contents/images/2560x1600.jpg"; - - # X configuration - my.home.x.enable = true; - }; -}