]> rtime.felk.cvut.cz Git - novaboot.git/commitdiff
Add basic Nix support
authorMichal Sojka <michal.sojka@cvut.cz>
Tue, 13 Oct 2020 21:25:40 +0000 (23:25 +0200)
committerMichal Sojka <michal.sojka@cvut.cz>
Tue, 13 Oct 2020 21:25:40 +0000 (23:25 +0200)
.envrc [new file with mode: 0644]
default.nix [new file with mode: 0644]
shell.nix [new file with mode: 0644]

diff --git a/.envrc b/.envrc
new file mode 100644 (file)
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 (file)
index 0000000..da91545
--- /dev/null
@@ -0,0 +1,24 @@
+{
+  nixpkgs ? <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 (file)
index 0000000..3c23349
--- /dev/null
+++ b/shell.nix
@@ -0,0 +1,7 @@
+{ pkgs ? import <nixpkgs> {} }:
+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 ])) ];
+}