Exclude laptops from deploy-rs

This commit is contained in:
Fern Garden 2025-07-11 18:05:07 +08:00
parent 09f05fccfd
commit 20c6461e14

View file

@ -1,7 +1,6 @@
inputs: inputs:
with inputs; with inputs;
with inputs.nixpkgs.lib; let with inputs.nixpkgs.lib; {
in {
mergeHosts = lists.foldl' ( mergeHosts = lists.foldl' (
a: b: attrsets.recursiveUpdate a b a: b: attrsets.recursiveUpdate a b
) {}; ) {};
@ -45,40 +44,42 @@ in {
feishin = (import nixpkgs-pr-feishin {inherit system;}).feishin; feishin = (import nixpkgs-pr-feishin {inherit system;}).feishin;
webone = pkgs.callPackage ./packages/webone {}; webone = pkgs.callPackage ./packages/webone {};
}; };
in { in
nixosConfigurations.${hostname} = nixosSystem rec { {
inherit system pkgs; nixosConfigurations.${hostname} = nixosSystem rec {
inherit system pkgs;
specialArgs = { specialArgs = {
inherit inherit
nixpkgs nixpkgs
hostname hostname
platform platform
suite suite
user user
secrets secrets
userPackages userPackages
; # Inherit variables. ; # Inherit variables.
};
modules =
[
nixvim.nixosModules.nixvim
./suites/common.nix
./suites/${suite}.nix
./hosts/${suite}/${hostname}.nix
]
++ (filesystem.listFilesRecursive ./modules)
++ extraModules;
}; };
}
modules = // optionalAttrs (suite != "laptop") {
[ deploy.nodes.${hostname} = {
nixvim.nixosModules.nixvim hostname = "${hostname}.local";
./suites/common.nix profiles.system = {
./suites/${suite}.nix user = "root";
./hosts/${suite}/${hostname}.nix sshUser = user;
] path = pkgs-deploy-rs.deploy-rs.lib.activate.nixos self.nixosConfigurations.${hostname};
++ (filesystem.listFilesRecursive ./modules) };
++ extraModules;
};
deploy.nodes.${hostname} = {
hostname = "${hostname}.local";
profiles.system = {
user = "root";
sshUser = user;
path = pkgs-deploy-rs.deploy-rs.lib.activate.nixos self.nixosConfigurations.${hostname};
}; };
}; };
};
} }