os/configuration.nix
Timothy DeHerrera 5f7af10bae
shell: add a nixpkgs-compat file
We are now able to pull in the same revision of nixpkgs as listed in
the lock file.
2020-12-27 00:40:12 -07:00

42 lines
1.1 KiB
Nix

# 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;
nixpkgs = toString (import ./nixpkgs-compat.nix);
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
] ++ 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;
}