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.
This commit is contained in:
parent
177a7eec6f
commit
2a678d2b75
22
flake.nix
22
flake.nix
|
@ -13,10 +13,9 @@
|
||||||
inputs =
|
inputs =
|
||||||
{
|
{
|
||||||
# Core dependencies.
|
# Core dependencies.
|
||||||
# Two inputs so I can track them separately at different rates.
|
# Two inputs so I can track them independently
|
||||||
nixpkgs.url = "nixpkgs/master";
|
nixpkgs.url = "nixpkgs/master";
|
||||||
nixpkgs-unstable.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";
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
|
@ -27,7 +26,6 @@
|
||||||
|
|
||||||
outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, ... }:
|
outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, ... }:
|
||||||
let
|
let
|
||||||
inherit (lib) attrValues;
|
|
||||||
inherit (lib.my) mapModules mapModulesRec mapHosts;
|
inherit (lib.my) mapModules mapModulesRec mapHosts;
|
||||||
|
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
@ -35,10 +33,10 @@
|
||||||
mkPkgs = pkgs: extraOverlays: import pkgs {
|
mkPkgs = pkgs: extraOverlays: import pkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
config.allowUnfree = true; # forgive me Stallman senpai
|
config.allowUnfree = true; # forgive me Stallman senpai
|
||||||
overlays = extraOverlays ++ (attrValues self.overlays);
|
overlays = extraOverlays ++ (lib.attrValues self.overlays);
|
||||||
};
|
};
|
||||||
pkgs = mkPkgs nixpkgs [ self.overlay ];
|
pkgs = mkPkgs nixpkgs [ self.overlay ];
|
||||||
uPkgs = mkPkgs nixpkgs-unstable [];
|
pkgs' = mkPkgs nixpkgs-unstable [];
|
||||||
|
|
||||||
lib = nixpkgs.lib.extend
|
lib = nixpkgs.lib.extend
|
||||||
(self: super: { my = import ./lib { inherit pkgs inputs; lib = self; }; });
|
(self: super: { my = import ./lib { inherit pkgs inputs; lib = self; }; });
|
||||||
|
@ -47,7 +45,7 @@
|
||||||
|
|
||||||
overlay =
|
overlay =
|
||||||
final: prev: {
|
final: prev: {
|
||||||
unstable = uPkgs;
|
unstable = pkgs';
|
||||||
my = self.packages."${system}";
|
my = self.packages."${system}";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -55,17 +53,21 @@
|
||||||
mapModules ./overlays import;
|
mapModules ./overlays import;
|
||||||
|
|
||||||
packages."${system}" =
|
packages."${system}" =
|
||||||
mapModules ./packages
|
mapModules ./packages (p: pkgs.callPackage p {});
|
||||||
(p: pkgs.callPackage p {});
|
|
||||||
|
|
||||||
nixosModules =
|
nixosModules =
|
||||||
{ dotfiles = import ./.; }
|
{ dotfiles = import ./.; } // mapModulesRec ./modules import;
|
||||||
// mapModulesRec ./modules import;
|
|
||||||
|
|
||||||
nixosConfigurations =
|
nixosConfigurations =
|
||||||
mapHosts ./hosts { inherit system; };
|
mapHosts ./hosts { inherit system; };
|
||||||
|
|
||||||
devShell."${system}" =
|
devShell."${system}" =
|
||||||
import ./shell.nix { inherit pkgs; };
|
import ./shell.nix { inherit pkgs; };
|
||||||
|
|
||||||
|
templates.hey = {
|
||||||
|
path = ./.;
|
||||||
|
description = "A grossly incandescent nixos framework";
|
||||||
|
};
|
||||||
|
defaultTemplate = self.templates.hey;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue