Skip to content

Commit

Permalink
//hive/darwinConfigurations/darwin-test: init
Browse files Browse the repository at this point in the history
Also some code splitting of hosts.test.meta
  • Loading branch information
Lehmanator committed May 24, 2024
1 parent 8f64d5f commit fcda468
Show file tree
Hide file tree
Showing 8 changed files with 165 additions and 126 deletions.
173 changes: 86 additions & 87 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,93 +42,92 @@
inputs = i.all;
inherit systems;
cellsFrom = std.incl ./nix cells;
cellBlocks = with std.blockTypes;
[
#(inputs.std.blockTypes.functions "blockTypes")
# --- omnibus unused pops ---
# allData, darwinModules, darwinProfiles, devshellModules,
# example, flake, flake-parts, hive, load, microvms,
# overlays, self, srvos, std, systemManagerProfiles
# --- flake.outputs ---
# checks, hydraJobs, nixConfig, templates
(functions "lib")
(functions "overlays")
(files "templates")
(installables "packages" { ci.build = true; })

# --- std missing blockTypes ---
(arion "arion")
(files "files")
(kubectl "kubectl")
(microvms "microvms")
(namaka "namaka")
(nixostests "nixosTests")
(nomad "nomad")
(nvfetcher "nvfetcher")
(pkgs "pkgs")
(terra "terra" "[email protected]:Lehmanator/nix-configs.git")

# --- config types ---
inputs.hive.blockTypes.colmenaConfigurations

(functions "devshellModules")
(functions "devshellProfiles")
(functions "devshellSuites")

inputs.hive.blockTypes.diskoConfigurations
(functions "diskoProfiles")
(functions "diskoSuites")

(functions "flakeModules")
(functions "flakeProfiles")
(functions "flakeSuites")

(functions "hardwareConfigurations")
(functions "hardwareModules")
(functions "hardwareProfiles")
(functions "hardwareSuites")

inputs.hive.blockTypes.homeConfigurations
(functions "homeModules")
(functions "homeProfiles")
(functions "homeSuites")
(functions "userProfiles")

inputs.hive.blockTypes.nixosConfigurations
(functions "nixosModules")
(functions "nixosProfiles")
(functions "nixosSuites")

(functions "robotnixConfigurations")
(functions "robotnixModules")
(functions "robotnixProfiles")
(functions "robotnixSuites")

(functions "systemManagerConfigurations")
(functions "systemManagerModules")
(functions "systemManagerProfiles")
(functions "systemManagerSuites")

(functions "termuxConfigurations")
(functions "termuxModules")
(functions "termuxProfiles")
(functions "termuxSuites")

(functions "vimConfigurations")
(functions "vimModules")
(functions "vimProfiles")
(functions "vimSuites")

(functions "wslConfigurations")
(functions "wslModules")
(functions "wslProfiles")
(functions "wslSuites")
] ++ l.optionals (builtins.elem "aarch64-darwin" systems) [
inputs.hive.blockTypes.darwinConfigurations
(std.blockTypes.functions "darwinModules")
(std.blockTypes.functions "darwinProfiles")
(std.blockTypes.functions "darwinSuites")
];
cellBlocks = with std.blockTypes; [
#(inputs.std.blockTypes.functions "blockTypes")
# --- omnibus unused pops ---
# allData, darwinModules, darwinProfiles, devshellModules,
# example, flake, flake-parts, hive, load, microvms,
# overlays, self, srvos, std, systemManagerProfiles
# --- flake.outputs ---
# checks, hydraJobs, nixConfig, templates
(functions "lib")
(functions "overlays")
(files "templates")
(installables "packages" { ci.build = true; })

# --- std missing blockTypes ---
(arion "arion")
(files "files")
(kubectl "kubectl")
(microvms "microvms")
(namaka "namaka")
(nixostests "nixosTests")
(nomad "nomad")
(nvfetcher "nvfetcher")
(pkgs "pkgs")
(terra "terra" "[email protected]:Lehmanator/nix-configs.git")

# --- config types ---
inputs.hive.blockTypes.colmenaConfigurations

(functions "devshellModules")
(functions "devshellProfiles")
(functions "devshellSuites")

inputs.hive.blockTypes.diskoConfigurations
(functions "diskoProfiles")
(functions "diskoSuites")

(functions "flakeModules")
(functions "flakeProfiles")
(functions "flakeSuites")

(functions "hardwareConfigurations")
(functions "hardwareModules")
(functions "hardwareProfiles")
(functions "hardwareSuites")

inputs.hive.blockTypes.homeConfigurations
(functions "homeModules")
(functions "homeProfiles")
(functions "homeSuites")
(functions "userProfiles")

inputs.hive.blockTypes.nixosConfigurations
(functions "nixosModules")
(functions "nixosProfiles")
(functions "nixosSuites")

(functions "robotnixConfigurations")
(functions "robotnixModules")
(functions "robotnixProfiles")
(functions "robotnixSuites")

(functions "systemManagerConfigurations")
(functions "systemManagerModules")
(functions "systemManagerProfiles")
(functions "systemManagerSuites")

(functions "termuxConfigurations")
(functions "termuxModules")
(functions "termuxProfiles")
(functions "termuxSuites")

(functions "vimConfigurations")
(functions "vimModules")
(functions "vimProfiles")
(functions "vimSuites")

(functions "wslConfigurations")
(functions "wslModules")
(functions "wslProfiles")
(functions "wslSuites")
#] ++ l.optionals (builtins.elem "aarch64-darwin" systems) [
inputs.hive.blockTypes.darwinConfigurations
(std.blockTypes.functions "darwinModules")
(std.blockTypes.functions "darwinProfiles")
(std.blockTypes.functions "darwinSuites")
];
nixpkgsConfig = {
allowUnfree = true;
allowUnsupportedSystem = false;
Expand Down
8 changes: 8 additions & 0 deletions nix/hive/hosts/darwin-test/homeConfiguration.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{ inputs, cell, super, }: {
inherit (super.meta.darwinConfiguration) bee;
home = rec {
stateVersion = "24.05";
username = "sam";
homeDirectory = "/home/${username}";
};
}
35 changes: 35 additions & 0 deletions nix/hive/hosts/darwin-test/meta.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{ self, inputs, cell, ... }@args:
#builtins.trace ([ "TEST-META" ] ++ (builtins.attrNames args))
{
myargs = args;
system = "aarch64-darwin";
specialArgs = { user = "sam"; };
colmena = {
nixpkgs = { system = "aarch64-darwin"; }; # Is this `nixpkgs.config`?
};
colmenaConfiguration = {
inherit (self.nixosConfiguration) bee imports;
deployment = {
allowLocalDeployment = true;
tags = [ "test" ];
};
};
darwinConfiguration = {
system.stateVersion = 4;
bee = {
system = "aarch64-darwin";
inherit (inputs) wsl;
inherit (inputs.omnibus.flake.inputs) darwin;
home = inputs.home-manager;
pkgs = cell.pkgs.unstable-with-overlays;
};
homebrew = {
enable = true;
onActivation = {
autoUpdate = true;
upgrade = true;
};
};
imports = [{ _module.args = self.specialArgs; }];
};
}
9 changes: 6 additions & 3 deletions nix/hive/hosts/minimal/meta.nix
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,14 @@ in
#cell.nixosProfiles.test
cell.nixosProfiles.user-primary

cell.diskoConfigurations.wyse
cell.diskoConfigurations.test
];
xdg.portal = { enable = true; extraPortals=[bee.pkgs.xdg-desktop-portal-gtk]; };
xdg.portal = {
enable = true;
extraPortals = [ bee.pkgs.xdg-desktop-portal-gtk ];
configPackages = [ bee.pkgs.gnome.gnome-session ];
};
#networking.hostName = "minimal";
#home-manager.users.sam = ./users/sam;

};
}
11 changes: 11 additions & 0 deletions nix/hive/hosts/test/darwinConfiguration.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{ super, inputs, cell, ... }@args: {
inherit (super.meta.nixosConfiguration) bee; # imports;
imports = [ ];
homebrew = {
enable = true;
onActivation = {
autoUpdate = true;
upgrade = true;
};
};
}
22 changes: 7 additions & 15 deletions nix/hive/hosts/test/homeConfiguration.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ inputs, cell, self, ... }@args:
{ inputs, cell, super, ... }@args:
#builtins.trace ([ "HOME-TEST" ] ++ (builtins.attrNames self))
#let
# nixosConfiguration =
Expand Down Expand Up @@ -29,12 +29,10 @@
# username = "wtf";
# };
# home = home1 // { homeDirectory = "/home/${home1.username}"; };
# #builtins.trace "hmBhole" {
# # inherit (nixosConfiguration) bee;
# # inherit home;
# #}
#in
{
inherit (super.meta.nixosConfiguration) bee;

imports = with inputs; [ nix-flatpak.homeManagerModules.nix-flatpak ];

#inherit (self.meta.nixosConfiguration) bee;
Expand All @@ -50,16 +48,10 @@
# homeDirectory = "/home/${username}";
#};

bee = {
#inherit (inputs) darwin home;
inherit (inputs) home;
#inherit (self) system;
system = "x86_64-linux";
pkgs = cell.pkgs.unstable-with-overlays;
};
home = {
stateVersion = "24.05";
home = rec {
inherit (super.meta.nixosConfiguration.system) stateVersion;
#stateVersion = "24.05";
username = "red";
homeDirectory = "/home/red";
homeDirectory = "/home/${username}";
};
}
32 changes: 11 additions & 21 deletions nix/hive/hosts/test/meta.nix
Original file line number Diff line number Diff line change
@@ -1,44 +1,32 @@
{ self, inputs, cell, ... }@args:
{ self, super, root, inputs, cell, ... }@args:
#builtins.trace ([ "TEST-META" ] ++ (builtins.attrNames args))
{
myargs = args;
system = "x86_64-linux";
specialArgs = { user = "sam"; };

# Colmena args: meta
# Args: allowApplyAll, description, machinesFile, name, nixpkgs, nodeNixpkgs, nodeSpecialArgs, specialArgs,
colmena = {
description = "Lehmanator's Hive";
allowApplyAll = true;
nixpkgs = { system = "x86_64-linux"; }; # Is this `nixpkgs.config`?
};
colmenaConfiguration = {
inherit (self.nixosConfiguration) bee imports;
deployment = {
allowLocalDeployment = true;
buildOnTarget = false;
tags = [ "test" ];
#buildOnTarget = false;
#replaceUnknownProfiles = true;
#keys = { };
#privilegeEscalationCommand = [ "sudo" "-H" "--" ];
#targetHost = "127.0.0.1";
#targetPort = null;
#targetUser = "root";
#sshOptions = [ ];
};
};
#homeConfiguration = {
# inherit (self.nixosConfiguration) bee; # imports;
# home = rec {
# inherit (self.nixosConfiguration.system) stateVersion;
# username = self.specialArgs.user;
# homeDirectory = "/home/${username}";
# };
# imports = with inputs; [
# nix-flatpak.homeManagerModules.nix-flatpak
# ];
#};
nixosConfiguration = {
system.stateVersion = "24.05";
bee = {
#inherit (self) system;
system = "x86_64-linux";
#inherit (inputs.omnibus.flake.inputs) darwin;
inherit (inputs) wsl;
inherit (inputs.omnibus.flake.inputs) darwin;
home = inputs.home-manager;
pkgs = cell.pkgs.unstable-with-overlays;
#pkgs = import inputs.nixpkgs {
Expand Down Expand Up @@ -93,6 +81,8 @@
# --- std ---
cell.nixosModules.debug
#inputs.cells.android.nixosModules.attestation-server

cell.diskoConfigurations.test
];
};
}
1 change: 1 addition & 0 deletions nix/hive/pops/hosts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
inputs.hivebus.pops.hosts.addLoadExtender {
load = {
src = inputs.omnibus.flake.inputs.std.incl ../hosts [
"darwin-test"
#"fajita"
#"fajita-minimal"
#"fw"
Expand Down

0 comments on commit fcda468

Please sign in to comment.