2023-01-25 12:21:02 +01:00
|
|
|
{
|
2023-06-19 14:35:24 +02:00
|
|
|
description = "Smart Energy Monitor";
|
2023-02-20 23:03:41 +01:00
|
|
|
|
2023-01-25 12:21:02 +01:00
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
|
2023-02-20 23:03:41 +01:00
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
|
2023-01-25 12:21:02 +01:00
|
|
|
flake-compat = {
|
|
|
|
url = "github:edolstra/flake-compat";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
|
2023-02-20 23:03:41 +01:00
|
|
|
home-manager = {
|
|
|
|
url = "github:nix-community/home-manager";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
|
|
|
darwin = {
|
|
|
|
url = "github:lnl7/nix-darwin/master";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
|
|
|
nixos-generators = {
|
|
|
|
url = "github:nix-community/nixos-generators";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
|
|
|
impermanence.url = "github:nix-community/impermanence";
|
|
|
|
|
|
|
|
nixos-hardware.url = "github:nixos/nixos-hardware";
|
2023-01-25 12:21:02 +01:00
|
|
|
|
|
|
|
pre-commit-hooks = {
|
|
|
|
url = "github:cachix/pre-commit-hooks.nix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.flake-utils.follows = "flake-utils";
|
|
|
|
};
|
2023-02-20 23:03:41 +01:00
|
|
|
|
|
|
|
deploy-rs.url = "github:serokell/deploy-rs";
|
2023-01-25 12:21:02 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = {
|
2023-02-20 23:03:41 +01:00
|
|
|
self,
|
|
|
|
darwin,
|
2023-01-25 12:21:02 +01:00
|
|
|
nixpkgs,
|
2023-02-20 23:03:41 +01:00
|
|
|
deploy-rs,
|
2023-01-25 12:21:02 +01:00
|
|
|
flake-utils,
|
2023-02-20 23:03:41 +01:00
|
|
|
nixos-hardware,
|
|
|
|
nixos-generators,
|
2023-01-25 12:21:02 +01:00
|
|
|
...
|
|
|
|
} @ inputs:
|
2023-02-20 23:03:41 +01:00
|
|
|
flake-utils.lib.eachSystem ["aarch64-linux" "x86_64-linux"] (localSystem: {
|
|
|
|
checks = import ./nix/checks.nix inputs localSystem;
|
|
|
|
|
|
|
|
devShells.default = import ./nix/shell.nix inputs localSystem;
|
|
|
|
|
|
|
|
packages = {
|
|
|
|
default = self.packages.x86_64-linux.gateway-vm;
|
|
|
|
|
|
|
|
gateway-vm = nixos-generators.nixosGenerate {
|
|
|
|
pkgs = import nixpkgs {inherit localSystem;};
|
|
|
|
system = "x86_64-linux";
|
|
|
|
format = "vm";
|
|
|
|
modules = [
|
|
|
|
./software/gateway
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
gateway-raspi = nixos-generators.nixosGenerate {
|
|
|
|
pkgs = import nixpkgs {inherit localSystem;};
|
|
|
|
system = "aarch64-linux";
|
|
|
|
format = "sd-aarch64";
|
|
|
|
modules = [
|
|
|
|
./software/gateway
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
nixosConfigurations.gateway = nixpkgs.lib.nixosSystem {
|
|
|
|
system = "aarch64-linux";
|
|
|
|
modules = [
|
|
|
|
./software/gateway
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2023-01-25 12:21:02 +01:00
|
|
|
pkgs = import nixpkgs {
|
2023-02-20 23:03:41 +01:00
|
|
|
inherit localSystem;
|
2023-01-25 12:21:02 +01:00
|
|
|
config.allowUnfree = true;
|
|
|
|
config.allowAliases = true;
|
2023-02-20 23:03:41 +01:00
|
|
|
config.allowUnsupportedSystem = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
deploy.nodes.gateway = {
|
2023-06-19 14:35:24 +02:00
|
|
|
hostname = "sem";
|
2023-02-20 23:03:41 +01:00
|
|
|
fastConnection = true;
|
|
|
|
profiles = {
|
|
|
|
system = {
|
2023-06-19 14:35:24 +02:00
|
|
|
sshUser = "sem";
|
2023-02-20 23:03:41 +01:00
|
|
|
path =
|
|
|
|
deploy-rs.lib.aarch64-linux.activate.nixos
|
|
|
|
self.nixosConfigurations.gateway;
|
|
|
|
user = "root";
|
|
|
|
};
|
|
|
|
};
|
2023-01-25 12:21:02 +01:00
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|