Compare commits
No commits in common. "main" and "fix" have entirely different histories.
3 changed files with 71 additions and 83 deletions
|
|
@ -1,11 +1,16 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
./networking.nix
|
||||
./forgejo.nix
|
||||
];
|
||||
|
||||
];
|
||||
boot.loader.grub = {
|
||||
enable = true;
|
||||
efiSupport = true; # Enable EFI features
|
||||
|
|
@ -13,46 +18,69 @@
|
|||
};
|
||||
|
||||
boot.tmp.cleanOnBoot = true;
|
||||
nix = {
|
||||
registry = (lib.mapAttrs (_: flake: { inherit flake; })) (
|
||||
(lib.filterAttrs (_: lib.isType "flake")) inputs
|
||||
);
|
||||
|
||||
nixPath = [ "/etc/nix/path" ];
|
||||
|
||||
settings = {
|
||||
download-buffer-size = "512M";
|
||||
experimental-features = "nix-command flakes";
|
||||
auto-optimise-store = true;
|
||||
};
|
||||
};
|
||||
|
||||
environment = {
|
||||
shells = with pkgs; [ bash ];
|
||||
etc = lib.mapAttrs' (name: value: {
|
||||
name = "nix/path/${name}";
|
||||
value.source = value.flake;
|
||||
}) config.nix.registry;
|
||||
systemPackages = with pkgs; [
|
||||
git
|
||||
sops
|
||||
wget
|
||||
];
|
||||
};
|
||||
|
||||
zramSwap.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
];
|
||||
|
||||
programs = {
|
||||
gnupg = {
|
||||
agent = {
|
||||
enableSSHSupport = true;
|
||||
enable = true;
|
||||
pinentryPackage = pkgs.pinentry-tty;
|
||||
};
|
||||
};
|
||||
};
|
||||
networking.hostName = "srv1065175";
|
||||
networking.domain = "hstgr.cloud";
|
||||
|
||||
networking.firewall = {
|
||||
enable = true;
|
||||
allowedTCPPorts = [ 80 443 ];
|
||||
};
|
||||
|
||||
services.openssh.enable = true;
|
||||
users.users.root.openssh.authorizedKeys.keys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N8VrHayDWXtJcIW0nEKT+1R/7qkSH/5ELA2c/gznfkdTDzfG8+P3WAzNF openpgp:0xC25417F1''
|
||||
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICRAJaRuXqVeAs/Y5CeTbyc9lSbyvchkVqiML/yl6wbh thiago@Nixbook''
|
||||
];
|
||||
users.users.nimbus = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" ];
|
||||
};
|
||||
|
||||
security.sudo.extraRules = [
|
||||
{
|
||||
users = [ "nimbus" ];
|
||||
commands = [
|
||||
{
|
||||
command = "ALL";
|
||||
options = [ "NOPASSWD" ];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
users.users = {
|
||||
root.openssh.authorizedKeys.keyFiles = [
|
||||
(builtins.fetchurl {
|
||||
url = "https://meta.sr.ht/~sposito.keys";
|
||||
name = "sposito-srht-keys";
|
||||
sha256 = "1a0qcpbdkmdhnhhqvcmf6rq7zmjap6kxiwrcmmgs0fbhrlcyhkmi";
|
||||
})
|
||||
];
|
||||
nimbus.isNormalUser = true;
|
||||
nimbus.openssh.authorizedKeys.keys = [
|
||||
(builtins.fetchurl {
|
||||
url = "https://meta.sr.ht/~sposito.keys";
|
||||
name = "sposito-srht-keys";
|
||||
sha256 = "1a0qcpbdkmdhnhhqvcmf6rq7zmjap6kxiwrcmmgs0fbhrlcyhkmi";
|
||||
})
|
||||
];
|
||||
};
|
||||
system.stateVersion = "23.11";
|
||||
boot.kernelParams = [
|
||||
"console=tty1"
|
||||
"console=ttyS0,115200"
|
||||
];
|
||||
time.timeZone = "America/Sao_Paulo";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,42 +0,0 @@
|
|||
{ lib, config, ... }:
|
||||
let
|
||||
cfg = config.services.forgejo;
|
||||
srv = cfg.settings.server;
|
||||
domain = "git.sposi.to";
|
||||
in
|
||||
{
|
||||
security.acme = {
|
||||
acceptTerms = true;
|
||||
defaults.email = "th.spo@pm.me";
|
||||
};
|
||||
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
virtualHosts.${domain} = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
# Allow HTTP initially for ACME challenge, will redirect to HTTPS once cert is ready
|
||||
extraConfig = ''
|
||||
client_max_body_size 512M;
|
||||
'';
|
||||
locations."/".proxyPass = "http://localhost:${toString srv.HTTP_PORT}";
|
||||
};
|
||||
};
|
||||
|
||||
services.forgejo = {
|
||||
enable = true;
|
||||
database.type = "sqlite3";
|
||||
lfs.enable = true;
|
||||
settings = {
|
||||
server = {
|
||||
DOMAIN = domain;
|
||||
ROOT_URL = "https://${domain}/";
|
||||
HTTP_PORT = 3000;
|
||||
};
|
||||
service.DISABLE_REGISTRATION = true;
|
||||
};
|
||||
};
|
||||
|
||||
services.forgejo.settings.server.SSH_PORT = lib.mkDefault (lib.head (config.services.openssh.ports or [ 22 ]));
|
||||
}
|
||||
|
||||
|
|
@ -1,15 +1,9 @@
|
|||
{ modulesPath, lib, ... }:
|
||||
{
|
||||
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
|
||||
boot.initrd.kernelModules = [ "nvme" ];
|
||||
boot.loader.grub.device = "nodev";
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"ata_piix"
|
||||
"uhci_hcd"
|
||||
"xen_blkfront"
|
||||
"vmw_pvscsi"
|
||||
];
|
||||
boot.initrd.kernelModules = [ "nvme" ];
|
||||
fileSystems."/" = {
|
||||
device = "/dev/sda1";
|
||||
fsType = "ext4";
|
||||
|
|
@ -18,5 +12,13 @@
|
|||
device = "/dev/sda15";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"ata_piix"
|
||||
"uhci_hcd"
|
||||
"vmw_pvscsi"
|
||||
"xen_blkfront"
|
||||
];
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue