2a678d2b75
First step to generalizing this repo. Makes it easier to deploy. Later I may move my host configs to another repo.
74 lines
2 KiB
Nix
74 lines
2 KiB
Nix
# 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.
|
|
# 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.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, ... }:
|
|
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 ];
|
|
pkgs' = mkPkgs nixpkgs-unstable [];
|
|
|
|
lib = nixpkgs.lib.extend
|
|
(self: super: { my = import ./lib { inherit pkgs inputs; lib = self; }; });
|
|
in {
|
|
lib = lib.my;
|
|
|
|
overlay =
|
|
final: prev: {
|
|
unstable = pkgs';
|
|
my = self.packages."${system}";
|
|
};
|
|
|
|
overlays =
|
|
mapModules ./overlays import;
|
|
|
|
packages."${system}" =
|
|
mapModules ./packages (p: pkgs.callPackage p {});
|
|
|
|
nixosModules =
|
|
{ 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;
|
|
};
|
|
}
|