1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-07-30 11:37:44 +00:00

Use home variables in nushell

This commit is contained in:
RGBCube 2024-06-13 21:56:56 +03:00
parent 46dce2e7ce
commit 906c606e36
Signed by: RGBCube
SSH key fingerprint: SHA256:CzqbPcfwt+GxFYNnFVCqoN5Itn4YFrshg1TrnACpA5M
2 changed files with 29 additions and 3 deletions

View file

@ -19,7 +19,7 @@
};
})
(homeConfiguration {
(homeConfiguration (homeArgs: {
xdg.configFile = {
"nushell/zoxide.nu".source = pkgs.runCommand "zoxide.nu" {} ''
${lib.getExe pkgs.zoxide} init nushell --cmd cd > $out
@ -50,14 +50,32 @@
configFile.text = readFile ./configuration.nu;
envFile.source = ./environment.nu;
environmentVariables = mapAttrs (const (value: ''"${value}"'')) config.environment.variables;
environmentVariables = let
environmentVariables = config.environment.variables;
homeVariables = homeArgs.config.home.sessionVariables;
homeVariablesExtra = pipe (pkgs.runCommand "home-variables-extra.env" {} ''
alias export=echo
# echo foo > $out
# FIXME
eval $(cat ${homeArgs.config.home.sessionVariablesPackage}/etc/profile.d/hm-session-vars.sh) > $out
'') [
# (aaa: (_: break _) aaa)
readFile
(splitString "\n")
(filter (s: s != ""))
(map (strings.match "([^=]+)=(.*)"))
(map (keyAndValue: nameValuePair (first keyAndValue) (last keyAndValue)))
(foldl' (x: y: x // y) {})
];
in mapAttrs (const (value: ''"${value}"'')) (environmentVariables // homeVariables // homeVariablesExtra);
shellAliases = (attrsets.removeAttrs config.environment.shellAliases [ "ls" "l" ]) // {
cdtmp = "cd (mktemp --directory)";
ll = "ls --long";
};
};
})
}))
(systemPackages (with pkgs; [
fish # For completions.

8
modules/qt.nix Normal file
View file

@ -0,0 +1,8 @@
{ lib, ... }: with lib;
desktopUserHomeConfiguration {
qt = enabled {
platformTheme.name = "adwaita";
style.name = "adwaita";
};
}