Add build-worker container image

This commit is contained in:
emily 2024-08-18 21:48:41 +02:00
parent 10c7e7cee8
commit e4dae7955a
Signed by: emily
GPG key ID: F6F4C66207FCF995
7 changed files with 34 additions and 8 deletions

1
.gitignore vendored
View file

@ -1 +1,2 @@
testing/** testing/**
result

View file

@ -9,7 +9,6 @@ with lib; {
../../modules ../../modules
]; ];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
kitty.terminfo
bat bat
dig dig
htop htop
@ -23,6 +22,8 @@ with lib; {
unzip unzip
zip zip
figlet figlet
] ++ lib.optionals (!config.kyouma.machine-type.container) [
kitty.terminfo
]; ];
programs = { programs = {
mtr.enable = true; mtr.enable = true;
@ -57,7 +58,7 @@ with lib; {
nix.gc.automatic = true; nix.gc.automatic = true;
nix.gc.options = "--delete-older-than 7d"; nix.gc.options = "--delete-older-than 7d";
nix.optimise.automatic = true; nix.optimise.automatic = true;
nix.registry.nixpkgs.to = { nix.registry.nixpkgs.to = lib.mkIf (!config.kyouma.machine-type.container) {
type = "path"; type = "path";
path = pkgs.path; path = pkgs.path;
}; };

View file

@ -0,0 +1,15 @@
{ lib, modulesPath, ... }: {
imports = [
"${modulesPath}/virtualisation/docker-image.nix"
../../common
../../profiles/builder.nix
../../profiles/headless.nix
];
networking.hostName = "build-worker-oci";
services.resolved.enable = lib.mkForce false;
kyouma = {
machine-type.container = true;
deployment.auto-upgrade.enable = lib.mkForce false;
};
}

View file

@ -212,7 +212,8 @@
plugins.luasnip.enable = true; plugins.luasnip.enable = true;
plugins.nvim-autopairs.enable = true; plugins.nvim-autopairs.enable = true;
plugins.rainbow-delimiters.enable = true; plugins.rainbow-delimiters.enable = true;
plugins.rustaceanvim.enable = true; # Broken
plugins.rustaceanvim.enable = false;
plugins.treesitter-context.enable = true; plugins.treesitter-context.enable = true;
}; };
} }

View file

@ -107,7 +107,10 @@
]; ];
}; };
}; };
images.lain = self.nixosConfigurations.lain-minimal.config.system.build.sdImage; images = {
lain = self.nixosConfigurations.lain-minimal.config.system.build.sdImage;
build-worker-oci = self.nixosConfigurations.build-worker-oci.config.system.build.tarball;
};
overlays = { overlays = {
kyouma = import ./pkgs/overlay.nix; kyouma = import ./pkgs/overlay.nix;

View file

@ -38,6 +38,11 @@ in {
default = false; default = false;
description = mdDoc "Mark machine as portable."; description = mdDoc "Mark machine as portable.";
}; };
container = mkOption {
type = types.bool;
default = false;
description = mdDoc "Mark machine as container image.";
};
}; };
config = { config = {
assertions = [ assertions = [

View file

@ -1,5 +1,5 @@
final: prev: { final: prev: {
nyastodon = final.callPackage ./nyastodon/default.nix { }; nyastodon = final.callPackage ./nyastodon/default.nix {};
upgrade-system = final.callPackage ./upgrade-system/default.nix { }; upgrade-system = final.callPackage ./upgrade-system/default.nix {};
update-nixfiles = final.callPackage ./update-nixfiles/default.nix { }; update-nixfiles = final.callPackage ./update-nixfiles/default.nix {};
} }