helm/flake.nix

89 lines
2.5 KiB
Nix
Raw Normal View History

# flake.nix --- the heart of my dotfiles
#
# Author: Henrik Lissner <henrik@lissner.net>
# URL: https://github.com/hlissner/dotfiles
# License: MIT
#
# Welcome to ground zero. Where the whole flake gets set up and all its modules
# are loaded.
{
description = "A grossly incandescent nixos config.";
inputs =
{
# Core dependencies.
nixpkgs.url = "nixpkgs/nixos-unstable"; # primary nixpkgs
nixpkgs-unstable.url = "nixpkgs/master"; # for packages on the edge
nixpkgs-stable.url = "nixpkgs/nixos-20.09"; # for stable packages
home-manager.url = "github:rycee/home-manager/master";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
agenix.url = "github:ryantm/agenix";
agenix.inputs.nixpkgs.follows = "nixpkgs";
# Extras
emacs-overlay.url = "github:nix-community/emacs-overlay";
nixos-hardware.url = "github:nixos/nixos-hardware";
};
outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, nixpkgs-stable, ... }:
let
inherit (lib.my) mapModules mapModulesRec mapHosts;
system = "x86_64-linux";
mkPkgs = pkgs: extraOverlays: import pkgs {
inherit system;
config.allowUnfree = true; # forgive me Stallman senpai
overlays = extraOverlays ++ (lib.attrValues self.overlays);
};
pkgs = mkPkgs nixpkgs [ self.overlay ];
pkgsUnstable = mkPkgs nixpkgs-unstable [];
pkgsStable = mkPkgs nixpkgs-stable [];
lib = nixpkgs.lib.extend
(self: super: { my = import ./lib { inherit pkgs inputs; lib = self; }; });
in {
2020-10-26 02:48:12 -07:00
lib = lib.my;
overlay =
final: prev: {
unstable = pkgsUnstable;
stable = pkgsStable;
my = self.packages."${system}";
};
overlays =
2020-10-26 02:48:12 -07:00
mapModules ./overlays import;
packages."${system}" =
mapModules ./packages (p: pkgs.callPackage p {});
nixosModules =
{ dotfiles = import ./.; } // mapModulesRec ./modules import;
nixosConfigurations =
2021-01-19 22:28:30 -08:00
mapHosts ./hosts {};
2020-12-20 17:09:09 -08:00
devShell."${system}" =
import ./shell.nix { inherit pkgs; };
templates = {
full = {
path = ./.;
description = "A grossly incandescent nixos config";
};
minimal = {
path = ./templates/minimal;
description = "A grossly incandescent and minimal nixos config";
};
};
defaultTemplate = self.templates.minimal;
defaultApp."${system}" = {
type = "app";
program = ./bin/hey;
};
};
}