helm/flake.nix

68 lines
1.9 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
nixos.url = "nixpkgs/nixos-20.09";
nixos-unstable.url = "nixpkgs/nixos-unstable";
home-manager.url = "github:rycee/home-manager/master";
home-manager.inputs.nixpkgs.follows = "nixos-unstable";
# Extras
emacs-overlay.url = "github:nix-community/emacs-overlay";
nixos-hardware.url = "github:nixos/nixos-hardware";
};
outputs = inputs @ { self, nixos, nixos-unstable, home-manager, ... }:
let
inherit (builtins) baseNameOf;
inherit (lib) nixosSystem mkIf removeSuffix attrNames attrValues;
2020-10-26 02:48:12 -07:00
inherit (lib.my) dotFilesDir mapModules mapModulesRec mapHosts;
system = "x86_64-linux";
lib = nixos.lib.extend
2020-10-26 02:48:12 -07:00
(self: super: { my = import ./lib { inherit pkgs inputs; lib = self; }; });
mkPkgs = pkgs: extraOverlays: import pkgs {
inherit system;
config.allowUnfree = true; # forgive me Stallman senpai
overlays = extraOverlays ++ (attrValues self.overlays);
};
2020-10-26 02:48:12 -07:00
pkgs = mkPkgs nixos [ self.overlay ];
unstable = mkPkgs nixos-unstable [];
in {
2020-10-26 02:48:12 -07:00
lib = lib.my;
overlay =
final: prev: {
inherit unstable;
user = self.packages."${system}";
};
overlays =
2020-10-26 02:48:12 -07:00
mapModules ./overlays import;
packages."${system}" =
2020-10-26 02:48:12 -07:00
mapModules ./packages
(p: pkgs.callPackage p {});
nixosModules =
2020-10-26 02:48:12 -07:00
{ dotfiles = import ./.; }
// mapModulesRec ./modules import;
nixosConfigurations =
2020-10-26 02:48:12 -07:00
mapHosts ./hosts { inherit system; };
};
}