From 98129881a19e7aa7cb545fef3ab3a1c0e9156e2b Mon Sep 17 00:00:00 2001 From: materus Date: Tue, 5 Mar 2024 12:46:21 +0100 Subject: [PATCH] config: add flake registry option --- configurations/profile/common/nixpkgs.nix | 72 ++++++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-) diff --git a/configurations/profile/common/nixpkgs.nix b/configurations/profile/common/nixpkgs.nix index 36e4f44..32df578 100644 --- a/configurations/profile/common/nixpkgs.nix +++ b/configurations/profile/common/nixpkgs.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, materusArg, ... }: +{ config, pkgs, lib, materusArg, materusCfg, ... }: let mkBoolOpt = default: description: lib.mkOption { inherit default; @@ -12,6 +12,7 @@ in { options.materus.profile.nixpkgs.enable = mkBoolOpt false "Enable materus nixpkgs config"; options.materus.profile.nixpkgs.enableOverlays = mkBoolOpt (cfg.enable) "Enable materus overlays"; + options.materus.profile.nix.enableRegistry = mkBoolOpt (!materusCfg.isHm) "Enable materus nix registry"; config.nixpkgs.config = lib.mkIf cfg.enable{ allowUnfree = lib.mkDefault true; @@ -19,4 +20,73 @@ in firefox.enablePlasmaBrowserIntegration = true; }; config.nixpkgs.overlays = lib.mkIf cfg.enableOverlays [materusArg.cfg.configInputs.emacs-overlay.overlay]; + + + config.nix.registry = lib.mkIf config.materus.profile.nix.enableRegistry { + nixpkgs-stable = { + from = { type = "indirect"; id = "nixpkgs-stable"; }; + flake = materusCfg.materusFlake.inputs.nixpkgs-stable; + }; + nixpkgs-unstable = { + from = { type = "indirect"; id = "nixpkgs-unstable"; }; + flake = materusCfg.materusFlake.inputs.nixpkgs; + }; + + nixpkgs = { + from = { type = "indirect"; id = "nixpkgs"; }; + flake = materusCfg.configInputs.nixpkgs; + }; + + emacs-overlay = { + from = { type = "indirect"; id = "emacs-overlay"; }; + flake = materusCfg.configInputs.emacs-overlay; + }; + + flake-utils = { + from = { type = "indirect"; id = "flake-utils"; }; + flake = materusCfg.configInputs.flake-utils; + }; + + nixos-hardware = { + from = { type = "indirect"; id = "nixos-hardware"; }; + flake = materusCfg.configInputs.nixos-hardware; + }; + + nixerus = { + from = { type = "indirect"; id = "nixerus"; }; + flake = materusCfg.configInputs.nixerus; + }; + + devshell = { + from = { type = "indirect"; id = "devshell"; }; + flake = materusCfg.configInputs.devshell; + }; + + home-manager = { + from = { type = "indirect"; id = "home-manager"; }; + flake = materusCfg.configInputs.home-manager; + }; + + sops-nix = { + from = { type = "indirect"; id = "sops-nix"; }; + flake = materusCfg.configInputs.sops-nix; + }; + + base16 = { + from = { type = "indirect"; id = "base16"; }; + flake = materusCfg.configInputs.base16; + }; + + git-agecrypt = { + from = { type = "indirect"; id = "git-agecrypt"; }; + flake = materusCfg.configInputs.git-agecrypt; + }; + + nur = { + from = { type = "indirect"; id = "nur"; }; + flake = materusCfg.configInputs.nur; + }; + + + }; }