Skip to content

Commit

Permalink
run alejandra on nix code
Browse files Browse the repository at this point in the history
  • Loading branch information
rapenne-s committed Sep 4, 2022
1 parent 3b76016 commit 0a05168
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 24 deletions.
39 changes: 21 additions & 18 deletions fleet.nix
Original file line number Diff line number Diff line change
@@ -1,26 1,30 @@
{ lib, pkgs, ... }:
let
create_users = host:
{
users.users."${host.username}" = {
createHome = false;
home = "/home/chroot/" host.username;
isNormalUser = false;
isSystemUser = true;
group = "sftp_users";
openssh.authorizedKeys.keys = [ host.key ];
shell = null;
};
{
lib,
pkgs,
...
}: let
create_users = host: {
users.users."${host.username}" = {
createHome = false;
home = "/home/chroot/" host.username;
isNormalUser = false;
isSystemUser = true;
group = "sftp_users";
openssh.authorizedKeys.keys = [host.key];
shell = null;
};
};

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;

users.groups = { sftp_users = {}; };
users.groups = {sftp_users = {};};

services.openssh.extraConfig = ''
Match Group sftp_users
Expand All @@ -29,5 33,4 @@ in
ChrootDirectory %h
ForceCommand internal-sftp
'';

}
15 changes: 9 additions & 6 deletions utils/bento.nix
Original file line number Diff line number Diff line change
@@ -1,20 1,23 @@
{ lib, pkgs, ... }:
let
timer = "*:0/5";
in
{
lib,
pkgs,
...
}: let
timer = "*:0/15";
in {
systemd.timers.bento-upgrade = {
enable = true;
timerConfig = {
OnCalendar = "${timer}";
Unit = "bento-upgrade.service";
};
wantedBy = [ "timers.target" ];
wantedBy = ["timers.target"];
after = ["network-online.target"];
};

systemd.services.bento-upgrade = {
enable = true;
path = with pkgs; [ openssh git nixos-rebuild nix gzip ];
path = with pkgs; [openssh git nixos-rebuild nix gzip];
serviceConfig.Type = "oneshot";
script = ''
cd /var/bento
Expand Down

0 comments on commit 0a05168

Please sign in to comment.