1
1
mirror of https://github.com/divnix/digga.git synced 2024-12-24 00:21:47 +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";
}; };
outputs =
{ self
, pkgs
, digga
, nixos
, home
, nixos-hardware
, agenix
, ...
} @ inputs:
digga.lib.mkFlake {
inherit self inputs;
channelsConfig = { allowUnfree = true; }; channelsConfig = { allowUnfree = true; };
channels = { channels = {
nixos = { nixos = {
imports = [ (lib.importers.overlays ./overlays) ]; imports = [ (digga.lib.importers.overlays ./overlays) ];
overlays = [ overlays = [
# mimicing an external overlay # mimicking an external overlay
(final: prev: { i-do-exists-before-local-overlays-accessor-me = prev.hello; }) (final: prev: { i-do-exists-before-local-overlays-accessor-me = prev.hello; })
./pkgs/default.nix
pkgs.overlay # for `srcs`
agenix.overlay
]; ];
}; };
latest = { }; latest = { };
}; };
lib = lib.makeExtensible (self: { }); lib = import ./lib { lib = digga.lib // nixos.lib; };
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 = [ sharedOverlays = [
(final: prev: { (final: prev: {
ourlib = self.lib; __dontExport = true;
lib = prev.lib.extend (lfinal: lprev: {
our = self.lib;
});
}) })
]; ];
devshell.modules = [ ./devshell.toml ];
nixos = { nixos = {
hostDefaults = { hostDefaults = {
system = "x86_64-linux"; system = "x86_64-linux";
channelName = "nixos"; channelName = "nixos";
imports = [ (lib.importers.modules ./modules) ]; imports = [ (digga.lib.importers.modules ./modules) ];
externalModules = [ externalModules = [
{ lib.our = self.lib; } { lib.our = self.lib; }
./modules/customBuilds.nix # avoid exporting home.nixosModules.home-manager
agenix.nixosModules.age
]; ];
}; };
imports = [ (lib.importers.hosts ./hosts) ]; imports = [ (digga.lib.importers.hosts ./hosts) ];
hosts = { hosts = {
/* set host specific properties here */ /* set host specific properties here */
NixOS = { }; NixOS = { };
}; };
importables = rec { importables = rec {
profiles = lib.importers.rakeLeaves ./profiles // { profiles = digga.lib.importers.rakeLeaves ./profiles // {
users = lib.importers.rakeLeaves ./users; users = digga.lib.importers.rakeLeaves ./users;
}; };
suites = with profiles; { suites = with profiles; rec {
base = [ cachix core users.nixos users.root ]; 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;
deploy.nodes = digga.lib.mkDeployNodes self.nixosConfigurations { };
defaultTemplate = self.templates.flk;
templates.flk.path = ./.; templates.flk.path = ./.;
templates.flk.description = "flk template"; templates.flk.description = "flk template";
};
in }
self ;
}