From c0798513c7cb6b167d4fad13b585b7552660ae43 Mon Sep 17 00:00:00 2001 From: Jeremy Wall Date: Sat, 14 May 2022 16:46:02 -0400 Subject: [PATCH] nix flake --- flake.lock | 129 +++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 11 +++-- result | 1 + 3 files changed, 138 insertions(+), 3 deletions(-) create mode 100644 flake.lock create mode 120000 result diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..ff5c22b --- /dev/null +++ b/flake.lock @@ -0,0 +1,129 @@ +{ + "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1650374568, + "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "b4a34015c698c7793d592d66adbab377907a2be8", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "locked": { + "lastModified": 1652372896, + "narHash": "sha256-lURGussfF3mGrFPQT3zgW7+RC0pBhbHzco0C7I+ilow=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "0d347c56f6f41de822a4f4c7ff5072f3382db121", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "locked": { + "lastModified": 1637014545, + "narHash": "sha256-26IZAc5yzlD9FlDT54io1oqG/bBoyka+FJk5guaX4x4=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "bba5dcc8e0b20ab664967ad83d24d64cb64ec4f4", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "naersk": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1651574473, + "narHash": "sha256-wQhFORvRjo8LB2hTmETmv6cbyKGDPbfWqvZ/0chnDE4=", + "owner": "nix-community", + "repo": "naersk", + "rev": "f21309b38e1da0d61b881b6b6d41b81c1aed4e1d", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "naersk", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1652252629, + "narHash": "sha256-SvT64apetqc8P5nYp1/fOZvUmHUPdPFUZbhSpKy+1aI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d2fc6856824cb87742177eefc8dd534bdb6c3439", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1652487699, + "narHash": "sha256-2RajAmUE+13kBh7ToxJC5ZpTYuJopZPMZig4hErZcBk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "be2ceab96f3aee5e586a427a2d28331ccbd4c7da", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "naersk": "naersk", + "nixpkgs": "nixpkgs_2", + "rust-overlay": "rust-overlay" + } + }, + "rust-overlay": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1652410199, + "narHash": "sha256-R9pEim8k6GIYadmyTRh2jpvUDkFJ857DhUwdnJUCf/o=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "fe0bc0004e5db3f8034021b4968b26b29fd9edef", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index 849def0..f3604dd 100644 --- a/flake.nix +++ b/flake.nix @@ -21,14 +21,19 @@ overlays = [ rust-overlay.overlay ]; pkgs = import nixpkgs { inherit system overlays; }; naersk-lib = naersk.lib."${system}"; - in - { - defaultPackage = with pkgs; + ucg = with pkgs; naersk-lib.buildPackage rec { pname = "ucg"; version = "0.7.2"; src = ./.; cargoBuildOptions = opts: opts ++ ["-p" "${pname}" ]; }; + in + { + defaultPackage = ucg; + defaultApp = { + type = "app"; + program = "${ucg}/bin/ucg"; + }; }); } \ No newline at end of file diff --git a/result b/result new file mode 120000 index 0000000..7d18aac --- /dev/null +++ b/result @@ -0,0 +1 @@ +/nix/store/v90fwz0dfbnlghwkhahfq5fjd8yk39m7-ucg-0.7.2 \ No newline at end of file