summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--README.md4
-rw-r--r--application/default.nix20
-rw-r--r--application/go.mod3
-rw-r--r--application/main.go9
-rw-r--r--configuration/configuration.nix5
-rw-r--r--flake.lock27
-rw-r--r--flake.nix37
7 files changed, 105 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..0669111
--- /dev/null
+++ b/README.md
@@ -0,0 +1,4 @@
+# specimen
+
+this is a practical coding test!
+hopefully you will find it to your liking :3
diff --git a/application/default.nix b/application/default.nix
new file mode 100644
index 0000000..18eb43a
--- /dev/null
+++ b/application/default.nix
@@ -0,0 +1,20 @@
+{
+  lib,
+  buildGoModule,
+  ...
+}:
+
+buildGoModule {
+  pname = "specimen";
+  version = "3.3.3";
+
+  src = ./.;
+  vendorHash = null;
+
+  meta = {
+    description = "specimen server application";
+    mainProgram = "specimen";
+    homepage = "https://git.rnrd.eu/specimen";
+    license = lib.licenses.unlicense;
+  };
+}
diff --git a/application/go.mod b/application/go.mod
new file mode 100644
index 0000000..1c08086
--- /dev/null
+++ b/application/go.mod
@@ -0,0 +1,3 @@
+module git.rnrd.eu/specimen
+
+go 1.23.4
diff --git a/application/main.go b/application/main.go
new file mode 100644
index 0000000..30de442
--- /dev/null
+++ b/application/main.go
@@ -0,0 +1,9 @@
+package main
+
+import (
+	"fmt"
+)
+
+func main() {
+	fmt.Println("hi! base setup works")
+}
diff --git a/configuration/configuration.nix b/configuration/configuration.nix
new file mode 100644
index 0000000..c7d053b
--- /dev/null
+++ b/configuration/configuration.nix
@@ -0,0 +1,5 @@
+{ ... }:
+
+{
+  # nothing here for now :)
+}
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..369a3b3
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,27 @@
+{
+  "nodes": {
+    "nixpkgs": {
+      "locked": {
+        "lastModified": 1735291276,
+        "narHash": "sha256-NYVcA06+blsLG6wpAbSPTCyLvxD/92Hy4vlY9WxFI1M=",
+        "owner": "nixos",
+        "repo": "nixpkgs",
+        "rev": "634fd46801442d760e09493a794c4f15db2d0cbb",
+        "type": "github"
+      },
+      "original": {
+        "owner": "nixos",
+        "ref": "nixos-unstable",
+        "repo": "nixpkgs",
+        "type": "github"
+      }
+    },
+    "root": {
+      "inputs": {
+        "nixpkgs": "nixpkgs"
+      }
+    }
+  },
+  "root": "root",
+  "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..7c225bb
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,37 @@
+{
+  description = ''
+    specimen, application and server configuration.
+    enjoy! :)
+  '';
+
+  inputs = {
+    nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
+  };
+
+  outputs = { self, nixpkgs }:
+  let
+    inherit (nixpkgs) lib;
+
+    name = "specimen";
+    systems = [ "x86_64-linux" "aarch64-linux" ];
+
+    pkgsForSystem = system: import nixpkgs { inherit system; };
+
+    forAllSystems = f: lib.genAttrs systems
+      (system: f { inherit system; pkgs = pkgsForSystem system; });
+  in
+  {
+    packages = forAllSystems ({ system, pkgs }: {
+      default = pkgs.callPackage ./application/. { };
+    });
+
+    nixosConfigurations = forAllSystems ({ system, pkgs }: {
+      ${name} = {
+        inherit system;
+        modules = [
+          ./configuration/configuration.nix
+        ];
+      };
+    });
+  };
+}