mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-06 07:48:12 +09:00
nix builder
This commit is contained in:
@@ -0,0 +1,37 @@
|
|||||||
|
_:
|
||||||
|
|
||||||
|
{
|
||||||
|
sops.secrets.nix-cache-signing-key = {
|
||||||
|
mode = "0400";
|
||||||
|
};
|
||||||
|
|
||||||
|
nix.settings = {
|
||||||
|
build-dir = "/var/lib/nix-build";
|
||||||
|
|
||||||
|
secret-key-files = [
|
||||||
|
"/var/lib/secrets/nix-cache-signing-key"
|
||||||
|
];
|
||||||
|
|
||||||
|
auto-optimise-store = false;
|
||||||
|
keep-outputs = false;
|
||||||
|
keep-derivations = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.harmonia.cache = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
signKeyPaths = [
|
||||||
|
"/var/lib/secrets/nix-cache-signing-key"
|
||||||
|
];
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
bind = "[::]:5000";
|
||||||
|
priority = 30;
|
||||||
|
workers = 4;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.firewall.allowedTCPPorts = [
|
||||||
|
5000
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
description = "NixOS deploy-rs deployment target";
|
||||||
|
|
||||||
|
includes = [
|
||||||
|
"services.openssh"
|
||||||
|
"users.nixdeploy"
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
users.groups.nixdeploy = { };
|
||||||
|
|
||||||
|
users.users.nixdeploy = {
|
||||||
|
isSystemUser = true;
|
||||||
|
group = "nixdeploy";
|
||||||
|
home = "/var/lib/nixdeploy";
|
||||||
|
createHome = true;
|
||||||
|
shell = pkgs.bashInteractive;
|
||||||
|
openssh.authorizedKeys.keys = [
|
||||||
|
"restrict ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFPg1aw0qXBmrQe6lzBwutX5t9Sxg2OeVN/homjqU6Ja moons@nix-builder"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
security.sudo.extraRules = [
|
||||||
|
{
|
||||||
|
users = [ "nixdeploy" ];
|
||||||
|
|
||||||
|
commands = [
|
||||||
|
{
|
||||||
|
command = "ALL";
|
||||||
|
options = [ "NOPASSWD" ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user