divnix / bud Goto Github PK
View Code? Open in Web Editor NEWEXPERIMENTAL -- A highly composable system ctl tool
License: MIT License
EXPERIMENTAL -- A highly composable system ctl tool
License: MIT License
Unfortunately, this initially depends on devos
having the new flake.lock reference to the updated digga
that is pending on divnix/digga#70
Moved from divnix/digga#375 because this happens with every bud
command I've tried.
On macOS/darwin systems, bud
should detect my system's hostname.
Running bud
commands on macOS 11.6 results in an error caused by calling hostname
with invalid options.
bud up --help
The output of bud up --help
also indicates bud
was not able to get a hostname, as the name is not included in the path mentioned in the usage section:
❯ bud up --help
hostname: illegal option -- -
usage: hostname [-fs] [name-of-host]
/nix/store/hzqrpf31gf060ka40hwpqpah79n54hgm-devshell-dir/bin/bud: line 8: -1: substring expression < 0
Usage: up Generate /path/to/repo/hosts//default.nix
Description:
bud --help
❯ bud --help
hostname: illegal option -- -
usage: hostname [-fs] [name-of-host]
/nix/store/hzqrpf31gf060ka40hwpqpah79n54hgm-devshell-dir/bin/bud: line 8: -1: substring expression < 0
...
bud repl
❯ bud repl
hostname: illegal option -- -
usage: hostname [-fs] [name-of-host]
/nix/store/hzqrpf31gf060ka40hwpqpah79n54hgm-devshell-dir/bin/bud: line 8: -1: substring expression < 0
Welcome to Nix version 2.4pre20210707_02dd6bb. Type :? for help.
Loading '/nix/store/q35fmyf6l8d5gc7khgmpqzj84q6l6wlj-repl.nix'...
Added 4 variables.
bud get
(via devos)DevOS' quick start guide suggests running the following command:
nix-shell https://github.com/divnix/devos/archive/master.tar.gz -A shell \
--run "bud get master"
This also results in a similar error:
...
created 129 symlinks in user environment
building '/nix/store/izybzyn94b2plalg380jzqq4nnqllsyl-nixos-entrypoint.drv'...
fatal: not a git repository (or any of the parent directories): .git
hostname: illegal option -- -
usage: hostname [-fs] [name-of-host]
/nix/store/83cv4fcjj56sch8z0njlrrf8wiv8kim2-devshell-dir/bin/bud: line 8: -1: substring expression < 0
11.09s user 30.55s system 5% cpu 13:06.38s total
On macOS, run any of the commands mentioned above.
I'm guessing Darwin's hostname
utility behaves differently than it would on NixOS or another Linux system.
This might also apply to other systems using the BSD utilities?
❯ which hostname
/bin/hostname
❯ hostname --help
hostname: illegal option -- -
usage: hostname [-fs] [name-of-host]
Considering divnix/digga#477 has been merged, the fate of bud
is written on the wall. Should the repo be archived now? Perhaps with a disclaimer in the README?
https://github.com/divnix/devos-ext-lib still appears to use it, for what it's worth.
https://github.com/divnix/digga/runs/2982005200#step:5:65 revealed that pkgs.nixos-install-tools
does not build on darwin.
Scripts like flk get
have domain knowledge of suites
a strict (but optional) digga
concept. Hence an argument can be made to move this command as a flkModule
back into digga
.
Review similar cases and take appropriate measures to normalize the code base.
This is a tracking issue for incremental change propositions that were brought up in pull request divnix/digga#41.
Here are the different possible changes that were brought up:
On a clean build of devos+bud that I provisioned last week I get the following:
❯ bud rebuild HOST boot
error: unrecognised flag '--extra-experimental-features'
bud is currently pinned to the main
branch:
❯ \grep -A 20 bud flake.lock
"bud": {
"inputs": {
"beautysh": "beautysh",
"devshell": [
"digga",
"devshell"
],
"nixpkgs": [
"nixos"
]
},
"locked": {
"lastModified": 1633877936,
"narHash": "sha256-+o3n6s7fR8dBGRldTGelyp2j3jSyTlrniOXwNfmMG20=",
"owner": "divnix",
"repo": "bud",
"rev": "15df091133ff95216c321b09be04905c0a0944c4",
"type": "github"
},
"original": {
"owner": "divnix",
"repo": "bud",
"type": "github"
}
},
the version of nix provided in the devos shell (via direnv) is pretty new. Maybe this is the problem (also note the warnings)?
❯ nix --version
warning: unknown experimental feature 'ca-references'
warning: unknown experimental feature 'ca-references'
nix (Nix) 2.5pre20211126_55275fc
I am currently working around this by running nixos-rebuild --flake
directly, but this subcommand is currently unusable on my box.
Ideally, this reference would be an input argument and not go via the registry or some other local persistence.
/cc @gytis-ivaskevicius (for your preliminary work on the fup repl in this regard) @nrdxp
Make sure that all scripts, where it makes sense, know to use FLKROOT
, HOST
& USER
environment.
We need to pull in the fup-repl implementation here so that the repl
command can work properly.
Some ideas:
Hi!
I know this is experimental, but since this is presented as an integral part of the digga framework interface, wouldn't it be worthwhile to provide a basic README.md in this repo?
The digga documentation describes bud as a highly customizable tool, so there should be some indication how it should be customized.
Thanks for all this great work!
Hi,
I'm trying to build a portable home-manager
profile with:
bud home dev
where dev
is the portable user, defined as:
home = {
imports = [ (digga.lib.importExportableModules ./local/modules) ];
modules = [ homeage.homeManagerModules.homeage ];
importables = rec {
profiles = digga.lib.rakeLeaves ./local/profiles;
suites = with profiles; rec {
base = [ hm-state-version git zsh python neovim tmux ranger ];
common-apps = [ apps www term ];
coding = [ dev bat direnv fzf ];
multimedia = [ mpv mpd ];
prod = [ hep zathura ledger ];
# settings
linux-config-cli = [ xdg-user-dirs dircolors ];
linux-config-gui = [ xdg-mime-apps fontconfig wm gui ];
workstation = base ++ common-apps ++ coding ++ multimedia ++ prod ++
linux-config-cli ++ linux-config-gui;
server = base ++ coding ++ linux-config-cli;
};
};
# Users here can be deployed without a host
users = {
dev = { suites, ... }: { imports = suites.server; };
}; # digga.lib.importers.rakeLeaves ./users/hm;
};
But I got the following error:
warning: Using saved setting for 'extra-experimental-features = nix-command flakes' from ~/.local/share/nix/trusted-settings.json.
warning: Using saved setting for 'extra-substituters = https://nix-community.cachix.org' from ~/.local/share/nix/trusted-settings.json.
error: flake 'git+file:///home/syp/src/nix-config' does not provide attribute 'packages.x86_64-linux.homeConfigurationsPortable.x86_64-linux."syp".activationPackage', 'legacyPackages.x86_64-linux.homeConfigurationsPortable.x86_64-linux."syp".activationPackage' or 'homeConfigurationsPortable.x86_64-linux."syp".activationPackage'
where syp
is my normal user name.
My configuration is at https://github.com/yipengsun/nix-config. I'm not sure if this is a bud
problem. Feel free to move this issue.
Thanks.
Maybe the contracts required from sub-commands to "blend in" is not the best idea we could have come up, so have that discussion here.
To make this as dynamic as possible )and convenient to drop in new scripts), I'd like to evaluate the possibility of a callee interface (script-side) that exposes the pkgs needed in the environment to the invoking nix
, but not sure yet...
We can also go just plain nix TM.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.