-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
97 lines (77 loc) · 2.77 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# flake.nix --- the heart of my dotfiles
#
# Author: Henrik Lissner <[email protected]>
# 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/nixpkgs-unstable"; # for packages on the edge
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";
rust-overlay.url = "github:oxalica/rust-overlay";
blender-bin.url = "github:edolstra/nix-warez?dir=blender";
blender-bin.inputs.nixpkgs.follows = "nixpkgs-unstable";
wired.url = "github:Toqozz/wired-notify";
wired.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, wired, ... }:
let
inherit (lib.my) mapModules mapModulesRec mapHosts;
nix_system = builtins.getEnv "NIX_SYSTEM";
system = if nix_system == "" then "x86_64-linux" else nix_system;
mkPkgs = pkgs: extraOverlays: import pkgs {
inherit system;
config.allowUnfree = true; # forgive me Stallman senpai
# Allos some insecure packages
# TODO: potentially need remove all this
config.permittedInsecurePackages = [
"fspy-1.0.3"
];
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 {};
devShell."${system}" =
import ./shell.nix { inherit pkgs; };
templates = {
full = {
path = ./.;
description = "A grossly incandescent nixos config";
};
} // import ./templates;
defaultTemplate = self.templates.full;
defaultApp."${system}" = {
type = "app";
program = ./bin/hey;
};
};
}