feat: move colmena.nix to flake.nix and create flake.lock

This also includes some little syntactical fixes.

The commit is needed since colmena works mostly with nix' flake
experiemental feature. It attempts to find a locked version of nixpkgs,
which wasn't there yet. By using the standard name "flake.nix", nix
automatically picks up the file and generates a `flake.lock` if it
doesn't exist yet. This brings us one step closer to a buildable system.
This commit is contained in:
aviac 2025-04-24 17:21:13 +02:00
parent afa822b777
commit e0f3e2fe79
No known key found for this signature in database
GPG key ID: 644781002BDEA982
3 changed files with 81 additions and 33 deletions

View file

@ -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";
};
};
};
}

27
flake.lock Normal file
View 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
View 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 ];
};
};
};
}