Remove optional builtins prefixes from prelude functions by running:
builtins=(
abort
baseNameOf
break
derivation
derivationStrict
dirOf
false
fetchGit
fetchMercurial
fetchTarball
fetchTree
fromTOML
import
isNull
map
null
placeholder
removeAttrs
scopedImport
throw
toString
true
)
fd --type file --exec-batch sed --in-place --regexp-extended "
s/\<builtins\.($(
printf '%s\n' "${builtins[@]}" |
paste --delimiter '|' --serial -
))\>/\1/g
"
nix fmt
This patch is heavily inspired by [1] ("treewide: remove optional
builtins prefixes from prelude functions").
[1]: https://github.com/NixOS/nixpkgs/pull/444432
Link: https://github.com/nix-community/stylix/pull/1915
Reviewed-by: Daniel Thwaites <danth@danth.me>
Reviewed-by: awwpotato <awwpotato@voidq.com>
31 lines
941 B
Nix
31 lines
941 B
Nix
{ lib, config, ... }:
|
|
let
|
|
user = lib.importTOML ../user.toml;
|
|
in
|
|
{
|
|
users.users.${user.username} = removeAttrs user [ "username" ];
|
|
|
|
security.sudo.wheelNeedsPassword = false;
|
|
|
|
services.getty.autologinUser = user.username;
|
|
|
|
nixpkgs.config.allowAliases = false;
|
|
|
|
# The state version can safely track the latest release because the disk
|
|
# image is ephemeral.
|
|
system.stateVersion = config.system.nixos.release;
|
|
home-manager.users.${user.username}.home.stateVersion =
|
|
config.system.nixos.release;
|
|
|
|
home-manager.sharedModules = lib.singleton {
|
|
# Enable Bash to ensure environment variables are set, avoiding individual
|
|
# testbeds to consider environment variable implementation details.
|
|
programs.bash.enable = true;
|
|
};
|
|
|
|
virtualisation.vmVariant.virtualisation = {
|
|
# This is a maximum limit; the VM should still work if the host has fewer cores.
|
|
cores = 4;
|
|
memorySize = lib.mkDefault 2048;
|
|
};
|
|
}
|