run alejandra on nix code

This commit is contained in:
Solene Rapenne 2022-09-05 00:42:02 +02:00
parent 3b76016f9b
commit 0a051682b0
2 changed files with 30 additions and 24 deletions

View File

@ -1,26 +1,30 @@
{ lib, pkgs, ... }: {
let lib,
create_users = host: pkgs,
{ ...
users.users."${host.username}" = { }: let
createHome = false; create_users = host: {
home = "/home/chroot/" + host.username; users.users."${host.username}" = {
isNormalUser = false; createHome = false;
isSystemUser = true; home = "/home/chroot/" + host.username;
group = "sftp_users"; isNormalUser = false;
openssh.authorizedKeys.keys = [ host.key ]; isSystemUser = true;
shell = null; group = "sftp_users";
}; openssh.authorizedKeys.keys = [host.key];
shell = null;
};
}; };
users = [ users = [
{ username = "router"; key = "ssh-ed25519 AAAAC3NzaC2aZGI1OTE5AAAAOIOZKLFCZLM67viQXHYRjraE6WLfvETMkjjgSz0mxMzS root@router"; } {
username = "router";
key = "ssh-ed25519 AAAAC3NzaC2aZGI1OTE5AAAAOIOZKLFCZLM67viQXHYRjraE6WLfvETMkjjgSz0mxMzS root@router";
}
]; ];
in in {
{
imports = builtins.map create_users users; imports = builtins.map create_users users;
users.groups = { sftp_users = {}; }; users.groups = {sftp_users = {};};
services.openssh.extraConfig = '' services.openssh.extraConfig = ''
Match Group sftp_users Match Group sftp_users
@ -29,5 +33,4 @@ in
ChrootDirectory %h ChrootDirectory %h
ForceCommand internal-sftp ForceCommand internal-sftp
''; '';
} }

View File

@ -1,20 +1,23 @@
{ lib, pkgs, ... }:
let
timer = "*:0/5";
in
{ {
lib,
pkgs,
...
}: let
timer = "*:0/15";
in {
systemd.timers.bento-upgrade = { systemd.timers.bento-upgrade = {
enable = true; enable = true;
timerConfig = { timerConfig = {
OnCalendar = "${timer}"; OnCalendar = "${timer}";
Unit = "bento-upgrade.service"; Unit = "bento-upgrade.service";
}; };
wantedBy = [ "timers.target" ]; wantedBy = ["timers.target"];
after = ["network-online.target"];
}; };
systemd.services.bento-upgrade = { systemd.services.bento-upgrade = {
enable = true; enable = true;
path = with pkgs; [ openssh git nixos-rebuild nix gzip ]; path = with pkgs; [openssh git nixos-rebuild nix gzip];
serviceConfig.Type = "oneshot"; serviceConfig.Type = "oneshot";
script = '' script = ''
cd /var/bento cd /var/bento