Split into flakes + common colmena file

This commit is contained in:
hodasemi 2025-04-03 11:48:30 +02:00
parent 9504c73ca9
commit 00db3ff974
8 changed files with 185 additions and 195 deletions

33
colmena.nix Normal file
View 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";
};
};
};
}

View file

@ -11,13 +11,12 @@ let
srv = cfg.settings.server;
in
{
system.stateVersion = "24.11";
nix = {
settings = {
experimental-features = [ "nix-command" "flakes" ];
};
};
imports = [
"shared/system.nix"
"shared/dev_user.nix"
"shared/docker.nix"
"shared/ssh.nix"
];
users.users = {
# connection only via ssh key
@ -28,34 +27,5 @@ in
extraGroups = [ "docker" ];
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 ];
};
};
}

View file

@ -11,49 +11,19 @@ let
srv = cfg.settings.server;
in
{
system.stateVersion = "24.11";
nix = {
settings = {
experimental-features = [ "nix-command" "flakes" ];
};
};
environment.systemPackages = with pkgs; [
git
imports = [
"shared/system.nix"
"shared/dev_user.nix"
"shared/docker.nix"
"shared/ssh.nix"
];
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 = {
defaults.email = "michael.huebner@ptspaper.de";
acceptTerms = true;
};
services = {
endlessh = {
enable = true;
port = 22;
};
openssh = {
enable = true;
ports = [ 23 ];
};
nginx = {
enable = true;
virtualHosts.${srv.DOMAIN} = {

View file

@ -11,45 +11,14 @@ let
srv = cfg.settings.server;
in
{
system.stateVersion = "24.11";
nix = {
settings = {
experimental-features = [ "nix-command" "flakes" ];
};
};
environment.systemPackages = with pkgs; [
git
forgejo-runner
imports = [
"shared/system.nix"
"shared/dev_user.nix"
"shared/docker.nix"
"shared/ssh.nix"
];
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 = {
endlessh = {
enable = true;
port = 22;
};
openssh = {
enable = true;
ports = [ 23 ];
};
# TODO: forgejo runner
gitea-actions-runner = {
package = pkgs.forgejo-actions-runner;

13
shared/dev_user.nix Normal file
View 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
View file

@ -0,0 +1,6 @@
{ config, lib, pkgs, modulesPath, ... }:
{
virtualisation.docker = {
enable = true;
};
}

14
shared/ssh.nix Normal file
View 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
View 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
];
}