depot/flake.nix

86 lines
2.4 KiB
Nix
Raw Normal View History

2021-06-05 23:59:06 +03:00
{
description = "Private Void system configurations";
inputs = {
2021-12-02 21:52:45 +02:00
nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.11";
2021-06-05 23:59:06 +03:00
2021-08-23 20:27:12 +03:00
nix-super.url = "git+https://git.privatevoid.net/max/nix-super";
nix-super.inputs.nix.follows = "nix-super-unstable-repin";
nix-super-unstable-repin.url = "github:NixOS/nix";
nix-super-unstable-repin.inputs.nixpkgs.follows = "nixpkgs";
2021-06-05 23:59:06 +03:00
home-manager.url = "github:nix-community/home-manager/master";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
2021-11-25 21:09:15 +02:00
deploy-rs.url = "git+https://git.privatevoid.net/max/deploy-rs";
2021-06-05 23:59:06 +03:00
agenix.url = "github:ryantm/agenix";
agenix.inputs.nixpkgs.follows = "nixpkgs";
2021-10-16 21:24:25 +03:00
2021-12-11 17:00:09 +02:00
nar-serve.url = "github:numtide/nar-serve/v0.5.0";
2021-10-16 21:24:25 +03:00
nar-serve.inputs.nixpkgs.follows = "nixpkgs";
2022-01-11 21:58:10 +02:00
dream2nix.url = "github:nix-community/dream2nix";
dream2nix.inputs.nixpkgs.follows = "nixpkgs";
2021-06-05 23:59:06 +03:00
};
outputs = { self, nixpkgs, home-manager, ... }@inputs:
let
inherit (nixpkgs) lib;
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
};
deploy-rs-lib = inputs.deploy-rs.lib.${system};
agenixModule = inputs.agenix.nixosModules.age;
aspect = import ./modules inputs;
hosts = import ./hosts;
2021-10-16 18:00:47 +03:00
specialArgs = {
inherit inputs hosts aspect;
toolsets = import ./tools;
};
2021-06-05 23:59:06 +03:00
mkNixOS' = lib: name: lib.nixosSystem {
inherit system;
inherit specialArgs;
2021-10-16 18:00:47 +03:00
modules = [ hosts."${name}".nixos ./tools/inject.nix ];
2021-06-05 23:59:06 +03:00
};
mkNixOS = mkNixOS' lib;
in {
nixosModules = aspect.modules;
nixosConfigurations = lib.genAttrs [
"VEGAS"
] mkNixOS;
2021-06-05 23:59:06 +03:00
deploy.nodes = with deploy-rs-lib; {
VEGAS = {
hostname = "vegas.backbone.privatevoid.net";
profiles.system = {
user = "root";
sshUser = "deploy";
path = activate.nixos self.nixosConfigurations.VEGAS;
};
};
2021-06-05 23:59:06 +03:00
};
packages.${system} = import ./packages {
inherit pkgs inputs;
};
2022-01-11 21:58:10 +02:00
apps.${system} = {
dream2nix = inputs.dream2nix.defaultApp.${system};
};
2021-06-05 23:59:06 +03:00
defaultApp.${system} = {
type = "app";
program = self.packages.${system}.flake-installer.outPath;
};
hydraJobs = {
systems.${system} = lib.mapAttrs (_: x: x.config.system.build.toplevel) self.nixosConfigurations;
packages = self.packages;
};
};
}