Compare commits
4 commits
afa822b777
...
58e1796853
Author | SHA1 | Date | |
---|---|---|---|
58e1796853 | |||
cdd41f9979 | |||
7600b36484 | |||
e0f3e2fe79 |
12 changed files with 287 additions and 189 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -62,6 +62,3 @@ $RECYCLE.BIN/
|
|||
*.lnk
|
||||
|
||||
# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,windows,linux
|
||||
|
||||
|
||||
*.pw
|
33
colmena.nix
33
colmena.nix
|
@ -1,33 +0,0 @@
|
|||
{
|
||||
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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -5,17 +5,24 @@
|
|||
# NixOS-WSL specific options are documented on the NixOS-WSL repository:
|
||||
# https://github.com/nix-community/NixOS-WSL
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.services.forgejo;
|
||||
srv = cfg.settings.server;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
"shared/system.nix"
|
||||
"shared/dev_user.nix"
|
||||
"shared/docker.nix"
|
||||
"shared/ssh.nix"
|
||||
./shared/system.nix
|
||||
./shared/dev_user.nix
|
||||
./shared/docker.nix
|
||||
./shared/ssh.nix
|
||||
|
||||
./dummy-hardware.nix
|
||||
];
|
||||
|
||||
users.users = {
|
||||
|
@ -29,3 +36,4 @@ in
|
|||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
0
dev_user_password.pw
Normal file
0
dev_user_password.pw
Normal file
14
dummy-hardware.nix
Normal file
14
dummy-hardware.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
# TODO: Copy paste after install nixos, this should include `hardware-configuration.nix`s contents
|
||||
{
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/bazqux";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/foobar";
|
||||
fsType = "vfat";
|
||||
};
|
||||
}
|
|
@ -2,4 +2,4 @@
|
|||
|
||||
openssl passwd -6 $1 > dev_user_password.pw
|
||||
|
||||
colmena apply -f colmena.nix
|
||||
colmena apply
|
||||
|
|
27
flake.lock
Normal file
27
flake.lock
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1745279238,
|
||||
"narHash": "sha256-AQ7M9wTa/Pa/kK5pcGTgX/DGqMHyzsyINfN7ktsI7Fo=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "9684b53175fc6c09581e94cc85f05ab77464c7e3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-24.11",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
54
flake.nix
Normal file
54
flake.nix
Normal file
|
@ -0,0 +1,54 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
|
||||
};
|
||||
|
||||
outputs =
|
||||
{ nixpkgs, ... }:
|
||||
{
|
||||
colmena = {
|
||||
meta = {
|
||||
nixpkgs = import nixpkgs {
|
||||
system = "x86_64-linux";
|
||||
overlays = [ ];
|
||||
};
|
||||
};
|
||||
|
||||
git-system =
|
||||
{
|
||||
name,
|
||||
nodes,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
deployment = {
|
||||
targetHost = "somehost.tld";
|
||||
targetPort = 1234;
|
||||
targetUser = "luser";
|
||||
};
|
||||
imports = [ ./git_system.nix ];
|
||||
};
|
||||
runner-system =
|
||||
{
|
||||
name,
|
||||
nodes,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [ ./runner_system.nix ];
|
||||
};
|
||||
dev-system =
|
||||
{
|
||||
name,
|
||||
nodes,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [ ./dev_system.nix ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -5,17 +5,22 @@
|
|||
# NixOS-WSL specific options are documented on the NixOS-WSL repository:
|
||||
# https://github.com/nix-community/NixOS-WSL
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.services.forgejo;
|
||||
srv = cfg.settings.server;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
"shared/system.nix"
|
||||
"shared/dev_user.nix"
|
||||
"shared/docker.nix"
|
||||
"shared/ssh.nix"
|
||||
./shared/system.nix
|
||||
./shared/dev_user.nix
|
||||
./shared/docker.nix
|
||||
./shared/ssh.nix
|
||||
];
|
||||
|
||||
programs = {
|
||||
|
@ -86,10 +91,10 @@ in
|
|||
persistRepoData = true;
|
||||
platform = "forgejo";
|
||||
autodiscover = true;
|
||||
onboardingConfig= {
|
||||
extends= ["config:recommended"];
|
||||
onboardingConfig = {
|
||||
extends = [ "config:recommended" ];
|
||||
};
|
||||
prCommitsPerRunLimit= 0;
|
||||
prCommitsPerRunLimit = 0;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -101,3 +106,4 @@ in
|
|||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -5,17 +5,22 @@
|
|||
# NixOS-WSL specific options are documented on the NixOS-WSL repository:
|
||||
# https://github.com/nix-community/NixOS-WSL
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.services.forgejo;
|
||||
srv = cfg.settings.server;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
"shared/system.nix"
|
||||
"shared/dev_user.nix"
|
||||
"shared/docker.nix"
|
||||
"shared/ssh.nix"
|
||||
./shared/system.nix
|
||||
./shared/dev_user.nix
|
||||
./shared/docker.nix
|
||||
./shared/ssh.nix
|
||||
];
|
||||
|
||||
services = {
|
||||
|
@ -32,7 +37,8 @@ in
|
|||
"ubuntu-22.04:docker://node:16-bullseye"
|
||||
"ubuntu-20.04:docker://node:16-bullseye"
|
||||
];
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
{
|
||||
users.users = {
|
||||
# connection only via hashed password;
|
||||
|
@ -6,8 +12,12 @@
|
|||
isNormalUser = true;
|
||||
home = "/home/dev";
|
||||
description = "User used to manually connect to this system (e.g. for maintenance)";
|
||||
extraGroups = [ "docker" "wheel" ];
|
||||
hashedPasswordFile = "dev_user_password.pw";
|
||||
}
|
||||
extraGroups = [
|
||||
"docker"
|
||||
"wheel"
|
||||
];
|
||||
hashedPassword = "${builtins.readFile ./../dev_user_password.pw}";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +1,19 @@
|
|||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
{
|
||||
system = "x86_64-linux";
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
{
|
||||
system.stateVersion = "24.11";
|
||||
|
||||
nix = {
|
||||
settings = {
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -13,3 +21,4 @@
|
|||
git
|
||||
];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue