forked from jethrokuan/nix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configuration.nix
39 lines (36 loc) · 1.01 KB
/
configuration.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
# this file is an impure recreation of the flake profile currently deployed
# based on the systems hostname. The purpose is so tools which do not yet have
# flake support (e.g `nixos-option`), can work as expected.
{ lib, ... }:
let
inherit (builtins) attrNames readDir;
hostname = lib.fileContents /etc/hostname;
host = "/etc/nixos/hosts/${hostname}.nix";
config =
if (builtins.pathExists host) then
[ host ]
else
[ /etc/nixos/hosts/NixOS.nix ];
in
{
imports = (import ./modules/list.nix) ++ [
"${
builtins.fetchTarball
"https://github.com/rycee/home-manager/archive/master.tar.gz"
}/nixos"
/etc/nixos/profiles/core.nix
] ++ config;
networking.hostName = hostname;
nix.nixPath = [
"nixpkgs=${<nixpkgs>}"
"nixos-config=/etc/nixos/configuration.nix"
"nixpkgs-overlays=/etc/nixos/overlays"
];
nixpkgs.overlays =
let
overlays = map
(name: import (./overlays + "/${name}"))
(attrNames (readDir ./overlays));
in
overlays;
}