1
Fork 0

Migrate to gitea

This commit is contained in:
caem 2023-07-19 22:25:34 +02:00
parent 6db6683148
commit 9392c00e94
No known key found for this signature in database
GPG key ID: 6CB1202CC7B58265
7 changed files with 167 additions and 35 deletions

View file

@ -47,18 +47,36 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs": { "nixops": {
"inputs": {
"nixpkgs": "nixpkgs",
"utils": "utils"
},
"locked": { "locked": {
"lastModified": 1689431009, "lastModified": 1677688500,
"narHash": "sha256-hPgQCRWP5q/Xc4qOIP3c2krR9nQua78+t9EDiuey5nc=", "narHash": "sha256-yF2tS9Zo8JCIdPjhy19grmJk8wUFMxMu9cPlgfMJuTg=",
"owner": "nixos", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixops",
"rev": "af8279f65fe71ce5a448408034a8c06e2b4b2c66", "rev": "fc9b55c55da62f949028143b974f67fdc7f40c8b",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "id": "nixops",
"ref": "nixos-23.05", "type": "indirect"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1672525397,
"narHash": "sha256-WASDnyxHKWVrEe0dIzkpH+jzKlCKAk0husv0f/9pyxg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8ba56d7c0d7490680f2d51ba46a141eca7c46afa",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@ -93,7 +111,39 @@
"type": "indirect" "type": "indirect"
} }
}, },
"nixpkgs-unstable": {
"locked": {
"lastModified": 1689534811,
"narHash": "sha256-jnSUdzD/414d94plCyNlvTJJtiTogTep6t7ZgIKIHiE=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "6cee3b5893090b0f5f0a06b4cf42ca4e60e5d222",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": { "nixpkgs_2": {
"locked": {
"lastModified": 1689431009,
"narHash": "sha256-hPgQCRWP5q/Xc4qOIP3c2krR9nQua78+t9EDiuey5nc=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "af8279f65fe71ce5a448408034a8c06e2b4b2c66",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-23.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1670751203, "lastModified": 1670751203,
"narHash": "sha256-XdoH1v3shKDGlrwjgrNX/EN8s3c+kQV7xY6cLCE8vcI=", "narHash": "sha256-XdoH1v3shKDGlrwjgrNX/EN8s3c+kQV7xY6cLCE8vcI=",
@ -111,19 +161,20 @@
"root": { "root": {
"inputs": { "inputs": {
"impermanence": "impermanence", "impermanence": "impermanence",
"nixpkgs": "nixpkgs", "nixops": "nixops",
"simple-mailserver": "simple-mailserver", "nixpkgs": "nixpkgs_2",
"unstable": "unstable" "nixpkgs-unstable": "nixpkgs-unstable",
"simple-mailserver": "simple-mailserver"
} }
}, },
"simple-mailserver": { "simple-mailserver": {
"inputs": { "inputs": {
"blobs": "blobs", "blobs": "blobs",
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_3",
"nixpkgs-22_11": "nixpkgs-22_11", "nixpkgs-22_11": "nixpkgs-22_11",
"nixpkgs-23_05": "nixpkgs-23_05", "nixpkgs-23_05": "nixpkgs-23_05",
"utils": "utils" "utils": "utils_2"
}, },
"locked": { "locked": {
"lastModified": 1687462267, "lastModified": 1687462267,
@ -140,23 +191,22 @@
"type": "gitlab" "type": "gitlab"
} }
}, },
"unstable": { "utils": {
"locked": { "locked": {
"lastModified": 1689534811, "lastModified": 1667395993,
"narHash": "sha256-jnSUdzD/414d94plCyNlvTJJtiTogTep6t7ZgIKIHiE=", "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "nixos", "owner": "numtide",
"repo": "nixpkgs", "repo": "flake-utils",
"rev": "6cee3b5893090b0f5f0a06b4cf42ca4e60e5d222", "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "numtide",
"ref": "nixos-unstable", "repo": "flake-utils",
"repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"utils": { "utils_2": {
"locked": { "locked": {
"lastModified": 1605370193, "lastModified": 1605370193,
"narHash": "sha256-YyMTf3URDL/otKdKgtoMChu4vfVL3vCMkRqpGifhUn0=", "narHash": "sha256-YyMTf3URDL/otKdKgtoMChu4vfVL3vCMkRqpGifhUn0=",

View file

@ -3,7 +3,7 @@
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
unstable.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
# https://nixos.wiki/wiki/Impermanence # https://nixos.wiki/wiki/Impermanence
impermanence.url = "github:nix-community/impermanence"; impermanence.url = "github:nix-community/impermanence";
@ -11,14 +11,23 @@
simple-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-23.05"; simple-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-23.05";
}; };
outputs = { self, nixpkgs, ... }@attrs: let outputs = { self, nixpkgs, nixpkgs-unstable, nixops, ... }@attrs: let
system = "x86_64-linux";
overlay-unstable = final: prev: {
unstable = import nixpkgs-unstable {
inherit system;
config.allowUnfree = true;
};
};
user = "user"; # Select user from the `./users` directory user = "user"; # Select user from the `./users` directory
in { in {
# Media homeserver # Media homeserver
nixosConfigurations.homeserver = nixpkgs.lib.nixosSystem { nixosConfigurations.homeserver = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; inherit system;
specialArgs = attrs; specialArgs = attrs;
modules = [ modules = [
({ config, pkgs, ...}: { nixpkgs.overlays = [ overlay-unstable ]; })
./users/${user}.nix ./users/${user}.nix
./systems/homeserver.nix ./systems/homeserver.nix
]; ];
@ -26,9 +35,10 @@
# dirae.org # dirae.org
nixosConfigurations.dirae = nixpkgs.lib.nixosSystem { nixosConfigurations.dirae = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; inherit system;
specialArgs = attrs; specialArgs = attrs;
modules = [ modules = [
({ config, pkgs, ...}: { nixpkgs.overlays = [ overlay-unstable ]; })
./users/${user}.nix ./users/${user}.nix
./systems/dirae.nix ./systems/dirae.nix
]; ];
@ -36,9 +46,10 @@
# Debugging VM configuration # Debugging VM configuration
nixosConfigurations.qemu-vm = nixpkgs.lib.nixosSystem { nixosConfigurations.qemu-vm = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; inherit system;
specialArgs = attrs; specialArgs = attrs;
modules = [ modules = [
({ config, pkgs, ...}: { nixpkgs.overlays = [ overlay-unstable ]; })
./users/${user}.nix ./users/${user}.nix
./systems/qemu-vm.nix ./systems/qemu-vm.nix
]; ];

View file

@ -0,0 +1,56 @@
{ pkgs, config, lib, ... }: let
# theme = builtins.fetchurl {
# url = "";
# sha256 = "";
# };
in
{
# systemd.services.gitea.preStart = lib.mkAfter ''
# mkdir -p ${config.services.gitea.stateDir}/custom/public/css
# cp -f ${theme} ${config.services.gitea.stateDir}/custom/public/css/
# '';
services.gitea = {
enable = true;
package = pkgs.forgejo;
appName = "git.dirae.org";
settings = {
service = {
DISABLE_REGISTRATION = true;
};
server = {
DOMAIN = "git.dirae.org";
ROOT_URL = "https://git.dirae.org";
HTTP_PORT = 3001;
};
ui = {
THEMES = ''
forgejo-auto,forgejo-light,forgejo-dark,auto,gitea,arc-green
'';
DEFAULT_THEME = "forgejo-dark";
};
repository = {
DEFAULT_BRANCH = "master";
};
};
database = {
type = "postgres";
passwordFile = "/var/keys/gitea/db";
};
};
services.postgresql = {
enable = true;
authentication = ''
local gitea all ident map=gitea-users
'';
identMap = ''
gitea-users gitea gitea
'';
};
}

View file

@ -8,6 +8,7 @@
# Server is running on limited budet :,) # Server is running on limited budet :,)
# https://docs.gitlab.com/omnibus/settings/memory_constrained_envs.html # https://docs.gitlab.com/omnibus/settings/memory_constrained_envs.html
puma.workers = 0; puma.workers = 0;
puma.threadsMax = 1;
user = "gitlab"; user = "gitlab";
group = "gitlab"; group = "gitlab";

View file

@ -20,6 +20,14 @@ in {
recommendedTlsSettings = true; recommendedTlsSettings = true;
virtualHosts = { virtualHosts = {
"caem.dev" = {
enableACME = true;
forceSSL = true;
locations."/" = {
root = "/var/www/caem";
};
};
"dirae.org" = { "dirae.org" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
@ -35,14 +43,19 @@ in {
}; };
"gitlab.dirae.org" = { "git.dirae.org" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations."/" = { locations."/".proxyPass = "http://127.0.0.1:3001";
proxyPass = "http://unix:/run/gitlab/gitlab-workhorse.socket";
}; };
}; # "gitlab.dirae.org" = {
# enableACME = true;
# forceSSL = true;
# locations."/" = {
# proxyPass = "http://unix:/run/gitlab/gitlab-workhorse.socket";
# };
# };
}; };
}; };
} }

View file

@ -1,6 +1,6 @@
# Common configuration for all systems # Common configuration for all systems
{ ... }: { pkgs, ... }:
{ {
nix = { nix = {

View file

@ -10,7 +10,8 @@
../packages/sshd/package.nix ../packages/sshd/package.nix
../packages/mailserver/package.nix ../packages/mailserver/package.nix
../packages/nginx/dirae.nix ../packages/nginx/dirae.nix
../packages/gitlab/package.nix # ../packages/gitlab/package.nix
../packages/forgejo/dirae.nix
../packages/synapse/package.nix ../packages/synapse/package.nix
]; ];