-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake-def.nix
61 lines (53 loc) · 1.94 KB
/
flake-def.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
{
description = "NixOS configuration";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-20.03";
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:rycee/home-manager";
emacs.url = "github:nix-community/emacs-overlay";
hardware.url = "github:NixOS/nixos-hardware";
};
outputs = inputs: {
nixosConfigurations.nixos = {
hostname = let
system = "x86_64-linux";
pkgs = inputs.nixpkgs.legacyPackages.${system};
inherit (inputs.nixpkgs) lib;
# Things in this set are passed to modules and accessible
# in the top-level arguments (e.g. `{ pkgs, lib, inputs, ... }:`).
specialArgs = {
inherit inputs;
};
hm-nixos-as-super = { config, ... }: {
# Submodules have merge semantics, making it possible to amend
# the `home-manager.users` submodule for additional functionality.
options.home-manager.users = lib.mkOption {
type = lib.types.attrsOf (lib.types.submoduleWith {
modules = [ ];
# Makes specialArgs available to Home Manager modules as well.
specialArgs = specialArgs // {
# Allow accessing the parent NixOS configuration.
super = config;
};
});
};
};
modules = [
{
nixpkgs.overlays = [ inputs.emacs.overlay ];
#system.configurationRevision =
# if self ? rev
# then self.rev
# else throw "Refusing to build from a dirty Git tree!";
}
inputs.hardware.nixosModules.lenovo-thinkpad-x220
(import ./hosts/nixos)
inputs.home.nixosModules.home-manager
(import ./modules/core.nix)
inputs.nixpkgs.nixosModules.notDetected
hm-nixos-as-super
];
in lib.nixosSystem { inherit system modules specialArgs; };
};
};
}