nixos-config/flake.nix

94 lines
2.9 KiB
Nix

{
description = "NixOS configuration flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
deploy-rs.url = "github:serokell/deploy-rs";
deploy-rs.inputs.nixpkgs.follows = "nixpkgs";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager/release-24.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
nixvim = {
url = "github:nix-community/nixvim/nixos-24.11";
inputs = {
nixpkgs.follows = "nixpkgs";
devshell.follows = "";
flake-compat.follows = "";
git-hooks.follows = "";
home-manager.follows = "";
nix-darwin.follows = "";
treefmt-nix.follows = "";
};
};
};
outputs = { self, nixpkgs, home-manager, deploy-rs, disko, nixvim, ...}:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
nixosConfigurations = {
lift = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./hosts/lift/configuration.nix
./hosts/lift/hardware-configuration.nix
];
};
tien = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
disko.nixosModules.disko
./hosts/tien/configuration.nix
./hosts/tien/hardware-configuration.nix
];
};
};
homeConfigurations = {
"rothe@lift" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
./home/terminal
./home/wayland
nixvim.homeManagerModules.nixvim
];
extraSpecialArgs = {
mail = nixpkgs.lib.strings.concatStrings ["mail" "@" "johannes-rothe.de"];
};
};
"rothe@johannes-powermachine" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
./home/terminal
nixvim.homeManagerModules.nixvim
];
extraSpecialArgs = {
mail = nixpkgs.lib.strings.concatStrings ["mail" "@" "johannes-rothe.de"];
};
};
"rothe@pdemu1cml000301" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
./home/terminal
nixvim.homeManagerModules.nixvim
];
extraSpecialArgs = {
mail = nixpkgs.lib.strings.concatStrings ["rothe" "@" "magazino.eu"];
};
};
};
deploy.nodes.tien = let
hostname = "tien";
in {
hostname = hostname;
profiles.system = {
sshUser = "root";
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.${hostname};
};
};
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
};
}