devos/flake.nix

149 lines
4.4 KiB
Nix
Raw Permalink Normal View History

2019-12-03 06:18:30 +01:00
{
2019-12-05 09:36:15 +01:00
description = "A highly structured configuration database.";
2021-12-06 20:14:40 +01:00
nixConfig.extra-experimental-features = "nix-command flakes";
inputs =
{
nixos.url = "github:nixos/nixpkgs/nixos-22.05";
latest.url = "github:nixos/nixpkgs/nixos-unstable";
2021-04-02 04:10:24 +02:00
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/release-22.05";
2022-07-03 01:06:34 +02:00
# home.url = "path:/home/mae/home-manager";
home.inputs.nixpkgs.follows = "latest";
2022-06-08 12:28:15 +02:00
home.inputs.utils.follows = "flake-utils";
2021-03-02 04:30:47 +01:00
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";
2021-04-02 04:10:24 +02:00
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";
2022-07-11 16:04:56 +02:00
#peerix.url = "github:cid-chan/peerix";
peerix.url = "github:MaeIsBad/peerix/bad/timeout";
2022-06-16 19:22:10 +02:00
peerix.inputs.nixpkgs.follows = "nixos";
2021-03-02 04:30:47 +01:00
nixos-hardware.url = "github:nixos/nixos-hardware";
fenix.url = "github:nix-community/fenix";
2022-07-03 01:06:34 +02:00
# fenix.inputs.nixpkgs.follows = "nixos";
2022-07-25 18:19:54 +02:00
pwnix.url = "git+https://im.badat.dev/bad/pwnix.git";
pwnix.inputs.nixpkgs.follows = "nixos";
};
outputs =
{ self
, digga
, nixos
, home
, nixos-hardware
, agenix
, fenix
, nvfetcher
, deploy
2022-06-16 19:22:10 +02:00
, peerix
, ...
} @ inputs:
2021-07-16 23:01:25 +02:00
digga.lib.mkFlake
{
inherit self inputs;
channelsConfig = { allowUnfree = true; };
channels = {
nixos = {
2021-07-21 01:33:45 +02:00
imports = [ (digga.lib.importOverlays ./overlays) ];
2021-07-16 23:01:25 +02:00
overlays = [
2022-09-01 17:27:11 +02:00
# fenix.overlay breaks the cache, because it uses the system nixpkgs
(_: super: let pkgs = fenix.inputs.nixpkgs.legacyPackages.${super.system}; in fenix.overlay pkgs pkgs)
2021-07-16 23:01:25 +02:00
agenix.overlay
nvfetcher.overlay
./pkgs/default.nix
2022-06-16 19:22:10 +02:00
peerix.overlay
2021-07-16 23:01:25 +02:00
];
};
latest = { };
2021-07-16 23:01:25 +02:00
};
2021-07-16 23:01:25 +02:00
lib = import ./lib { lib = digga.lib // nixos.lib; };
2021-07-16 23:01:25 +02:00
sharedOverlays = [
(final: prev: {
__dontExport = true;
lib = prev.lib.extend (lfinal: lprev: {
our = self.lib;
});
})
];
2021-04-22 05:44:15 +02:00
nixos = {
2021-07-16 23:01:25 +02:00
hostDefaults = {
system = "x86_64-linux";
channelName = "nixos";
imports = [ (digga.lib.importExportableModules ./modules) ];
modules = [
2021-07-16 23:01:25 +02:00
{ lib.our = self.lib; }
digga.nixosModules.bootstrapIso
2021-07-16 23:01:25 +02:00
digga.nixosModules.nixConfig
home.nixosModules.home-manager
agenix.nixosModules.age
2022-06-16 19:22:10 +02:00
peerix.nixosModules.peerix
2021-07-16 23:01:25 +02:00
];
};
2021-07-21 01:33:45 +02:00
imports = [ (digga.lib.importHosts ./hosts) ];
2021-07-16 23:01:25 +02:00
hosts = {
/* set host specific properties here */
NixOS = { };
2021-05-27 19:41:55 +02:00
};
2021-07-16 23:01:25 +02:00
importables = rec {
2021-07-21 01:33:45 +02:00
profiles = digga.lib.rakeLeaves ./profiles // {
users = digga.lib.rakeLeaves ./users;
2021-07-16 23:01:25 +02:00
};
suites = (import ./suites) { inherit profiles; };
2021-05-27 19:41:55 +02:00
};
2021-04-22 05:44:15 +02:00
};
2021-07-16 23:01:25 +02:00
home = {
imports = [ (digga.lib.importExportableModules ./users/modules) ];
modules = [ ];
2021-07-16 23:01:25 +02:00
importables = rec {
2021-07-21 01:33:45 +02:00
profiles = digga.lib.rakeLeaves ./users/profiles;
2021-07-16 23:01:25 +02:00
suites = with profiles; rec {
base = [ direnv git ];
};
2021-05-27 19:41:55 +02:00
};
2021-07-16 23:01:25 +02:00
users = {
nixos = { suites, ... }: { imports = suites.base; };
}; # digga.lib.importers.rakeLeaves ./users/hm;
2021-04-22 05:44:15 +02:00
};
2021-07-16 23:01:25 +02:00
homeConfigurations = digga.lib.mkHomeConfigurations self.nixosConfigurations;
2021-07-16 23:01:25 +02:00
deploy.nodes = digga.lib.mkDeployNodes self.nixosConfigurations { };
2021-07-16 23:01:25 +02:00
}
2021-04-22 05:44:15 +02:00
;
2019-12-03 06:18:30 +01:00
}