nix-config/flake.nix

119 lines
3.2 KiB
Nix

{
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
nixpkgs-stable.url = "nixpkgs/nixos-23.05";
home-manager = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
impermanence.url = "github:nix-community/impermanence";
deploy-rs.url = "github:serokell/deploy-rs";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
};
outputs =
{ self
, nixpkgs
, nixpkgs-stable
, nixos-hardware
, home-manager
, impermanence
, deploy-rs
}@inputs:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
deployPkgs = import nixpkgs {
inherit system;
overlays = [
deploy-rs.overlay
(self: super: {
deploy-rs = {
inherit (pkgs) deploy-rs;
lib = deploy-rs.lib;
};
})
];
};
in
{
nixosConfigurations = {
trantor = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
# unstablePkgs = nixpkgs-unstable.legacyPackages."x86_64-linux";
stablePkgs = nixpkgs-stable.legacyPackages."x86_64-linux";
impermanence = impermanence;
};
modules = [
./hosts/trantor
home-manager.nixosModules.home-manager
impermanence.nixosModules.impermanence
];
};
capibara = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
# unstablePkgs = nixpkgs-unstable.legacyPackages."x86_64-linux";
stablePkgs = nixpkgs-stable.legacyPackages."x86_64-linux";
impermanence = impermanence;
};
modules = [
./hosts/capibara
nixos-hardware.nixosModules.lenovo-thinkpad-x230
home-manager.nixosModules.home-manager
impermanence.nixosModules.impermanence
];
};
lb = nixpkgs-stable.lib.nixosSystem {
system = "aarch64-linux";
specialArgs = { impermanence = impermanence; };
modules = [
./hosts/lb
impermanence.nixosModules.impermanence
];
};
};
deploy.nodes = {
capibara = {
hostname = "capibara";
profiles = {
system = {
sshUser = "rilla";
user = "root";
sudo = "doas -u";
path = deployPkgs.deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.capibara;
autoRollback = true;
remoteBuild = false;
};
};
};
lb = {
hostname = "lb";
profiles = {
system = {
sshUser = "rilla";
user = "root";
sudo = "doas -u";
path = deployPkgs.deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.lb;
autoRollback = true;
# remoteBuild = false;
remoteBuild = true;
};
};
};
};
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deployPkgs.deploy-rs.lib;
};
}