diff --git a/hosts/default.nix b/hosts/default.nix index daf0b0d..19284b1 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -13,7 +13,7 @@ let usr = { inherit utils; }; util = utils; nixosPersistence = "${impermanence}/nixos.nix"; - nixpkgsFlake = nixpkgs; + inputs = inputs; }; modules = diff --git a/profiles/core.nix b/profiles/core.nix index 4da1643..5d41c58 100644 --- a/profiles/core.nix +++ b/profiles/core.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, util, nixpkgsFlake, ... }: +{ config, lib, pkgs, util, inputs, ... }: let inherit (util) pkgBin; inherit (lib) fileContents mkIf; @@ -86,20 +86,36 @@ in myip = "${pkgs.dnsutils}/bin/dig +short myip.opendns.com @208.67.222.222 2>&1"; + + sys-repl = + "source /etc/set-environment && ${nixBin} repl ${./..}/repl.nix"; }; }; - nix = { - package = pkgs.nixFlakes; - autoOptimiseStore = true; - optimise.automatic = true; - allowedUsers = [ "@wheel" ]; - trustedUsers = [ "root" "@wheel" ]; - extraOptions = '' - experimental-features = nix-command flakes ca-references - ''; - registry.nixpkgs.flake = nixpkgsFlake; - }; + nix = + let + flakes = lib.filterAttrs (name: value: value ? outputs) inputs; + + nixPath = lib.mapAttrsToList + (name: _: "${name}=${inputs.${name}}") + flakes; + + registry = builtins.mapAttrs + (name: v: { flake = v; }) + flakes; + in + { + package = pkgs.nixFlakes; + autoOptimiseStore = true; + optimise.automatic = true; + allowedUsers = [ "@wheel" ]; + trustedUsers = [ "root" "@wheel" ]; + extraOptions = '' + experimental-features = nix-command flakes ca-references + ''; + nixPath = nixPath ++ [ "repl=${./..}/repl.nix" ]; + inherit registry; + }; # security = { # hideProcessInformation = true; diff --git a/repl.nix b/repl.nix new file mode 100644 index 0000000..833ea26 --- /dev/null +++ b/repl.nix @@ -0,0 +1,5 @@ +let + sysFlake = builtins.getFlake (toString ./.); + nixpkgs = import { }; +in +{ inherit sysFlake; } // nixpkgs