about summary refs log tree commit diff
path: root/pkgs/profpatsch/nman
diff options
context:
space:
mode:
authorsternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org>2021-02-11 13:45:11 +0100
committersternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org>2021-02-11 13:45:11 +0100
commitc580b57a74e636ad8b896e3d1dfa2b5eade2d192 (patch)
treebc1ab726fa1f1eb0559af2f489b70d956bdeacbe /pkgs/profpatsch/nman
parent2ef1cd5892e410de952c99a25469fcec5a12461e (diff)
Revert "modules/user/sternenseemann/sway: fix startup by enabling opengl"
This reverts commit 5bd756eaf27882820cb59e0ecf9c305f08b3b3e3.

Committed more than I meant to.
Diffstat (limited to 'pkgs/profpatsch/nman')
-rw-r--r--pkgs/profpatsch/nman/default.nix15
-rw-r--r--pkgs/profpatsch/nman/nman.rs34
2 files changed, 13 insertions, 36 deletions
diff --git a/pkgs/profpatsch/nman/default.nix b/pkgs/profpatsch/nman/default.nix
index bb4b4544..96699833 100644
--- a/pkgs/profpatsch/nman/default.nix
+++ b/pkgs/profpatsch/nman/default.nix
@@ -1,3 +1,14 @@
-{ writeRustSimpleBin }:
+{ lib, runCommand, go }:
+
+runCommand "nman" {
+  meta = with lib; {
+    description = "Invoke manpage in temporary nix-shell";
+    license = licenses.gpl3;
+  };
+} ''
+    mkdir cache
+    env GOCACHE="$PWD/cache" \
+      ${lib.getBin go}/bin/go build -o nman ${./nman.go}
+    install -D nman $out/bin/nman
+''
 
-writeRustSimpleBin "nman" {} ./nman.rs
diff --git a/pkgs/profpatsch/nman/nman.rs b/pkgs/profpatsch/nman/nman.rs
deleted file mode 100644
index 16bd6271..00000000
--- a/pkgs/profpatsch/nman/nman.rs
+++ /dev/null
@@ -1,34 +0,0 @@
-#[derive(Debug)]
-enum DrvOutput<'a> {
-    Out,
-    Bin,
-    Lib,
-    Man,
-    Dev,
-    DevDoc,
-    DevMan,
-    Other(&'a [u8]),
-}
-
-#[derive(Debug)]
-struct DrvWithOutput<'a> {
-    drv_path: &'a [u8],
-    output: DrvOutput<'a>,
-}
-
-fn parse_drv_path<'a>(path: &'a [u8]) -> Option<DrvWithOutput<'a>> {
-    let mut split = path.split(|c| char::from(c.to_owned()) == '!');
-    split.next().map(|p| DrvWithOutput {
-        drv_path: p,
-        output: split.next().map(|s| DrvOutput::Other(s))
-                            .unwrap_or(DrvOutput::Out),
-    }).and_then(|parsed| match split.next() {
-        Some(_) => None,
-        None => Some(parsed),
-    })
-}
-
-fn main() -> std::io::Result<()> {
-    println!("{:?}", parse_drv_path(b"/nix/store/58i9psln992xjwk8ig1v3l3a4p9sslnp-lowdown-0.7.9.drv"));
-    Ok(())
-}