Split into flakes + common colmena file
This commit is contained in:
parent
9504c73ca9
commit
00db3ff974
8 changed files with 185 additions and 195 deletions
33
colmena.nix
Normal file
33
colmena.nix
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
{
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
|
||||||
|
};
|
||||||
|
outputs = { nixpkgs, ... }: {
|
||||||
|
colmena = {
|
||||||
|
meta = {
|
||||||
|
nixpkgs = import nixpkgs {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
overlays = [];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# needed ?
|
||||||
|
#
|
||||||
|
# deployment = {
|
||||||
|
# targetHost = "somehost.tld";
|
||||||
|
# targetPort = 1234;
|
||||||
|
# targetUser = "luser";
|
||||||
|
# };
|
||||||
|
|
||||||
|
git-system = { name, nodes, pkgs, ... }: {
|
||||||
|
import = "git_system.nix";
|
||||||
|
};
|
||||||
|
runner-system = { name, nodes, pkgs, ... }: {
|
||||||
|
import = "runner_system.nix";
|
||||||
|
};
|
||||||
|
dev-system = { name, nodes, pkgs, ... }: {
|
||||||
|
import = "dev_system.nix";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -11,13 +11,12 @@ let
|
||||||
srv = cfg.settings.server;
|
srv = cfg.settings.server;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
system.stateVersion = "24.11";
|
imports = [
|
||||||
|
"shared/system.nix"
|
||||||
nix = {
|
"shared/dev_user.nix"
|
||||||
settings = {
|
"shared/docker.nix"
|
||||||
experimental-features = [ "nix-command" "flakes" ];
|
"shared/ssh.nix"
|
||||||
};
|
];
|
||||||
};
|
|
||||||
|
|
||||||
users.users = {
|
users.users = {
|
||||||
# connection only via ssh key
|
# connection only via ssh key
|
||||||
|
@ -28,34 +27,5 @@ in
|
||||||
extraGroups = [ "docker" ];
|
extraGroups = [ "docker" ];
|
||||||
openssh.authorizedKeys.keys = [ "TODO" ];
|
openssh.authorizedKeys.keys = [ "TODO" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# connection only via hashed password;
|
|
||||||
dev = {
|
|
||||||
isNormalUser = true;
|
|
||||||
home = "/home/dev";
|
|
||||||
description = "User used to manually connect to this system (e.g. for maintenance)";
|
|
||||||
extraGroups = [ "docker" "wheel" ];
|
|
||||||
hashesPassword = "TODO";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
git
|
|
||||||
];
|
|
||||||
|
|
||||||
virtualisation.docker = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
services = {
|
|
||||||
endlessh = {
|
|
||||||
enable = true;
|
|
||||||
port = 22;
|
|
||||||
};
|
|
||||||
|
|
||||||
openssh = {
|
|
||||||
enable = true;
|
|
||||||
ports = [ 23 ];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
|
@ -11,49 +11,19 @@ let
|
||||||
srv = cfg.settings.server;
|
srv = cfg.settings.server;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
system.stateVersion = "24.11";
|
imports = [
|
||||||
|
"shared/system.nix"
|
||||||
nix = {
|
"shared/dev_user.nix"
|
||||||
settings = {
|
"shared/docker.nix"
|
||||||
experimental-features = [ "nix-command" "flakes" ];
|
"shared/ssh.nix"
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
git
|
|
||||||
];
|
];
|
||||||
|
|
||||||
users.users = {
|
|
||||||
# connection only via hashed password;
|
|
||||||
dev = {
|
|
||||||
isNormalUser = true;
|
|
||||||
home = "/home/dev";
|
|
||||||
description = "User used to manually connect to this system (e.g. for maintenance)";
|
|
||||||
extraGroups = [ "docker" "wheel" ];
|
|
||||||
hashesPassword = "TODO";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
virtualisation.docker = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
security.acme = {
|
security.acme = {
|
||||||
defaults.email = "michael.huebner@ptspaper.de";
|
defaults.email = "michael.huebner@ptspaper.de";
|
||||||
acceptTerms = true;
|
acceptTerms = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
endlessh = {
|
|
||||||
enable = true;
|
|
||||||
port = 22;
|
|
||||||
};
|
|
||||||
|
|
||||||
openssh = {
|
|
||||||
enable = true;
|
|
||||||
ports = [ 23 ];
|
|
||||||
};
|
|
||||||
|
|
||||||
nginx = {
|
nginx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
virtualHosts.${srv.DOMAIN} = {
|
virtualHosts.${srv.DOMAIN} = {
|
||||||
|
|
|
@ -11,45 +11,14 @@ let
|
||||||
srv = cfg.settings.server;
|
srv = cfg.settings.server;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
system.stateVersion = "24.11";
|
imports = [
|
||||||
|
"shared/system.nix"
|
||||||
nix = {
|
"shared/dev_user.nix"
|
||||||
settings = {
|
"shared/docker.nix"
|
||||||
experimental-features = [ "nix-command" "flakes" ];
|
"shared/ssh.nix"
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
git
|
|
||||||
forgejo-runner
|
|
||||||
];
|
];
|
||||||
|
|
||||||
users.users = {
|
|
||||||
# connection only via hashed password;
|
|
||||||
dev = {
|
|
||||||
isNormalUser = true;
|
|
||||||
home = "/home/dev";
|
|
||||||
description = "User used to manually connect to this system (e.g. for maintenance)";
|
|
||||||
extraGroups = [ "docker" "wheel" ];
|
|
||||||
hashesPassword = "TODO";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
virtualisation.docker = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
endlessh = {
|
|
||||||
enable = true;
|
|
||||||
port = 22;
|
|
||||||
};
|
|
||||||
|
|
||||||
openssh = {
|
|
||||||
enable = true;
|
|
||||||
ports = [ 23 ];
|
|
||||||
};
|
|
||||||
|
|
||||||
# TODO: forgejo runner
|
# TODO: forgejo runner
|
||||||
gitea-actions-runner = {
|
gitea-actions-runner = {
|
||||||
package = pkgs.forgejo-actions-runner;
|
package = pkgs.forgejo-actions-runner;
|
||||||
|
|
13
shared/dev_user.nix
Normal file
13
shared/dev_user.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
{
|
||||||
|
users.users = {
|
||||||
|
# connection only via hashed password;
|
||||||
|
dev = {
|
||||||
|
isNormalUser = true;
|
||||||
|
home = "/home/dev";
|
||||||
|
description = "User used to manually connect to this system (e.g. for maintenance)";
|
||||||
|
extraGroups = [ "docker" "wheel" ];
|
||||||
|
hashesPassword = "TODO";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
6
shared/docker.nix
Normal file
6
shared/docker.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
{
|
||||||
|
virtualisation.docker = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
14
shared/ssh.nix
Normal file
14
shared/ssh.nix
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
{
|
||||||
|
services = {
|
||||||
|
endlessh = {
|
||||||
|
enable = true;
|
||||||
|
port = 22;
|
||||||
|
};
|
||||||
|
|
||||||
|
openssh = {
|
||||||
|
enable = true;
|
||||||
|
ports = [ 23 ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
15
shared/system.nix
Normal file
15
shared/system.nix
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
{
|
||||||
|
system = "x86_64-linux";
|
||||||
|
system.stateVersion = "24.11";
|
||||||
|
|
||||||
|
nix = {
|
||||||
|
settings = {
|
||||||
|
experimental-features = [ "nix-command" "flakes" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
git
|
||||||
|
];
|
||||||
|
}
|
Loading…
Reference in a new issue