summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan McFarlane <i.mcfarlane2002@gmail.com>2025-03-27 15:01:55 -0400
committerIan McFarlane <i.mcfarlane2002@gmail.com>2025-03-27 15:01:55 -0400
commitb4a88625672a2c2fc2703abed5d8565b95b86b1d (patch)
treeb60ba960ebf5c2f0a35fe1a32ed3da9febee2129
parentcpu_reset prints at start, not usefull (diff)
downloadcomus-b4a88625672a2c2fc2703abed5d8565b95b86b1d.tar.gz
comus-b4a88625672a2c2fc2703abed5d8565b95b86b1d.tar.bz2
comus-b4a88625672a2c2fc2703abed5d8565b95b86b1d.zip
added flake environment
-rw-r--r--.envrc1
-rw-r--r--.gitignore2
-rw-r--r--flake.lock61
-rw-r--r--flake.nix39
4 files changed, 103 insertions, 0 deletions
diff --git a/.envrc b/.envrc
new file mode 100644
index 0000000..3550a30
--- /dev/null
+++ b/.envrc
@@ -0,0 +1 @@
+use flake
diff --git a/.gitignore b/.gitignore
index db16bde..091b943 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,4 @@
.zig-cache
bin
+.direnv/
+.cache/
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..bd68f68
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,61 @@
+{
+ "nodes": {
+ "flake-utils": {
+ "inputs": {
+ "systems": "systems"
+ },
+ "locked": {
+ "lastModified": 1731533236,
+ "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "type": "github"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1742889210,
+ "narHash": "sha256-hw63HnwnqU3ZQfsMclLhMvOezpM7RSB0dMAtD5/sOiw=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "698214a32beb4f4c8e3942372c694f40848b360d",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixos-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "flake-utils": "flake-utils",
+ "nixpkgs": "nixpkgs"
+ }
+ },
+ "systems": {
+ "locked": {
+ "lastModified": 1681028828,
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+ "owner": "nix-systems",
+ "repo": "default",
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-systems",
+ "repo": "default",
+ "type": "github"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..a136a17
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,39 @@
+{
+ description = "systems programming x86";
+
+ inputs = {
+ nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
+ flake-utils.url = "github:numtide/flake-utils";
+ };
+
+ outputs = {
+ nixpkgs,
+ flake-utils,
+ ...
+ }: let
+ supportedSystems = let
+ inherit (flake-utils.lib) system;
+ in [
+ system.aarch64-linux
+ system.x86_64-linux
+ ];
+ in
+ flake-utils.lib.eachSystem supportedSystems (system: let
+ pkgs = import nixpkgs {inherit system;};
+ in {
+ devShell =
+ pkgs.mkShell
+ {
+ packages = with pkgs; [
+ # (writeShellScriptBin "build" "zig build -Dcpu=baseline")
+ gnumake
+ gdb
+ valgrind
+ zig_0_14
+ qemu
+ ];
+ };
+
+ formatter = pkgs.alejandra;
+ });
+}