From 6316fffeb1241ff6efd60e8234182263cec553f7 Mon Sep 17 00:00:00 2001 From: "RingOfStorms (Joshua Bell)" Date: Thu, 10 Oct 2024 14:24:28 -0500 Subject: [PATCH] update imports --- flake.nix | 5 ++--- hosts/gpdPocket3/configuration.nix | 2 +- modules/de_cosmic.nix | 12 +++++------- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/flake.nix b/flake.nix index 62e10f2..011174d 100644 --- a/flake.nix +++ b/flake.nix @@ -51,6 +51,7 @@ { self, nypkgs, + cosmic, joe_nixpkgs, joe_home-manager, gpdPocket3_nixpkgs, @@ -89,9 +90,6 @@ inherit user; nixpkgs = gpdPocket3_nixpkgs; home-manager = gpdPocket3_home-manager; - # There is no way to support top level conditional imports in modules using that module's options... - # so for now I have this hack until I want to make this more broad - uses_cosmic = true; }; } { @@ -136,6 +134,7 @@ modules = [ ./hosts/_common/configuration.nix + cosmic.nixosModules.default ] ++ ylib.umport { path = lib.fileset.maybeMissing ./modules; diff --git a/hosts/gpdPocket3/configuration.nix b/hosts/gpdPocket3/configuration.nix index 79e45ee..eda018b 100644 --- a/hosts/gpdPocket3/configuration.nix +++ b/hosts/gpdPocket3/configuration.nix @@ -27,7 +27,7 @@ # ./stupid-keyboard-2.nix ]; - my_modules.de_cosmic.enable = true; + mods.de_cosmic.enable = true; # machine specific configuration # ============================== diff --git a/modules/de_cosmic.nix b/modules/de_cosmic.nix index 76df9e3..2de8164 100644 --- a/modules/de_cosmic.nix +++ b/modules/de_cosmic.nix @@ -7,27 +7,25 @@ }: with lib; let - # name = "de_cosmic"; - # cfg = config.my_modules.${name}; + name = "de_cosmic"; + cfg = config.mods.${name}; in { options = { - my_modules.de_cosmic = { + mods.${name} = { enable = mkEnableOption (lib.mdDoc "Enable COSMIC desktop environment"); }; }; - # Import the module from nix flake https://github.com/lilyinstarlight/nixos-cosmic - imports = optional settings.uses_cosmic cosmic.nixosModules.default; - - config = mkIf config.my_modules.de_cosmic.enable { + config = mkIf cfg.enable { # Use cosmic binary cache nix.settings = { substituters = [ "https://cosmic.cachix.org/" ]; trusted-public-keys = [ "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" ]; }; + # Enable cosmic services.desktopManager.cosmic.enable = true; services.displayManager.cosmic-greeter.enable = true; };