dasht: ship

This commit is contained in:
2024-11-03 17:25:55 +00:00
parent effd4094af
commit 243ae05a68
12 changed files with 40 additions and 52 deletions

View File

@@ -22,7 +22,6 @@
sane.roles.build-machine.enable = true;
sane.roles.client = true;
sane.roles.dev-machine = true;
sane.roles.pc = true;
sane.services.ollama.enable = true;
sane.services.wg-home.enable = true;

View File

@@ -5,7 +5,6 @@
];
sane.roles.client = true;
sane.roles.dev-machine = true;
sane.roles.pc = true;
sane.services.wg-home.enable = true;
sane.services.wg-home.ip = config.sane.hosts.by-name."lappy".wg-home.ip;

View File

@@ -7,6 +7,17 @@
# some services which use private directories error if the parent (/var/lib/private) isn't 700.
sane.fs."/var/lib/private".dir.acl.mode = "0700";
# allocate a proper /tmp fs, else its capacity will be limited as per impermanence defaults (i.e. 1 GB).
fileSystems."/tmp" = {
device = "none";
fsType = "tmpfs";
options = [
"mode=777"
"defaults"
];
};
# in-memory compressed RAM
# defaults to compressing at most 50% size of RAM
# claimed compression ratio is about 2:1

View File

@@ -187,6 +187,7 @@ in
];
pcConsoleUtils = declPackageSet [
"dasht" # docset documentation viewer
# "gh" # MS GitHub cli
"haredoc"
"nix-index"

View File

@@ -0,0 +1,9 @@
{ ... }:
{
sane.programs.dasht = {
suggestedPrograms = [ "docsets" ];
fs.".local/share/dasht/docsets".symlink.target = "/run/current-system/sw/share/docsets";
sandbox.method = null; #< TODO: sandbox!
};
}

View File

@@ -32,6 +32,7 @@
./cups.nix
./curl.nix
./curlftpfs.nix
./dasht.nix
./dbus.nix
./dconf.nix
./deadd-notification-center

View File

@@ -34,13 +34,13 @@ in {
];
});
in
"${toString withDocs}/share/docset"
"${toString withDocs}/share/docsets"
) cfg.config.rustPkgs;
# link only the docs (not any binaries)
postBuild = ''
mkdir -p $out/share/docset
mkdir -p $out/share/docsets
${lib.optionalString (cfg.config.rustPkgs != []) ''
mv $out/*.docset $out/share/docset
mv $out/*.docset $out/share/docsets
''}
'';
};
@@ -48,6 +48,12 @@ in {
};
environment.pathsToLink = lib.mkIf cfg.enabled [
"/share/docset"
"/share/docsets"
];
# populate a few default docsets
sane.programs.docsets.config.rustPkgs = [
"lemmy-server"
# "mx-sanebot"
];
}

View File

@@ -7,7 +7,7 @@
".cache/Zeal"
".local/share/Zeal"
];
fs.".local/share/Zeal/Zeal/docsets/system".symlink.target = "/run/current-system/sw/share/docset";
fs.".local/share/Zeal/Zeal/docsets/system".symlink.target = "/run/current-system/sw/share/docsets";
suggestedPrograms = [ "docsets" ];
};
}

View File

@@ -1,19 +1,9 @@
{ config, lib, ... }:
{ ... }:
{
imports = [
./build-machine.nix
./client
./dev-machine.nix
./handheld.nix
./pc.nix
];
fileSystems."/tmp" = lib.mkIf (config.sane.roles.build-machine.enable || config.sane.roles.dev-machine) {
device = "none";
fsType = "tmpfs";
options = [
"mode=777"
"defaults"
];
};
}

View File

@@ -1,29 +0,0 @@
{ config, lib, ... }:
let
cfg = config.sane.roles.dev-machine;
in
{
options.sane.roles.dev-machine = with lib; mkOption {
type = types.bool;
default = false;
description = ''
enable if this machine is used generally for "development"
and you want tools to support that (e.g. docs).
'';
};
config = with lib; mkMerge [
{
sane.programs.docsets.config.rustPkgs = [
# "lemmy-server"
# "mx-sanebot"
];
}
(mkIf cfg {
sane.programs.docsets.enableFor.system = true;
# sane.programs.ldd-aarch64.enableFor.user.colin = true; #< requires binfmt
# sane.programs.zeal.enableFor.user.colin = true;
})
];
}

View File

@@ -6,6 +6,6 @@ _cargoDocset() {
}
_cargoDocsetInstall() {
mkdir -p $out/share/docset
cp -R target/docset/* $out/share/docset/
mkdir -p $out/share/docsets
cp -R target/docset/* $out/share/docsets/
}

View File

@@ -1,6 +1,7 @@
{ makeSetupHook
, cargo
, cargo-docset
{
makeSetupHook,
cargo,
cargo-docset,
}:
makeSetupHook {
name = "cargo-docset-hook";