os/configuration.nix

42 lines
1.2 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.
2020-01-10 07:10:59 +00:00
{ lib, pkgs, ... }:
let
2020-01-06 07:07:26 +00:00
inherit (builtins) attrNames readDir;
2020-01-02 00:16:38 +00:00
hostname = lib.fileContents /etc/hostname;
host = "/etc/nixos/hosts/${hostname}.nix";
2020-01-04 05:06:31 +00:00
config = if (builtins.pathExists host) then
[ host ]
else
[ /etc/nixos/hosts/NixOS.nix ];
in {
imports = (import ./modules) ++ [
2020-01-04 05:06:31 +00:00
"${
builtins.fetchTarball
"https://github.com/rycee/home-manager/archive/master.tar.gz"
}/nixos"
/etc/nixos/profiles/core.nix
2020-01-02 00:16:38 +00:00
] ++ config;
networking.hostName = hostname;
nix.nixPath = [
"nixpkgs=${<nixpkgs>}"
"nixos-config=/etc/nixos/configuration.nix"
"nixpkgs-overlays=/etc/nixos/overlays"
];
2020-01-01 23:23:57 +00:00
2020-01-06 07:07:26 +00:00
nixpkgs.overlays = let
overlays = map (name: import (./overlays + "/${name}"))
(attrNames (readDir ./overlays));
2020-01-10 07:10:59 +00:00
in overlays ++ [
(final: prev: {
nur = import (builtins.fetchTarball
"https://github.com/nix-community/NUR/archive/master.tar.gz") {
inherit pkgs;
};
})
];
}