🔧 flakes + deploy-rs conversion
This commit is contained in:
111
flake.nix
111
flake.nix
@ -6,9 +6,30 @@
|
||||
home-manager.url = "github:nix-community/home-manager";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
deploy-rs.url = "github:serokell/deploy-rs";
|
||||
|
||||
# My stuff
|
||||
dotfiles = {
|
||||
url = "github:walkah/dotfiles";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, deploy-rs, flake-utils, ... }:
|
||||
outputs = { self, nixpkgs, deploy-rs, flake-utils, home-manager, dotfiles, ... }@attrs:
|
||||
let
|
||||
mkSystem = hostName: system: modules:
|
||||
nixpkgs.lib.nixosSystem {
|
||||
system = system;
|
||||
modules = [
|
||||
home-manager.nixosModules.home-manager
|
||||
({ config, ... }: {
|
||||
networking.hostName = hostName;
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
})
|
||||
]
|
||||
++ modules;
|
||||
};
|
||||
in
|
||||
flake-utils.lib.eachDefaultSystem
|
||||
(system:
|
||||
let
|
||||
@ -16,35 +37,18 @@
|
||||
in
|
||||
{
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = [
|
||||
deploy-rs.packages.${system}.deploy-rs
|
||||
pkgs.sops
|
||||
];
|
||||
buildInputs = [ deploy-rs.packages.${system}.deploy-rs pkgs.sops ];
|
||||
};
|
||||
}
|
||||
)
|
||||
// {
|
||||
}) // {
|
||||
nixosConfigurations = {
|
||||
agent = nixpkgs.lib.nixosSystem {
|
||||
system = "aarch64-linux";
|
||||
modules = [
|
||||
./hosts/aristotle/configuration.nix
|
||||
({ config, ... }: {
|
||||
networking.hostName = "agent";
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
form = nixpkgs.lib.nixosSystem {
|
||||
system = "aarch64-linux";
|
||||
modules = [
|
||||
./hosts/aristotle/configuration.nix
|
||||
({ config, ... }: {
|
||||
networking.hostName = "form";
|
||||
})
|
||||
];
|
||||
};
|
||||
# Aristotle
|
||||
agent = mkSystem "agent" "aarch64-linux" [ ./hosts/aristotle/configuration.nix ];
|
||||
form = mkSystem "form" "aarch64-linux" [ ./hosts/aristotle/configuration.nix ];
|
||||
matter = mkSystem "matter" "aarch64-linux" [ ./hosts/aristotle/configuration.nix ];
|
||||
purpose = mkSystem "purpose" "aarch64-linux" [ ./hosts/aristotle/configuration.nix ];
|
||||
|
||||
plato = mkSystem "plato" "x86_64-linux" [ ./hosts/plato/configuration.nix ];
|
||||
socrates = mkSystem "socrates" "x86_64-linux" [ ./hosts/socrates/configuration.nix ];
|
||||
};
|
||||
|
||||
deploy.nodes = {
|
||||
@ -67,6 +71,59 @@
|
||||
self.nixosConfigurations.form;
|
||||
};
|
||||
};
|
||||
|
||||
matter = {
|
||||
hostname = "matter";
|
||||
sshUser = "root";
|
||||
profiles.system = {
|
||||
user = "root";
|
||||
path = deploy-rs.lib.aarch64-linux.activate.nixos
|
||||
self.nixosConfigurations.matter;
|
||||
};
|
||||
};
|
||||
|
||||
purpose = {
|
||||
hostname = "purpose";
|
||||
sshUser = "root";
|
||||
profiles.system = {
|
||||
user = "root";
|
||||
path = deploy-rs.lib.aarch64-linux.activate.nixos
|
||||
self.nixosConfigurations.purpose;
|
||||
};
|
||||
};
|
||||
|
||||
plato = {
|
||||
hostname = "plato";
|
||||
profiles = {
|
||||
system = {
|
||||
user = "root";
|
||||
path = deploy-rs.lib.x86_64-linux.activate.nixos
|
||||
self.nixosConfigurations.plato;
|
||||
};
|
||||
walkah = {
|
||||
user = "walkah";
|
||||
path = deploy-rs.lib.x86_64-linux.activate.home-manager
|
||||
dotfiles.homeConfigurations.x86_64-linux;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
socrates = {
|
||||
hostname = "socrates";
|
||||
sshUser = "root";
|
||||
profiles = {
|
||||
system = {
|
||||
user = "root";
|
||||
path = deploy-rs.lib.x86_64-linux.activate.nixos
|
||||
self.nixosConfigurations.socrates;
|
||||
};
|
||||
walkah = {
|
||||
user = "walkah";
|
||||
path = deploy-rs.lib.x86_64-linux.activate.home-manager
|
||||
dotfiles.homeConfigurations.x86_64-linux;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user