diff --git a/.gitignore b/.gitignore index 4f8b199..1a4130a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ # Compilation artifacts /target +/result # Profiling perf.data* diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..bfbe9ef --- /dev/null +++ b/default.nix @@ -0,0 +1,13 @@ +{ + rustPlatform, + fontconfig, + libxkbcommon, + pkg-config, +}: +rustPlatform.buildRustPackage { + src = ./.; + name = "kickoff"; + buildInputs = [fontconfig libxkbcommon]; + nativeBuildInputs = [pkg-config]; + cargoLock.lockFile = ./Cargo.lock; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..69125b4 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1768564909, + "narHash": "sha256-Kell/SpJYVkHWMvnhqJz/8DqQg2b6PguxVWOuadbHCc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "e4bae1bd10c9c57b2cf517953ab70060a828ee6f", + "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 new file mode 100644 index 0000000..45ffdfa --- /dev/null +++ b/flake.nix @@ -0,0 +1,28 @@ +{ + description = "A very basic flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + }; + + outputs = { + self, + nixpkgs, + }: let + pkgs = nixpkgs.legacyPackages."x86_64-linux"; + in { + devShells."x86_64-linux".default = pkgs.mkShell { + buildInput = with pkgs; [ + cargo + rustc + rustfmt + clippy + rust-analyzer + fontconfig + libxkbcommon + ]; + env.RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}"; + }; + packages.x86_64-linux.default = pkgs.callPackage ./default.nix {}; + }; +} diff --git a/result b/result new file mode 120000 index 0000000..4437430 --- /dev/null +++ b/result @@ -0,0 +1 @@ +/nix/store/ysbvwa6dw06jaslys3sfnc8pvmcx55sp-kickoff \ No newline at end of file