diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..581619f --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1707092692, + "narHash": "sha256-ZbHsm+mGk/izkWtT4xwwqz38fdlwu7nUUKXTOmm4SyE=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "faf912b086576fd1a15fca610166c98d47bc667e", + "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 index 8388228..2db174c 100644 --- a/flake.nix +++ b/flake.nix @@ -5,23 +5,24 @@ nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; }; - outputs = { self, nixpkgs, stdenv } @inputs: + outputs = { self, nixpkgs } @inputs: let system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; - lib = pkgs.lib; + lib = nixpkgs.lib; in { - packages.${system}.default = { + packages.${system}.default = pkgs.stdenv.mkDerivation rec { pname = "Sample Package"; version = "1.0"; # Fetch sources. - src = fetchGit { - url = "https://git.voronind.com/voronind/nixos_sample_package.git"; + src = pkgs.fetchurl { + url = "https://git.voronind.com/voronind/nixos_sample_package/archive/v1.tar.gz"; + hash = "sha256-zAXcCiRqOgMBChqabFjCmAaux1Yb9N+Y5jcE22zT3OI="; }; # Bins go here. - nativeBuildInputs = [ + nativeBuildInputs = with pkgs; [ cargo rustc ]; @@ -36,8 +37,8 @@ ''; installPhase = '' - mkdir -p ${out}/bin - cp target/release/nixos_sample_package ${out}/bin + mkdir -p $out/bin + cp target/release/nixos_sample_package $out/bin ''; }; };