From 6b1ea56d8b216c316a8072d8d433d32c05e9a899 Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Thu, 8 Aug 2024 07:14:07 +0200 Subject: [PATCH] nixos/cosmic: move overlay and substituters to hosts/vm-cosmic use cosmic-packages overlay --- hosts/vm-cosmic.nix | 10 +++++++++- nix-os/desktopManagers/cosmic.nix | 20 ++------------------ nix-os/displayManagers/cosmic-greeter.nix | 20 ++------------------ 3 files changed, 13 insertions(+), 37 deletions(-) diff --git a/hosts/vm-cosmic.nix b/hosts/vm-cosmic.nix index 00989ab..c842604 100644 --- a/hosts/vm-cosmic.nix +++ b/hosts/vm-cosmic.nix @@ -1,4 +1,4 @@ -{ ... }: +{ inputs, ... }: { imports = [ @@ -6,4 +6,12 @@ ../nix-os/desktopManagers/cosmic.nix ../nix-os/displayManagers/cosmic-greeter.nix ]; + + config = { + nixpkgs.overlays = [(import ../pkgs/overlays/cosmic-packages.nix { inherit inputs; })]; + nix.settings = { + substituters = [ "https://cosmic.cachix.org/" ]; + trusted-public-keys = [ "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" ]; + }; + }; } diff --git a/nix-os/desktopManagers/cosmic.nix b/nix-os/desktopManagers/cosmic.nix index 589ee56..96a1bf3 100644 --- a/nix-os/desktopManagers/cosmic.nix +++ b/nix-os/desktopManagers/cosmic.nix @@ -1,26 +1,10 @@ -{pkgs, lib, ... }: +{ inputs, lib, pkgs, ... }: -let - nixos-cosmic = builtins.fetchGit { - url = "https://github.com/lilyinstarlight/nixos-cosmic.git"; - # rev = "b61e7a0da2fa1d5f05d41e3db6386b2ac5f5079b"; - }; - cosmicPkgsMainDir = builtins.readDir "${nixos-cosmic}/pkgs"; - cosmicPkgsDirs = builtins.filter (v: cosmicPkgsMainDir."${v}" == "directory") (builtins.attrNames cosmicPkgsMainDir); - cosmicPkgsOverlay = final: prev: builtins.listToAttrs ( - builtins.map (v: {name = v; value = final.callPackage "${nixos-cosmic}/pkgs/${v}/package.nix" {};}) cosmicPkgsDirs - ); -in { imports = [ - "${nixos-cosmic}/nixos/cosmic/module.nix" + "${inputs.cosmic-modules}/nixos/cosmic/module.nix" ]; config = { services.desktopManager.cosmic.enable = true; - nixpkgs.overlays = [ cosmicPkgsOverlay ]; - nix.settings = { - substituters = [ "https://cosmic.cachix.org/" ]; - trusted-public-keys = [ "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" ]; - }; }; } diff --git a/nix-os/displayManagers/cosmic-greeter.nix b/nix-os/displayManagers/cosmic-greeter.nix index da54a6d..e39ab93 100644 --- a/nix-os/displayManagers/cosmic-greeter.nix +++ b/nix-os/displayManagers/cosmic-greeter.nix @@ -1,26 +1,10 @@ -{pkgs, lib, ... }: +{ inputs, lib, pkgs, ... }: -let - nixos-cosmic = builtins.fetchGit { - url = "https://github.com/lilyinstarlight/nixos-cosmic.git"; - # rev = "b61e7a0da2fa1d5f05d41e3db6386b2ac5f5079b"; - }; - cosmicPkgsMainDir = builtins.readDir "${nixos-cosmic}/pkgs"; - cosmicPkgsDirs = builtins.filter (v: cosmicPkgsMainDir."${v}" == "directory") (builtins.attrNames cosmicPkgsMainDir); - cosmicPkgsOverlay = final: prev: builtins.listToAttrs ( - builtins.map (v: {name = v; value = final.callPackage "${nixos-cosmic}/pkgs/${v}/package.nix" {};}) cosmicPkgsDirs - ); -in { imports = [ - "${nixos-cosmic}/nixos/cosmic-greeter/module.nix" + "${inputs.cosmic-modules}/nixos/cosmic-greeter/module.nix" ]; config = { services.displayManager.cosmic-greeter.enable = true; - nixpkgs.overlays = [ cosmicPkgsOverlay ]; - nix.settings = { - substituters = [ "https://cosmic.cachix.org/" ]; - trusted-public-keys = [ "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" ]; - }; }; }