From: Michal Sojka Date: Tue, 13 Oct 2020 21:25:40 +0000 (+0200) Subject: Add basic Nix support X-Git-Tag: 20201217~8 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/novaboot.git/commitdiff_plain/5cd063dd1620e3b7d9f045044d2b840f1f9f8848 Add basic Nix support --- diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..234251c --- /dev/null +++ b/.envrc @@ -0,0 +1,3 @@ +PATH_add . +PATH_add server +eval "$(lorri direnv)" diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..da91545 --- /dev/null +++ b/default.nix @@ -0,0 +1,24 @@ +{ + nixpkgs ? , + pkgs ? import nixpkgs {} +}: +with pkgs; +let + IO-Stty = buildPerlPackage { + pname = "IO-Stty"; + version = "0.04"; + src = fetchurl { + url = "mirror://cpan/authors/id/T/TO/TODDR/IO-Stty-0.04.tar.gz"; + sha256 = "1hjicqy50mgbippn310k4zclr9ksz05yyg81za3q4gb9m3qhk5aw"; + }; + }; + perlEnv = (perl.withPackages (p: [ p.Expect IO-Stty ])); +in +stdenv.mkDerivation { + name = "novaboot"; + src = builtins.fetchGit { url = ./.; }; + buildInputs = [ perlEnv rsync ]; + installPhase = '' + make install DESTDIR=$out PREFIX= + ''; +} diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..3c23349 --- /dev/null +++ b/shell.nix @@ -0,0 +1,7 @@ +{ pkgs ? import {} }: +with pkgs; +mkShell { + # this will make all the build inputs from hello and gnutar + # available to the shell environment + buildInputs = [ (perl.withPackages (p: [ p.PodParser ])) ]; +}