diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..c446f3f --- /dev/null +++ b/flake.lock @@ -0,0 +1,58 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1701358942, + "narHash": "sha256-WbDNvkhN7YDDXmcYOYKddaD3He9Aj1A8bYTwCanmIFY=", + "path": "/nix/store/si9vvhirdspdin8wwkvdklyp37pk6pjr-source", + "rev": "8abf7c04993d786f5561d1c3ce35d0ebbc61ad1d", + "type": "path" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "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..21e41fc --- /dev/null +++ b/flake.nix @@ -0,0 +1,43 @@ +{ + description = "Linux software for SF100/SF600"; + + inputs.flake-utils.url = "github:numtide/flake-utils"; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { + inherit system; + overlays = [ self.overlays.default ]; + }; + in { + + legacyPackages = pkgs; + + packages = { + inherit (pkgs) sf100; + default = pkgs.sf100; + }; + + formatter = pkgs.nixfmt; + }) // { + overlays.default = final: prev: { + sf100 = final.callPackage ({ stdenv, gnumake, pkg-config, libusb }: + stdenv.mkDerivation { + pname = "sf100"; + version = "unstable"; + + src = ./.; + + nativeBuildInputs = [ gnumake pkg-config ]; + buildInputs = [ libusb ]; + + installPhase = '' + install -Dv -m 0755 dpcmd $out/bin/dpcmd + install -Dv -m 0644 ChipInfoDb.dedicfg $out/share/DediProg/ChipInfoDb.dedicfg + install -Dv -m 0644 60-dediprog.rules $out/lib/udev/rules.d/60-dediprog.rules + ''; + }) { }; + }; + }; +}