-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mise): add mise package and configuration support
- Loading branch information
Showing
10 changed files
with
149 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
./fzf | ||
./gh | ||
./git | ||
./mise | ||
./nvim | ||
./starship | ||
./tmux | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{ | ||
pkgs, | ||
lib, | ||
config, | ||
... | ||
}: | ||
let | ||
cfg = config.modules.shell.mise; | ||
tomlFormat = pkgs.formats.toml { }; | ||
in | ||
{ | ||
options.modules.shell.mise = { | ||
enable = lib.mkEnableOption "mise"; | ||
package = lib.mkPackageOption pkgs "mise" { }; | ||
globalConfig = lib.mkOption { | ||
inherit (tomlFormat) type; | ||
default = { }; | ||
}; | ||
settings = lib.mkOption { | ||
inherit (tomlFormat) type; | ||
default = { }; | ||
}; | ||
}; | ||
|
||
config = lib.mkIf cfg.enable { | ||
home.packages = [ | ||
cfg.package | ||
pkgs.usage | ||
]; | ||
|
||
home.activation.miseInstall = '' | ||
${lib.getExe cfg.package} install -C "${config.home.homeDirectory}" | ||
${lib.getExe cfg.package} use -g usage | ||
${lib.getExe cfg.package} completion fish > ~/.config/fish/completions/mise.fish | ||
''; | ||
|
||
xdg.configFile = { | ||
"mise/config.toml" = lib.mkIf (cfg.globalConfig != { }) { | ||
source = tomlFormat.generate "mise-config" cfg.globalConfig; | ||
}; | ||
"mise/settings.toml" = { | ||
source = tomlFormat.generate "mise-settings" ( | ||
{ | ||
experimental = true; | ||
python_venv_auto_create = true; | ||
disable_hints = [ | ||
"*" | ||
]; | ||
} | ||
// cfg.settings | ||
); | ||
}; | ||
}; | ||
|
||
programs = { | ||
bash.initExtra = '' | ||
eval "$(${lib.getExe cfg.package} activate bash)" | ||
''; | ||
|
||
fish.interactiveShellInit = lib.mkAfter '' | ||
${lib.getExe cfg.package} activate fish | source | ||
''; | ||
|
||
fish.shellInit = lib.mkAfter '' | ||
${lib.getExe cfg.package} activate fish --shims | source | ||
''; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
{ | ||
"talosctl": "sha256-vZFXqU9tgnL8odBpOcvRig1KKVH20CM0ze0+pypaRKE=", | ||
"gh-copilot-linux-amd64": "", | ||
"gh-copilot-linux-arm64": "", | ||
"gh-copilot-darwin-amd64": "", | ||
"gh-copilot-darwin-arm64": "" | ||
"gh-copilot-darwin-arm64": "", | ||
"talosctl": "sha256-vZFXqU9tgnL8odBpOcvRig1KKVH20CM0ze0+pypaRKE=", | ||
"usage": "sha256-w8GWvMjC6Plho+zw542Q00hU/KZMdyyoP/rGAg72h1s=" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
pkgs, | ||
lib, | ||
rustPlatform, | ||
nix-update-script, | ||
... | ||
}: | ||
let | ||
inherit (pkgs.stdenv.hostPlatform) isDarwin; | ||
inherit (pkgs.darwin.apple_sdk.frameworks) Security SystemConfiguration; | ||
|
||
sourceData = pkgs.callPackage ./_sources/generated.nix { }; | ||
vendorHash = lib.importJSON ./_sources/vendorhash.json; | ||
packageData = sourceData.usage; | ||
in | ||
rustPlatform.buildRustPackage rec { | ||
inherit (packageData) pname src; | ||
version = lib.strings.removePrefix "v" packageData.version; | ||
cargoHash = vendorHash.usage; | ||
|
||
passthru = { | ||
updateScript = nix-update-script { }; | ||
}; | ||
|
||
doCheck = false; # no tests | ||
|
||
meta = { | ||
homepage = "https://usage.jdx.dev"; | ||
description = "A specification for CLIs"; | ||
changelog = "https://github.com/jdx/usage/releases/tag/v${version}"; | ||
mainProgram = "usage"; | ||
}; | ||
} |