122 lines
3.8 KiB
Nix
122 lines
3.8 KiB
Nix
{
|
|
description = "Chris's system configuration";
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
deploy-rs = {
|
|
url = "github:serokell/deploy-rs";
|
|
inputs.utils.follows = "flake-utils";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager/release-24.05";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
sops-nix = {
|
|
url = "github:Mic92/sops-nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
impermanence.url = "github:nix-community/impermanence";
|
|
stylix = {
|
|
url = "github:danth/stylix";
|
|
inputs = {
|
|
nixpkgs.follows = "nixpkgs";
|
|
home-manager.follows = "home-manager";
|
|
};
|
|
};
|
|
};
|
|
outputs = inputs@{ self, nixpkgs, flake-utils, home-manager, deploy-rs
|
|
, sops-nix, impermanence, stylix, ... }:
|
|
let
|
|
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;
|
|
};
|
|
})
|
|
];
|
|
};
|
|
in {
|
|
nixosConfigurations = {
|
|
smolboi = nixpkgs.lib.nixosSystem {
|
|
system = "x86_64-linux";
|
|
specialArgs = { inherit inputs; };
|
|
modules = [
|
|
stylix.nixosModules.stylix
|
|
impermanence.nixosModules.impermanence
|
|
./systems/smolboi/configuration.nix
|
|
home-manager.nixosModules.home-manager
|
|
{
|
|
home-manager.useGlobalPkgs = true;
|
|
home-manager.users.cdombroski = import ./systems/smolboi/home.nix;
|
|
}
|
|
];
|
|
};
|
|
zeus = nixpkgs.lib.nixosSystem {
|
|
system = "x86_64-linux";
|
|
specialArgs = { inherit inputs; };
|
|
modules = [
|
|
impermanence.nixosModules.impermanence
|
|
./systems/zeus/configuration.nix
|
|
];
|
|
};
|
|
orangepihole = nixpkgs.lib.nixosSystem {
|
|
system = "aarch64-linux";
|
|
specialArgs = { inherit inputs; };
|
|
modules = [
|
|
impermanence.nixosModules.impermanence
|
|
./systems/orangepihole/configuration.nix
|
|
];
|
|
};
|
|
};
|
|
deploy = {
|
|
sshUser = "root";
|
|
fastConnection = true;
|
|
nodes = {
|
|
smolboi = {
|
|
hostname = "smolboi";
|
|
profiles.system.path = deployPkgs.deploy-rs.lib.activate.nixos
|
|
self.nixosConfigurations.smolboi;
|
|
};
|
|
zeus = {
|
|
hostname = "zeus";
|
|
profiles.system.path = deployPkgs.deploy-rs.lib.activate.nixos
|
|
self.nixosConfigurations.zeus;
|
|
};
|
|
orangepihole = {
|
|
hostname = "orangepihole";
|
|
profiles.system.path =
|
|
deployAarch64Pkgs.deploy-rs.lib.activate.nixos
|
|
self.nixosConfigurations.orangepihole;
|
|
};
|
|
};
|
|
};
|
|
} // flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
deployLib = deploy-rs.lib.${system};
|
|
in {
|
|
devShells.default =
|
|
pkgs.mkShell { buildInputs = [ pkgs.deploy-rs pkgs.sops ]; };
|
|
checks = deployLib.deployChecks self.deploy;
|
|
formatter = pkgs.nixfmt;
|
|
});
|
|
}
|