Don't use nix-channels
This commit is contained in:
parent
32ba100ee4
commit
280fdeeab0
17 changed files with 229 additions and 82 deletions
33
lib.nix
Normal file
33
lib.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
findImport = name:
|
||||
let
|
||||
localpath = ./.. + "/${name}";
|
||||
importpath = ./imports + "/${name}";
|
||||
in
|
||||
if builtins.pathExists localpath then
|
||||
localpath
|
||||
else if builtins.pathExists importpath then
|
||||
(import importpath)
|
||||
else (abort "couldn't find import ${name}");
|
||||
|
||||
mkSystem = { nixpkgs, system ? "x86_64-linux", rev ? "git", extraModules ? [ ], ... }:
|
||||
let
|
||||
pkgs = import (nixpkgs) {
|
||||
inherit (machine.config.nixpkgs) config overlays;
|
||||
};
|
||||
nixPath = pkgs.runCommand "nix-path"
|
||||
{ } ''
|
||||
mkdir -p $out
|
||||
ln -s "${nixpkgs}" $out/nixpkgs
|
||||
'';
|
||||
machine = import "${nixpkgs}/nixos/lib/eval-config.nix" {
|
||||
inherit system;
|
||||
modules = [
|
||||
({ ... }: {
|
||||
nix.nixPath = [ "${nixPath}" ];
|
||||
})
|
||||
] ++ extraModules;
|
||||
};
|
||||
in
|
||||
machine;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue