1
1
mirror of https://github.com/divnix/digga.git synced 2024-12-23 16:11:51 +03:00

fix classicalDevos example

This commit is contained in:
David Arnold 2021-06-20 01:51:59 -05:00 committed by Parthiv Seetharaman
parent 25bf8eefe2
commit 3d0dfa9797

View File

@ -1,92 +1,117 @@
{ pkgs, lib }: {
let description = "A DevOS example. And also a digga test bed.";
self = lib.mkFlake {
self = self // { inputs =
outPath = toString ./.; {
inputs = { nixos.url = "nixpkgs/release-21.05";
nixos = pkgs.input; latest.url = "nixpkgs";
latest = pkgs.input; digga = {
url = "path:../../";
inputs.nixpkgs.follows = "nixos";
}; };
darwin.url = "github:LnL7/nix-darwin";
darwin.inputs.nixpkgs.follows = "latest";
home.url = "github:nix-community/home-manager";
home.inputs.nixpkgs.follows = "nixos";
agenix.url = "github:ryantm/agenix";
agenix.inputs.nixpkgs.follows = "latest";
nixos-hardware.url = "github:nixos/nixos-hardware";
pkgs.url = "path:./pkgs";
pkgs.inputs.nixpkgs.follows = "nixos";
}; };
channelsConfig = { allowUnfree = true; }; outputs =
{ self
, pkgs
, digga
, nixos
, home
, nixos-hardware
, agenix
, ...
} @ inputs:
digga.lib.mkFlake {
inherit self inputs;
channelsConfig = { allowUnfree = true; };
channels = {
nixos = {
imports = [ (digga.lib.importers.overlays ./overlays) ];
overlays = [
# mimicking an external overlay
(final: prev: { i-do-exists-before-local-overlays-accessor-me = prev.hello; })
./pkgs/default.nix
pkgs.overlay # for `srcs`
agenix.overlay
];
};
latest = { };
};
lib = import ./lib { lib = digga.lib // nixos.lib; };
sharedOverlays = [
(final: prev: {
__dontExport = true;
lib = prev.lib.extend (lfinal: lprev: {
our = self.lib;
});
})
];
channels = {
nixos = { nixos = {
imports = [ (lib.importers.overlays ./overlays) ]; hostDefaults = {
overlays = [ system = "x86_64-linux";
# mimicing an external overlay channelName = "nixos";
(final: prev: { i-do-exists-before-local-overlays-accessor-me = prev.hello; }) imports = [ (digga.lib.importers.modules ./modules) ];
]; externalModules = [
}; { lib.our = self.lib; }
latest = { }; home.nixosModules.home-manager
}; agenix.nixosModules.age
];
lib = lib.makeExtensible (self: { });
outputsBuilder = channels: {
checks = {
hostBuild = assert self.nixosConfigurations ? "com.example.myhost";
self.nixosConfigurations.NixOS.config.system.build.toplevel;
overlays-order = channels.nixos.pkgs.i-was-accessed-without-error;
# At least check that those build.
# They are usually tested against additional checks with
nixosModules = self.nixosModules;
};
};
sharedOverlays = [
(final: prev: {
ourlib = self.lib;
})
];
devshell.modules = [ ./devshell.toml ];
nixos = {
hostDefaults = {
system = "x86_64-linux";
channelName = "nixos";
imports = [ (lib.importers.modules ./modules) ];
externalModules = [
{ lib.our = self.lib; }
./modules/customBuilds.nix # avoid exporting
];
};
imports = [ (lib.importers.hosts ./hosts) ];
hosts = {
/* set host specific properties here */
NixOS = { };
};
importables = rec {
profiles = lib.importers.rakeLeaves ./profiles // {
users = lib.importers.rakeLeaves ./users;
}; };
suites = with profiles; {
base = [ cachix core users.nixos users.root ]; imports = [ (digga.lib.importers.hosts ./hosts) ];
hosts = {
/* set host specific properties here */
NixOS = { };
};
importables = rec {
profiles = digga.lib.importers.rakeLeaves ./profiles // {
users = digga.lib.importers.rakeLeaves ./users;
};
suites = with profiles; rec {
base = [ core users.nixos users.root ];
};
}; };
}; };
};
home = { home = {
imports = [ (lib.importers.modules ./user/modules) ]; imports = [ (digga.lib.importers.modules ./users/modules) ];
externalModules = [ ]; externalModules = [ ];
importables = rec { importables = rec {
profiles = lib.importers.rakeLeaves ./profiles; profiles = digga.lib.importers.rakeLeaves ./users/profiles;
suites = with profiles; { suites = with profiles; rec {
base = [ direnv git ]; base = [ direnv git ];
};
}; };
}; };
};
deploy.nodes = lib.mkDeployNodes self.nixosConfigurations { }; devshell.externalModules = { pkgs, ... }: {
packages = [ pkgs.agenix ];
};
#defaultTemplate = self.templates.flk; homeConfigurations = digga.lib.mkHomeConfigurations self.nixosConfigurations;
templates.flk.path = ./.;
templates.flk.description = "flk template"; deploy.nodes = digga.lib.mkDeployNodes self.nixosConfigurations { };
};
in defaultTemplate = self.templates.flk;
self templates.flk.path = ./.;
templates.flk.description = "flk template";
}
;
}