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:
parent
46dce2e7ce
commit
906c606e36
2 changed files with 29 additions and 3 deletions
|
@ -19,7 +19,7 @@
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
(homeConfiguration {
|
(homeConfiguration (homeArgs: {
|
||||||
xdg.configFile = {
|
xdg.configFile = {
|
||||||
"nushell/zoxide.nu".source = pkgs.runCommand "zoxide.nu" {} ''
|
"nushell/zoxide.nu".source = pkgs.runCommand "zoxide.nu" {} ''
|
||||||
${lib.getExe pkgs.zoxide} init nushell --cmd cd > $out
|
${lib.getExe pkgs.zoxide} init nushell --cmd cd > $out
|
||||||
|
@ -50,14 +50,32 @@
|
||||||
configFile.text = readFile ./configuration.nu;
|
configFile.text = readFile ./configuration.nu;
|
||||||
envFile.source = ./environment.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" ]) // {
|
shellAliases = (attrsets.removeAttrs config.environment.shellAliases [ "ls" "l" ]) // {
|
||||||
cdtmp = "cd (mktemp --directory)";
|
cdtmp = "cd (mktemp --directory)";
|
||||||
ll = "ls --long";
|
ll = "ls --long";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
})
|
}))
|
||||||
|
|
||||||
(systemPackages (with pkgs; [
|
(systemPackages (with pkgs; [
|
||||||
fish # For completions.
|
fish # For completions.
|
||||||
|
|
8
modules/qt.nix
Normal file
8
modules/qt.nix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{ lib, ... }: with lib;
|
||||||
|
|
||||||
|
desktopUserHomeConfiguration {
|
||||||
|
qt = enabled {
|
||||||
|
platformTheme.name = "adwaita";
|
||||||
|
style.name = "adwaita";
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue