ark/configuration.nix

42 lines
1.1 KiB
Nix
Raw Normal View History

# 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-06 10:07:26 +03:00
inherit (builtins) attrNames readDir;
nixpkgs = toString (import ./nixpkgs-compat.nix);
2020-01-02 03:16:38 +03:00
hostname = lib.fileContents /etc/hostname;
host = "/etc/nixos/hosts/${hostname}.nix";
2020-07-31 07:17:28 +03:00
config =
if (builtins.pathExists host) then
[ host ]
else
[ /etc/nixos/hosts/NixOS.nix ];
in
{
2020-06-14 21:30:40 +03:00
imports = (import ./modules/list.nix) ++ [
2020-01-04 08:06:31 +03:00
"${
builtins.fetchTarball
2020-07-31 07:17:28 +03:00
"https://github.com/rycee/home-manager/archive/master.tar.gz"
}/nixos"
2020-12-15 02:54:42 +03:00
/etc/nixos/profiles/core
2020-01-02 03:16:38 +03:00
] ++ config;
networking.hostName = hostname;
nix.nixPath = [
"nixpkgs=${nixpkgs}"
"nixos-config=/etc/nixos/configuration.nix"
"nixpkgs-overlays=/etc/nixos/overlays"
];
2020-01-02 02:23:57 +03:00
2020-07-31 07:17:28 +03:00
nixpkgs.overlays =
let
overlays = map
(name: import (./overlays + "/${name}"))
(attrNames (readDir ./overlays));
in
overlays;
}