2019-12-18 01:29:20 +01:00
|
|
|
# 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.
|
2020-01-11 05:55:09 +01:00
|
|
|
{ lib, ... }:
|
2019-12-18 01:29:20 +01:00
|
|
|
let
|
2020-01-06 08:07:26 +01:00
|
|
|
inherit (builtins) attrNames readDir;
|
|
|
|
|
2020-01-02 01:16:38 +01:00
|
|
|
hostname = lib.fileContents /etc/hostname;
|
|
|
|
host = "/etc/nixos/hosts/${hostname}.nix";
|
2020-01-04 06:06:31 +01:00
|
|
|
config = if (builtins.pathExists host) then
|
|
|
|
[ host ]
|
|
|
|
else
|
|
|
|
[ /etc/nixos/hosts/NixOS.nix ];
|
|
|
|
in {
|
2020-01-05 00:40:16 +01:00
|
|
|
imports = (import ./modules) ++ [
|
2020-01-04 06:06:31 +01:00
|
|
|
"${
|
|
|
|
builtins.fetchTarball
|
|
|
|
"https://github.com/rycee/home-manager/archive/master.tar.gz"
|
|
|
|
}/nixos"
|
2019-12-18 01:29:20 +01:00
|
|
|
/etc/nixos/profiles/core.nix
|
2020-01-02 01:16:38 +01:00
|
|
|
] ++ config;
|
|
|
|
|
|
|
|
networking.hostName = hostname;
|
2020-01-06 08:01:00 +01:00
|
|
|
nix.nixPath = [
|
|
|
|
"nixpkgs=${<nixpkgs>}"
|
|
|
|
"nixos-config=/etc/nixos/configuration.nix"
|
|
|
|
"nixpkgs-overlays=/etc/nixos/overlays"
|
|
|
|
];
|
2020-01-02 00:23:57 +01:00
|
|
|
|
2020-01-06 08:07:26 +01:00
|
|
|
nixpkgs.overlays = let
|
|
|
|
overlays = map (name: import (./overlays + "/${name}"))
|
|
|
|
(attrNames (readDir ./overlays));
|
2020-01-11 05:55:09 +01:00
|
|
|
in overlays;
|
2019-12-18 01:29:20 +01:00
|
|
|
}
|