Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configuration to easily add developers to build machines #65

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions hosts/ficolobuild/build3.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-FileCopyrightText: 2024 Technology Innovation Institute (TII)
# SPDX-License-Identifier: Apache-2.0
#
# SPDX-License-Identifier: Apache-2.0
{
self,
lib,
Expand All @@ -9,10 +9,9 @@
imports = lib.flatten [
(with self.nixosModules; [
user-themisto
user-barna
user-bmg
])
./builder.nix
./developers.nix
];

# build3 specific configuration
Expand All @@ -21,6 +20,6 @@

# Trust Themisto Hydra user
nix.settings = {
trusted-users = ["root" "themisto" "barna" "bmg"];
trusted-users = ["root" "themisto"];
};
}
3 changes: 1 addition & 2 deletions hosts/ficolobuild/build4.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-FileCopyrightText: 2024 Technology Innovation Institute (TII)
# SPDX-License-Identifier: Apache-2.0
#
# SPDX-License-Identifier: Apache-2.0
{
self,
lib,
Expand All @@ -10,7 +10,6 @@
(with self.nixosModules; [
user-themisto
])
# Import Ficolo x86 builder specific configuration
./builder.nix
];

Expand Down
2 changes: 1 addition & 1 deletion hosts/ficolobuild/builder.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-FileCopyrightText: 2023-2024 Technology Innovation Institute (TII)
# SPDX-License-Identifier: Apache-2.0
#
# SPDX-License-Identifier: Apache-2.0
{
self,
config,
Expand Down
46 changes: 46 additions & 0 deletions hosts/ficolobuild/developers.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# SPDX-FileCopyrightText: 2024 Technology Innovation Institute (TII)
#
# SPDX-License-Identifier: Apache-2.0
{lib, ...}: let
groupName = "developers";

# add new developers here
developers = [
{
name = "barna";
keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQChDMYWXg51H1/3Y3fGb8Bn6Dj1jauzKKsPdtRjFHTWSCde4GmF1/uPUJ9qogLNBS2B0nDS+IxnNNIKWarZhkb1aHvWHBy1n1s4gULwCZcF36yaFfKKCIfro+YI1/1uOZuv/AtVLzAgFlgUb21xLF9m11yuobB6OqSd9Fxt8i2AdfwVuj1fxyRlI+l5v82g0d3KiN0Pw+FqtzIZ6sEcpw8Mqn469PIDARUmYxo7mRMug8QPmQPgv57YhbppLN6cHUbYlud/2UeESUFsXrCAMDLtghvkNlAlmriaqhlVoH3jTLJ8ljIbHeFrBidZZk1/e7Ucw8iLkesQ11YrAY0QqqyH6vRr/o0XHiCbnxJl7rH9AC8tguqgFR/K2T8qygJZfs1szaOQg/+O7tdqwU8+j2NDSuh+PjYGnMOIT11ErtAYB2DAd8xVYOOWCsLeHVoiC1jgkVjehkV4wmwmq3d7X5iyuK7n4zJTEIqDzbrfshUnpL9ERe7zlFaocqUVedn1DDU= [email protected]"
];
}
{
name = "bmg";
keys = [
"[email protected] AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIEJ9ewKwo5FLj6zE30KnTn8+nw7aKdei9SeTwaAeRdJDAAAABHNzaDo="
"[email protected] AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIA/pwHnzGNM+ZU4lANGROTRe2ZHbes7cnZn72Oeun/MCAAAABHNzaDo="
];
}
];
in {
users = {
groups."${groupName}" = {};

users = builtins.listToAttrs (
map (
{
name,
keys,
}:
lib.nameValuePair name {
inherit name;

openssh.authorizedKeys.keys = keys;

isNormalUser = true;
extraGroups = [groupName];
}
)
developers
);
};
nix.settings.trusted-users = ["@${groupName}"];
}
1 change: 0 additions & 1 deletion hosts/ghafhydra/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
service-openssh
service-binary-cache
service-nginx
user-bmg
user-hrosten
user-tervis
])
Expand Down
15 changes: 0 additions & 15 deletions users/bmg.nix

This file was deleted.

3 changes: 1 addition & 2 deletions users/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# SPDX-FileCopyrightText: 2023 Technology Innovation Institute (TII)
# SPDX-FileCopyrightText: 2023-2024 Technology Innovation Institute (TII)
#
# SPDX-License-Identifier: Apache-2.0
{
flake.nixosModules = {
user-bmg = import ./bmg.nix;
user-builder = import ./builder.nix;
user-hrosten = import ./hrosten.nix;
user-tester = import ./tester.nix;
Expand Down
Loading