2020-10-01 15:46:04 -07:00
|
|
|
# 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 =
|
|
|
|
{
|
2020-10-29 22:39:45 -07:00
|
|
|
# Core dependencies.
|
2021-05-27 21:20:14 -07:00
|
|
|
nixpkgs.url = "nixpkgs/nixos-unstable"; # primary nixpkgs
|
|
|
|
nixpkgs-unstable.url = "nixpkgs/nixpkgs-unstable"; # for packages on the edge
|
2021-01-01 21:22:57 -08:00
|
|
|
home-manager.url = "github:rycee/home-manager/master";
|
2020-10-29 22:39:45 -07:00
|
|
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
2021-01-19 22:30:12 -08:00
|
|
|
agenix.url = "github:ryantm/agenix";
|
|
|
|
agenix.inputs.nixpkgs.follows = "nixpkgs";
|
2020-10-01 15:46:04 -07:00
|
|
|
|
|
|
|
# Extras
|
|
|
|
emacs-overlay.url = "github:nix-community/emacs-overlay";
|
|
|
|
nixos-hardware.url = "github:nixos/nixos-hardware";
|
|
|
|
};
|
|
|
|
|
2021-02-14 11:43:31 -08:00
|
|
|
outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, ... }:
|
2020-10-01 15:46:04 -07:00
|
|
|
let
|
2020-10-29 22:39:45 -07:00
|
|
|
inherit (lib.my) mapModules mapModulesRec mapHosts;
|
2020-10-01 15:46:04 -07:00
|
|
|
|
|
|
|
system = "x86_64-linux";
|
|
|
|
|
|
|
|
mkPkgs = pkgs: extraOverlays: import pkgs {
|
|
|
|
inherit system;
|
|
|
|
config.allowUnfree = true; # forgive me Stallman senpai
|
2021-01-01 21:22:57 -08:00
|
|
|
overlays = extraOverlays ++ (lib.attrValues self.overlays);
|
2020-10-01 15:46:04 -07:00
|
|
|
};
|
2020-10-29 22:39:45 -07:00
|
|
|
pkgs = mkPkgs nixpkgs [ self.overlay ];
|
2021-09-26 04:58:32 -07:00
|
|
|
pkgs' = mkPkgs nixpkgs-unstable [ ];
|
2020-10-29 22:39:45 -07:00
|
|
|
|
|
|
|
lib = nixpkgs.lib.extend
|
|
|
|
(self: super: { my = import ./lib { inherit pkgs inputs; lib = self; }; });
|
2020-10-01 15:46:04 -07:00
|
|
|
in {
|
2020-10-26 02:48:12 -07:00
|
|
|
lib = lib.my;
|
|
|
|
|
2020-10-01 15:46:04 -07:00
|
|
|
overlay =
|
|
|
|
final: prev: {
|
2021-02-14 11:43:31 -08:00
|
|
|
unstable = pkgs';
|
2020-10-29 22:39:45 -07:00
|
|
|
my = self.packages."${system}";
|
2020-10-01 15:46:04 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
overlays =
|
2020-10-26 02:48:12 -07:00
|
|
|
mapModules ./overlays import;
|
2020-10-01 15:46:04 -07:00
|
|
|
|
|
|
|
packages."${system}" =
|
2021-01-01 21:22:57 -08:00
|
|
|
mapModules ./packages (p: pkgs.callPackage p {});
|
2020-10-01 15:46:04 -07:00
|
|
|
|
|
|
|
nixosModules =
|
2021-01-01 21:22:57 -08:00
|
|
|
{ dotfiles = import ./.; } // mapModulesRec ./modules import;
|
2020-10-01 15:46:04 -07:00
|
|
|
|
|
|
|
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; };
|
2021-01-01 21:22:57 -08:00
|
|
|
|
2021-01-19 22:28:49 -08:00
|
|
|
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;
|
2021-01-01 21:22:57 -08:00
|
|
|
};
|
2020-10-01 15:46:04 -07:00
|
|
|
};
|
|
|
|
}
|