From ef0f32ec4ec8679c39600e18d846b3db167ff0ba Mon Sep 17 00:00:00 2001 From: karim mdmirajul Date: Mon, 18 Dec 2023 12:04:27 +0200 Subject: [PATCH] configure PRbuilder Signed-off-by: karim mdmirajul --- hosts/default.nix | 4 +++ hosts/prbuilder/configuration.nix | 39 +++++++++++++++++++++++++ hosts/prbuilder/disk-config.nix | 48 +++++++++++++++++++++++++++++++ tasks.py | 3 ++ users/default.nix | 1 + users/karim.nix | 14 +++++++++ 6 files changed, 109 insertions(+) create mode 100644 hosts/prbuilder/configuration.nix create mode 100644 hosts/prbuilder/disk-config.nix create mode 100644 users/karim.nix diff --git a/hosts/default.nix b/hosts/default.nix index ca5f85b4..82fd586b 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -35,5 +35,9 @@ inherit specialArgs; modules = [./ficolobuild/configuration.nix]; }; + prbuilder = lib.nixosSystem { + inherit specialArgs; + modules = [./prbuilder/configuration.nix]; + }; }; } diff --git a/hosts/prbuilder/configuration.nix b/hosts/prbuilder/configuration.nix new file mode 100644 index 00000000..1fd0608d --- /dev/null +++ b/hosts/prbuilder/configuration.nix @@ -0,0 +1,39 @@ +# SPDX-FileCopyrightText: 2023 Technology Innovation Institute (TII) +# +# SPDX-License-Identifier: Apache-2.0 +{ + self, + inputs, + lib, + pkgs, + ... +}: { + imports = lib.flatten [ + (with inputs; [ + nix-serve-ng.nixosModules.default + disko.nixosModules.disko + ]) + (with self.nixosModules; [ + common + qemu-common + service-openssh + user-jrautiola + user-cazfi + user-karim + ]) + ./disk-config.nix + ]; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + # List packages installed in system profile + environment.systemPackages = with pkgs; [ + git + emacs + ]; + # docker daemon running + virtualisation.docker.enable=true; + + networking = { + hostName = "prbuilder"; + nameservers = ["1.1.1.1" "8.8.8.8"]; + }; +} diff --git a/hosts/prbuilder/disk-config.nix b/hosts/prbuilder/disk-config.nix new file mode 100644 index 00000000..f39ad48c --- /dev/null +++ b/hosts/prbuilder/disk-config.nix @@ -0,0 +1,48 @@ +# SPDX-FileCopyrightText: 2023 Technology Innovation Institute (TII) +# +# SPDX-License-Identifier: Apache-2.0 +# BIOS compatible gpt partition +{ + disko.devices = { + disk = { + vda = { + device = "/dev/vda"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + boot = { + size = "1M"; + type = "EF02"; + }; + root = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + }; + vdb = { + device = "/dev/vdb"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + nix = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/nix"; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/tasks.py b/tasks.py index 45805349..25385ea8 100644 --- a/tasks.py +++ b/tasks.py @@ -85,6 +85,9 @@ class TargetHost: "build3-ficolo": TargetHost( hostname="172.18.20.104", nixosconfig="ficolobuild" ), + "prbuilder": TargetHost( + hostname="172.18.20.106", nixosconfig="prbuilder" + ), } ) diff --git a/users/default.nix b/users/default.nix index 4b67ee7f..56b30b36 100644 --- a/users/default.nix +++ b/users/default.nix @@ -11,5 +11,6 @@ user-hydra = import ./hydra.nix; user-cazfi = import ./cazfi.nix; user-mkaapu = import ./mkaapu.nix; + user-karim = import ./karim.nix; }; } diff --git a/users/karim.nix b/users/karim.nix new file mode 100644 index 00000000..86327753 --- /dev/null +++ b/users/karim.nix @@ -0,0 +1,14 @@ +# SPDX-FileCopyrightText: 2023 Technology Innovation Institute (TII) +# +# SPDX-License-Identifier: Apache-2.0 +{ + users.users = { + karim = { + isNormalUser = true; + openssh.authorizedKeys.keys = [ + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDe5L8iOqhNPsYz5eh9Bz/URYguG60JjMGmKG0wwLIb6Gf2M8Txzk24ESGbMR/F5RYsV1yWYOocL47ngDWQIbO6MGJ7ftUr7slWoUA/FSVwh/jsG681mRqIuJXjKM/YQhBkI9k6+eVxRfLDTs5XZfbwdm7T4aP8ZI2609VY0guXfa/F7DSE1BxN7IJMn0CWLQJanBpoYUxqyQXCUXgljMokdPjTrqAxlBluMsVTP+ZKDnjnpHcVE/hCKk5BxaU6K97OdeIOOEWXAd6uEHssomjtU7+7dhiZzjhzRPKDiSJDF9qtIw50kTHz6ZTdH8SAZmu0hsS6q8OmmDTAnt24dFJV karim@nixos" + ]; + extraGroups = ["wheel" "networkmanager"]; + }; + }; +}