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.
|
|
|
|
{ lib, ... }:
|
|
|
|
let
|
2020-01-02 01:16:38 +01:00
|
|
|
hostname = lib.fileContents /etc/hostname;
|
|
|
|
host = "/etc/nixos/hosts/${hostname}.nix";
|
|
|
|
config =
|
|
|
|
if (builtins.pathExists host)
|
|
|
|
then [ host ]
|
|
|
|
else [ /etc/nixos/hosts/NixOS.nix ];
|
2019-12-18 01:29:20 +01:00
|
|
|
in
|
|
|
|
{
|
2020-01-02 00:23:57 +01:00
|
|
|
imports = builtins.attrValues (import ./modules) ++ [
|
2019-12-18 01:29:20 +01:00
|
|
|
"${builtins.fetchTarball https://github.com/rycee/home-manager/archive/master.tar.gz}/nixos"
|
|
|
|
/etc/nixos/profiles/core.nix
|
2020-01-02 01:16:38 +01:00
|
|
|
] ++ config;
|
|
|
|
|
2019-12-18 01:29:20 +01:00
|
|
|
|
2020-01-02 01:16:38 +01:00
|
|
|
networking.hostName = hostname;
|
2019-12-18 01:29:20 +01:00
|
|
|
nix.nixPath = [
|
|
|
|
"nixpkgs=${<nixpkgs>}"
|
|
|
|
"nixos-config=/etc/nixos/configuration.nix"
|
|
|
|
];
|
2020-01-02 00:23:57 +01:00
|
|
|
|
|
|
|
nixpkgs.overlays = lib.singleton (import ./pkgs);
|
2019-12-18 01:29:20 +01:00
|
|
|
}
|