feat: improve flake structure

This commit is contained in:
Felix Schröter 2021-08-08 17:44:59 +02:00
parent 969be6b552
commit b30e96b595
No known key found for this signature in database
GPG key ID: 910ACB9F6BD26F58
6 changed files with 91 additions and 74 deletions

17
modules/flakeDefaults.nix Normal file
View file

@ -0,0 +1,17 @@
{ pkgs, lib, self, inputs, ... }:
let
flakes = lib.filterAttrs (name: value: value ? outputs) inputs;
nixRegistry = builtins.mapAttrs (name: v: { flake = v; }) flakes;
in {
# Let 'nixos-version --json' know about the Git revision
# of this flake.
system.configurationRevision = lib.mkIf (self ? rev) self.rev;
nix = {
extraOptions = "experimental-features = nix-command flakes";
nixPath = lib.mapAttrsToList (n: v: "${n}=${v}") flakes;
registry = nixRegistry;
package = pkgs.nixUnstable;
};
}