Skip to content

Commit

Permalink
Add colmena
Browse files Browse the repository at this point in the history
  • Loading branch information
yousiki committed Mar 24, 2024
1 parent a007663 commit b9b63f7
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 15 deletions.
22 changes: 22 additions & 0 deletions cells/nixos/colmenaConfigurations.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
inputs,
cell,
}: let
l = inputs.nixpkgs.lib // builtins;

hostConfigurations =
l.mapAttrs
(
name: value: {
imports = [value];

deployment = {
targetHost = name;
targetPort = 22;
targetUser = "yousiki";
};
}
)
cell.nixosConfigurations;
in
hostConfigurations
13 changes: 0 additions & 13 deletions cells/nixos/hosts/hakase/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,6 @@

networking.hostName = "hakase";

time.timeZone = "Asia/Shanghai";

networking.proxy.default = "http://yousiki:[email protected]:7890";
networking.proxy.noProxy = "127.0.0.1,localhost,cn.yousiki.top,edu.cn";

users.users.yousiki = {
isNormalUser = true;
extraGroups = ["wheel" "docker"];
shell = pkgs.zsh;
};

programs.zsh.enable = true;

services.openssh.enable = true;
services.openssh.openFirewall = true;
}
18 changes: 16 additions & 2 deletions cells/nixos/profiles/core.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
{
inputs,
cell,
}: {...}: {
}: {pkgs, ...}: {
imports = [
inputs.cells.common.commonProfiles.core
];

# Enable podman.
time.timeZone = "Asia/Shanghai";

users.users.yousiki = {
isNormalUser = true;
extraGroups = ["wheel" "docker"];
shell = pkgs.zsh;
};

programs.zsh.enable = true;

services.openssh.enable = true;
services.openssh.openFirewall = true;

security.sudo.wheelNeedsPassword = false;

virtualisation.podman = {
enable = true;
autoPrune.enable = true;
Expand Down
5 changes: 5 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
(std.blockTypes.functions "nixosModules")
(std.blockTypes.functions "nixosProfiles")

hive.blockTypes.colmenaConfigurations
hive.blockTypes.darwinConfigurations
hive.blockTypes.nixosConfigurations
];
Expand All @@ -47,6 +48,10 @@
nixosModules = hive.pick self [["nixos" "nixosModules"]];
}
{
colmenaHive =
nixpkgs.lib.recursiveUpdate
(collect self "colmenaConfigurations")
{metaConfig.allowApplyAll = true;};
darwinConfigurations = collect self "darwinConfigurations";
nixosConfigurations = collect self "nixosConfigurations";
};
Expand Down

0 comments on commit b9b63f7

Please sign in to comment.