DEL unused services/common.nix and services/users.nix

ADD grafana.nix
alacritty
Alexandre LUCAZEAU 2022-05-26 19:24:07 +00:00
parent fd4a6d32ac
commit c2eeb342e9
4 changed files with 36 additions and 54 deletions

View File

@ -1,13 +0,0 @@
{ config, pkgs, ...}:
{
environment.variables.EDITOR = "nvim";
environment.systemPackages = with pkgs; [
gitAndTools.gitFull
unzip
zip
tmux
lshw
bc
neovim
];
}

View File

@ -3,6 +3,7 @@
./hardware-configuration.nix
../modules/users.nix
../modules/common.nix
../modules/grafana.nix
];

View File

@ -1,41 +0,0 @@
{ config, pkgs, ...}:
{
users = {
groups = {
alexandre = {};
};
users = {
alexandre = {
isNormalUser = true;
createHome = true;
home = "/home/alexandre";
description = "Alexandre LUCAZEAU";
extraGroups = [ "wheel" ];
group = "alexandre";
shell = pkgs.fish;
openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKUA1RW6JwZasspAp8qmFRFnlV5WXjhLfStAAkM+KYLv lucazeau.alexandre@gmail.com" ];
};
};
};
programs.git = {
enable = true;
config.user.email = "lucazeau.alexandre@gmail.com";
config.user.name = "Alexandre LUCAZEAU";
config.init.defaultBranch = "main";
config.core.sshCommand = "ssh -i ~/.ssh/id_ed25519-perso";
};
programs.fish.enable = true;
programs.fish.shellAliases = {
ll = "ls -l";
ls = "ls --color=tty";
vi = "nvim";
vim = "nvim";
};
security.sudo = {
enable = true;
execWheelOnly = true;
extraRules = [
{ users = [ "alexandre" ]; commands = [ { command = "ALL"; options = [ "NOPASSWD" ]; } ]; }
];
};
}

35
modules/grafana.nix Normal file
View File

@ -0,0 +1,35 @@
{ config, pkgs, ...}:
let
caddyDir = "/var/lib/caddy";
in
{
services.grafana = {
enable = true;
domain = "sup.atlanticaweb";
port = 2342;
addr = "127.0.0.1";
};
services.caddy = {
enable = true;
email = "lucazeau.alexandre@gmail.com";
config = ''
{
storage file_system {
root ${caddyDir}
}
}
https://grafana.atlanticaweb.fr {
reverse_proxy http://127.0.0.1:${toString config.services.grafana.port}
}
'';
};
users.users.caddy = {
group = "caddy";
uid = config.ids.uids.caddy;
home = caddyDir;
createHome = true;
extraGroups = [ "users" ];
};
users.groups.caddy.gid = config.ids.uids.caddy;
}