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 =
|
|
|
|
{
|
|
|
|
# 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;
|
2020-10-01 15:46:04 -07:00
|
|
|
|
|
|
|
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; }; });
|
2020-10-01 15:46:04 -07:00
|
|
|
|
|
|
|
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 ];
|
2020-10-01 15:46:04 -07:00
|
|
|
unstable = mkPkgs nixos-unstable [];
|
|
|
|
in {
|
2020-10-26 02:48:12 -07:00
|
|
|
lib = lib.my;
|
|
|
|
|
2020-10-01 15:46:04 -07:00
|
|
|
overlay =
|
|
|
|
final: prev: {
|
|
|
|
inherit unstable;
|
|
|
|
user = self.packages."${system}";
|
|
|
|
};
|
|
|
|
|
|
|
|
overlays =
|
2020-10-26 02:48:12 -07:00
|
|
|
mapModules ./overlays import;
|
2020-10-01 15:46:04 -07:00
|
|
|
|
|
|
|
packages."${system}" =
|
2020-10-26 02:48:12 -07:00
|
|
|
mapModules ./packages
|
2020-10-01 15:46:04 -07:00
|
|
|
(p: pkgs.callPackage p {});
|
|
|
|
|
|
|
|
nixosModules =
|
2020-10-26 02:48:12 -07:00
|
|
|
{ dotfiles = import ./.; }
|
|
|
|
// mapModulesRec ./modules import;
|
2020-10-01 15:46:04 -07:00
|
|
|
|
|
|
|
nixosConfigurations =
|
2020-10-26 02:48:12 -07:00
|
|
|
mapHosts ./hosts { inherit system; };
|
2020-10-01 15:46:04 -07:00
|
|
|
};
|
|
|
|
}
|