nix-configs/flake.nix

77 lines
2.3 KiB
Nix
Raw Normal View History

2024-04-05 22:04:41 -04:00
{
description = "Chris's system configuration";
inputs = {
nixpkgs.url = "nixpkgs/nixos-23.11";
2024-04-12 21:48:22 -04:00
flake-utils.url = github:numtide/flake-utils;
2024-04-05 22:04:41 -04:00
deploy-rs.url = github:serokell/deploy-rs;
home-manager = {
url = github:nix-community/home-manager/release-23.11;
inputs.nixpkgs.follows = "nixpkgs";
};
};
2024-04-12 21:48:22 -04:00
outputs = inputs@{ self, nixpkgs, flake-utils, home-manager, deploy-rs, ... }:
2024-04-05 22:04:41 -04:00
let
2024-04-12 21:48:22 -04:00
pkgs = import nixpkgs { system = "x86_64-linux"; };
aarch64Pkgs = import nixpkgs { system = "aarch64-linux"; };
deployAarch64Pkgs = import nixpkgs {
system = "aarch64-linux";
overlays = [
deploy-rs.overlay
(self: super: { deploy-rs = { inherit (aarch64Pkgs) deploy-rs; lib = super.deploy-rs.lib; }; })
];
};
deployPkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [
deploy-rs.overlay
(self: super: { deploy-rs = { inherit (pkgs) deploy-rs; lib = super.deploy-rs.lib; }; })
];
};
2024-04-05 22:04:41 -04:00
in
2024-04-12 21:48:22 -04:00
{
nixosConfigurations = {
2024-04-13 14:13:38 -04:00
smolboi = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
2024-04-13 16:30:55 -04:00
modules = [
./systems/smolboi/configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.users.cdombroski = import ./systems/smolboi/home.nix;
}
];
2024-04-13 14:13:38 -04:00
};
2024-04-12 21:48:22 -04:00
orangepihole = nixpkgs.lib.nixosSystem {
2024-04-05 22:04:41 -04:00
system = "aarch64-linux";
modules = [ ./systems/orangepihole/configuration.nix ];
};
};
deploy = {
sshUser = "root";
2024-04-13 09:20:35 -04:00
fastConnection = true;
2024-04-05 22:04:41 -04:00
nodes = {
2024-04-13 14:13:38 -04:00
smolboi = {
hostname = "smolboi";
profiles.system.path = deployPkgs.deploy-rs.lib.activate.nixos self.nixosConfigurations.smolboi;
};
2024-04-05 22:04:41 -04:00
orangepihole = {
hostname = "orangepihole";
2024-04-12 21:48:22 -04:00
profiles.system.path = deployAarch64Pkgs.deploy-rs.lib.activate.nixos self.nixosConfigurations.orangepihole;
2024-04-05 22:04:41 -04:00
};
};
};
2024-04-12 21:48:22 -04:00
} //
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
deployLib = deploy-rs.lib.${system};
in
{
devShells.default = pkgs.mkShell {
buildInputs = [ pkgs.deploy-rs ];
2024-04-12 21:03:16 -04:00
};
2024-04-12 21:48:22 -04:00
checks = deployLib.deployChecks self.deploy;
}
);
2024-04-05 22:04:41 -04:00
}