Apply the same fixes to kubernetes.
This commit is contained in:
@@ -45,7 +45,14 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
|
forAllSystems =
|
||||||
|
func:
|
||||||
|
builtins.listToAttrs (
|
||||||
|
map (system: {
|
||||||
|
name = system;
|
||||||
|
value = func system;
|
||||||
|
}) nixpkgs.lib.systems.flakeExposed
|
||||||
|
);
|
||||||
nodes = {
|
nodes = {
|
||||||
odo = {
|
odo = {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
{ }
|
|
||||||
@@ -71,64 +71,49 @@
|
|||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
nixosConfigs = builtins.mapAttrs (
|
baseConfig = nixpkgs.lib.nixosSystem {
|
||||||
hostname: nodeConfig: format:
|
specialArgs = {
|
||||||
nixpkgs.lib.nixosSystem {
|
inherit self;
|
||||||
specialArgs = {
|
};
|
||||||
inherit self;
|
modules = [
|
||||||
|
impermanence.nixosModules.impermanence
|
||||||
this_nixos_config = self.nixosConfigurations."${hostname}";
|
lanzaboote.nixosModules.lanzaboote
|
||||||
|
disko.nixosModules.disko
|
||||||
all_nixos_configs = self.nixosConfigurations;
|
./configuration.nix
|
||||||
};
|
{
|
||||||
|
config = {
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(final: prev: {
|
||||||
|
# stable = nixpkgs-stable.legacyPackages."${prev.stdenv.hostPlatform.system}";
|
||||||
|
unoptimized = import nixpkgs {
|
||||||
|
system = prev.stdenv.hostPlatform.system;
|
||||||
|
hostPlatform.gcc.arch = "default";
|
||||||
|
hostPlatform.gcc.tune = "default";
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
toplevelConfigs = builtins.mapAttrs (
|
||||||
|
hostname: nodeConfig:
|
||||||
|
baseConfig.extendModules {
|
||||||
modules = [
|
modules = [
|
||||||
impermanence.nixosModules.impermanence
|
|
||||||
lanzaboote.nixosModules.lanzaboote
|
|
||||||
disko.nixosModules.disko
|
|
||||||
./configuration.nix
|
|
||||||
(./. + "/hosts/${hostname}")
|
(./. + "/hosts/${hostname}")
|
||||||
(./. + "/formats/${format}.nix")
|
|
||||||
{
|
{
|
||||||
config = {
|
config = {
|
||||||
nixpkgs.hostPlatform.system = nodeConfig.system;
|
nixpkgs.hostPlatform.system = nodeConfig.system;
|
||||||
nixpkgs.overlays = [
|
|
||||||
(final: prev: {
|
|
||||||
# stable = nixpkgs-stable.legacyPackages."${prev.stdenv.hostPlatform.system}";
|
|
||||||
unoptimized = import nixpkgs {
|
|
||||||
system = prev.stdenv.hostPlatform.system;
|
|
||||||
hostPlatform.gcc.arch = "default";
|
|
||||||
hostPlatform.gcc.tune = "default";
|
|
||||||
};
|
|
||||||
})
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
(
|
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
nix-self-repl = pkgs.writeShellScriptBin "nix-self-repl" ''
|
|
||||||
source /etc/set-environment
|
|
||||||
nix repl --expr 'builtins.getFlake "${self}"'
|
|
||||||
'';
|
|
||||||
# If we wanted the current version of a flake then we'd just launch
|
|
||||||
# nix repl
|
|
||||||
# and then run:
|
|
||||||
# :lf /path/to/flake
|
|
||||||
in
|
|
||||||
{
|
|
||||||
config = {
|
|
||||||
environment.systemPackages = lib.mkIf config.nix.enable [ nix-self-repl ];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
)
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
) nodes;
|
) nodes;
|
||||||
|
specialFormats =
|
||||||
|
nixosConfig: format:
|
||||||
|
nixosConfig.extendModules {
|
||||||
|
modules = [ (./. + "/formats/${format}.nix") ];
|
||||||
|
};
|
||||||
installerConfig =
|
installerConfig =
|
||||||
hostname: nodeConfig:
|
hostname: nodeConfig:
|
||||||
nixpkgs.lib.nixosSystem {
|
nixpkgs.lib.nixosSystem {
|
||||||
@@ -137,46 +122,40 @@
|
|||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
./formats/installer.nix
|
./formats/installer.nix
|
||||||
(
|
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
nix-self-repl = pkgs.writeShellScriptBin "nix-self-repl" ''
|
|
||||||
source /etc/set-environment
|
|
||||||
nix repl --expr 'builtins.getFlake "${self}"'
|
|
||||||
'';
|
|
||||||
# If we wanted the current version of a flake then we'd just launch
|
|
||||||
# nix repl
|
|
||||||
# and then run:
|
|
||||||
# :lf /path/to/flake
|
|
||||||
in
|
|
||||||
{
|
|
||||||
config = {
|
|
||||||
environment.systemPackages = lib.mkIf config.nix.enable [ nix-self-repl ];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
)
|
|
||||||
({ nixpkgs.hostPlatform.system = nodeConfig.system; })
|
({ nixpkgs.hostPlatform.system = nodeConfig.system; })
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixosConfigurations = (builtins.mapAttrs (name: value: value "toplevel") nixosConfigs);
|
nixosConfigurations = toplevelConfigs;
|
||||||
}
|
}
|
||||||
// {
|
// {
|
||||||
packages = (
|
packages = (
|
||||||
forAllSystems (
|
forAllSystems (
|
||||||
system:
|
system:
|
||||||
(builtins.mapAttrs (hostname: nodeConfig: {
|
let
|
||||||
iso = (nixosConfigs."${hostname}" "iso").config.system.build.isoImage;
|
machines = (
|
||||||
vm_iso = (nixosConfigs."${hostname}" "vm_iso").config.system.build.isoImage;
|
builtins.mapAttrs (hostname: nodeConfig: {
|
||||||
sd = (nixosConfigs."${hostname}" "sd").config.system.build.sdImage;
|
iso = (specialFormats self.nixosConfigurations."${hostname}" "iso").config.system.build.isoImage;
|
||||||
installer = (installerConfig hostname nodes."${hostname}").config.system.build.isoImage;
|
vm_iso =
|
||||||
}) (nixpkgs.lib.attrsets.filterAttrs (hostname: nodeConfig: nodeConfig.system == system) nodes))
|
(specialFormats self.nixosConfigurations."${hostname}" "vm_iso").config.system.build.isoImage;
|
||||||
|
sd = (specialFormats self.nixosConfigurations."${hostname}" "sd").config.system.build.sdImage;
|
||||||
|
installer = (installerConfig hostname nodes."${hostname}").config.system.build.isoImage;
|
||||||
|
}) (nixpkgs.lib.attrsets.filterAttrs (hostname: nodeConfig: nodeConfig.system == system) nodes)
|
||||||
|
);
|
||||||
|
in
|
||||||
|
(
|
||||||
|
machines
|
||||||
|
// {
|
||||||
|
wip = nixpkgs.legacyPackages."${system}".symlinkJoin {
|
||||||
|
name = "wip";
|
||||||
|
paths = [
|
||||||
|
self.nixosConfigurations."controller0".config.system.build.toplevel
|
||||||
|
self.nixosConfigurations."worker0".config.system.build.toplevel
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
{ }
|
|
||||||
Reference in New Issue
Block a user