From 2a678d2b75f298e6c201bea39ed0dc57a8ffbfc5 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 2 Jan 2021 00:22:57 -0500 Subject: [PATCH] Register as flake template First step to generalizing this repo. Makes it easier to deploy. Later I may move my host configs to another repo. --- flake.nix | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/flake.nix b/flake.nix index e6a0fe24..ac57b4bf 100644 --- a/flake.nix +++ b/flake.nix @@ -13,11 +13,10 @@ inputs = { # Core dependencies. - # Two inputs so I can track them separately at different rates. - nixpkgs.url = "nixpkgs/master"; + # Two inputs so I can track them independently + nixpkgs.url = "nixpkgs/master"; nixpkgs-unstable.url = "nixpkgs/master"; - - home-manager.url = "github:rycee/home-manager/master"; + home-manager.url = "github:rycee/home-manager/master"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; # Extras @@ -27,7 +26,6 @@ outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, ... }: let - inherit (lib) attrValues; inherit (lib.my) mapModules mapModulesRec mapHosts; system = "x86_64-linux"; @@ -35,10 +33,10 @@ mkPkgs = pkgs: extraOverlays: import pkgs { inherit system; config.allowUnfree = true; # forgive me Stallman senpai - overlays = extraOverlays ++ (attrValues self.overlays); + overlays = extraOverlays ++ (lib.attrValues self.overlays); }; pkgs = mkPkgs nixpkgs [ self.overlay ]; - uPkgs = mkPkgs nixpkgs-unstable []; + pkgs' = mkPkgs nixpkgs-unstable []; lib = nixpkgs.lib.extend (self: super: { my = import ./lib { inherit pkgs inputs; lib = self; }; }); @@ -47,7 +45,7 @@ overlay = final: prev: { - unstable = uPkgs; + unstable = pkgs'; my = self.packages."${system}"; }; @@ -55,17 +53,21 @@ mapModules ./overlays import; packages."${system}" = - mapModules ./packages - (p: pkgs.callPackage p {}); + mapModules ./packages (p: pkgs.callPackage p {}); nixosModules = - { dotfiles = import ./.; } - // mapModulesRec ./modules import; + { dotfiles = import ./.; } // mapModulesRec ./modules import; nixosConfigurations = mapHosts ./hosts { inherit system; }; devShell."${system}" = import ./shell.nix { inherit pkgs; }; + + templates.hey = { + path = ./.; + description = "A grossly incandescent nixos framework"; + }; + defaultTemplate = self.templates.hey; }; }