devos/flake.nix
2022-07-11 16:12:51 +02:00

144 lines
4.1 KiB
Nix

{
description = "A highly structured configuration database.";
nixConfig.extra-experimental-features = "nix-command flakes";
inputs =
{
nixos.url = "github:nixos/nixpkgs/nixos-22.05";
latest.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
digga.url = "github:divnix/digga";
digga.inputs.nixpkgs.follows = "nixos";
digga.inputs.nixpkgs-unstable.follows = "latest";
digga.inputs.latest.follows = "latest";
digga.inputs.nixlib.follows = "nixos";
digga.inputs.home-manager.follows = "home";
digga.inputs.deploy.follows = "deploy";
home.url = "github:nix-community/home-manager/master";
# home.url = "path:/home/mae/home-manager";
home.inputs.nixpkgs.follows = "latest";
home.inputs.utils.follows = "flake-utils";
darwin.url = "github:LnL7/nix-darwin";
darwin.inputs.nixpkgs.follows = "nixos";
deploy.url = "github:input-output-hk/deploy-rs";
deploy.inputs.nixpkgs.follows = "nixos";
deploy.inputs.fenix.follows = "fenix";
agenix.url = "github:ryantm/agenix";
agenix.inputs.nixpkgs.follows = "nixos";
nvfetcher.url = "github:berberman/nvfetcher";
nvfetcher.inputs.nixpkgs.follows = "nixos";
nvfetcher.inputs.flake-utils.follows = "flake-utils";
naersk.url = "github:nmattia/naersk";
naersk.inputs.nixpkgs.follows = "nixos";
#peerix.url = "github:cid-chan/peerix";
peerix.url = "github:MaeIsBad/peerix/bad/timeout";
peerix.inputs.nixpkgs.follows = "nixos";
nixos-hardware.url = "github:nixos/nixos-hardware";
fenix.url = "github:nix-community/fenix";
# fenix.inputs.nixpkgs.follows = "nixos";
};
outputs =
{ self
, digga
, nixos
, home
, nixos-hardware
, agenix
, fenix
, nvfetcher
, deploy
, peerix
, ...
} @ inputs:
digga.lib.mkFlake
{
inherit self inputs;
channelsConfig = { allowUnfree = true; };
channels = {
nixos = {
imports = [ (digga.lib.importOverlays ./overlays) ];
overlays = [
agenix.overlay
nvfetcher.overlay
./pkgs/default.nix
fenix.overlay
peerix.overlay
];
};
latest = { };
};
lib = import ./lib { lib = digga.lib // nixos.lib; };
sharedOverlays = [
(final: prev: {
__dontExport = true;
lib = prev.lib.extend (lfinal: lprev: {
our = self.lib;
});
})
];
nixos = {
hostDefaults = {
system = "x86_64-linux";
channelName = "nixos";
imports = [ (digga.lib.importExportableModules ./modules) ];
modules = [
{ lib.our = self.lib; }
digga.nixosModules.bootstrapIso
digga.nixosModules.nixConfig
home.nixosModules.home-manager
agenix.nixosModules.age
peerix.nixosModules.peerix
];
};
imports = [ (digga.lib.importHosts ./hosts) ];
hosts = {
/* set host specific properties here */
NixOS = { };
};
importables = rec {
profiles = digga.lib.rakeLeaves ./profiles // {
users = digga.lib.rakeLeaves ./users;
};
suites = (import ./suites) { inherit profiles; };
};
};
home = {
imports = [ (digga.lib.importExportableModules ./users/modules) ];
modules = [ ];
importables = rec {
profiles = digga.lib.rakeLeaves ./users/profiles;
suites = with profiles; rec {
base = [ direnv git ];
};
};
users = {
nixos = { suites, ... }: { imports = suites.base; };
}; # digga.lib.importers.rakeLeaves ./users/hm;
};
homeConfigurations = digga.lib.mkHomeConfigurations self.nixosConfigurations;
deploy.nodes = digga.lib.mkDeployNodes self.nixosConfigurations { };
}
;
}