diff options
author | Zhongheng Liu <z.liu@outlook.com.gr> | 2025-03-30 21:39:46 +0300 |
---|---|---|
committer | Zhongheng Liu <z.liu@outlook.com.gr> | 2025-03-30 21:39:46 +0300 |
commit | f286d56b74c9fcc36da3dd5e4f73be28484c57a3 (patch) | |
tree | 69e12590fbffb841ed0ebefc8e002d71071505af | |
download | nix-templates-f286d56b74c9fcc36da3dd5e4f73be28484c57a3.tar.gz nix-templates-f286d56b74c9fcc36da3dd5e4f73be28484c57a3.tar.bz2 nix-templates-f286d56b74c9fcc36da3dd5e4f73be28484c57a3.zip |
init template flake
-rw-r--r-- | flake.nix | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..745235b --- /dev/null +++ b/flake.nix @@ -0,0 +1,43 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + systems.url = "github:nix-systems/default"; + devenv.url = "github:cachix/devenv"; + devenv.inputs.nixpkgs.follows = "nixpkgs"; + }; + + nixConfig = { + extra-trusted-public-keys = + "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="; + extra-substituters = "https://devenv.cachix.org"; + }; + + outputs = { self, nixpkgs, devenv, systems, ... }@inputs: + let forEachSystem = nixpkgs.lib.genAttrs (import systems); + in { + packages = forEachSystem (system: { + devenv-up = self.devShells.${system}.default.config.procfileScript; + devenv-test = self.devShells.${system}.default.config.test; + }); + + devShells = forEachSystem (system: + let pkgs = nixpkgs.legacyPackages.${system}; + in { + default = devenv.lib.mkShell { + inherit inputs pkgs; + modules = [rec { + # https://devenv.sh/reference/options/ + packages = with pkgs; [ + hello + ]; + enterShell = '' + hello + ''; + env = { LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath packages; }; + languages.rust = { enable = true; }; + processes.hello.exec = "hello"; + }]; + }; + }); + }; +} |