From f537f9a2d8094b44d73621c112b2645eed024694 Mon Sep 17 00:00:00 2001 From: xenia Date: Thu, 1 Feb 2024 20:54:27 +0100 Subject: [PATCH] flakeify --- .envrc | 1 + flake.lock | 126 +++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 28 ++++++++++++ 3 files changed, 155 insertions(+) create mode 100644 .envrc create mode 100644 flake.lock create mode 100644 flake.nix 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/flake.lock b/flake.lock new file mode 100644 index 0000000..e0b5e61 --- /dev/null +++ b/flake.lock @@ -0,0 +1,126 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "fox32asm": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1706972401, + "narHash": "sha256-HrbsibEnxC8va3LJhA6B8fDabxFRcmTk1or2pOKxlYo=", + "ref": "refs/heads/main", + "rev": "bfd40db93b6cc5ec67517286e6c32a5bd8ecc702", + "revCount": 67, + "type": "git", + "url": "https://githug.xyz/xenia/fox32asm" + }, + "original": { + "type": "git", + "url": "https://githug.xyz/xenia/fox32asm" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1697009197, + "narHash": "sha256-viVRhBTFT8fPJTb1N3brQIpFZnttmwo3JVKNuWRVc3s=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "01441e14af5e29c9d27ace398e6dd0b293e25a54", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1697009197, + "narHash": "sha256-viVRhBTFT8fPJTb1N3brQIpFZnttmwo3JVKNuWRVc3s=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "01441e14af5e29c9d27ace398e6dd0b293e25a54", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "fox32asm": "fox32asm", + "nixpkgs": "nixpkgs_2" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "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..c60c1b4 --- /dev/null +++ b/flake.nix @@ -0,0 +1,28 @@ +{ + description = "fox32rom"; + + inputs = { + fox32asm.url = "git+https://githug.xyz/xenia/fox32asm"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, fox32asm, flake-utils }: + flake-utils.lib.eachDefaultSystem (sys: + let pkgs = nixpkgs.legacyPackages.${sys}; + asm = fox32asm.packages.${sys}.default; + fox32rom = pkgs.runCommand "fox32rom" {} '' + cp -r ${./.}/* ./ + mkdir -p $out/bin + ${asm}/bin/fox32asm ./main.asm $out/bin/fox32.rom + ''; + + in rec { + packages.fox32rom = fox32rom; + packages.default = fox32rom; + + devShells.default = pkgs.mkShell { + packages = [ asm ]; + }; + } + ); +}