diff --git a/hardware/gpu/cuda-prime.nix b/hardware/gpu/cuda-prime.nix index 6ca38fe..cf9f9b3 100644 --- a/hardware/gpu/cuda-prime.nix +++ b/hardware/gpu/cuda-prime.nix @@ -7,6 +7,7 @@ hardware.nvidia.prime = { # (required) Bus IDs. You can find them using lspci, grepping for "3D" or "VGA" + # lspci | grep -iE "(3D|VGA)" # intelBusId = "PCI:0:2:0"; # nvidiaBusId = "PCI:1:0:0"; diff --git a/justfile b/justfile index 57fdf13..8b6e707 100644 --- a/justfile +++ b/justfile @@ -19,6 +19,9 @@ eval-vm $hostname=`just _a_host` $attrpath="system.build.toplevel.outPath" *args repl $hostname=`just _a_host`: NIX_NO_NOM=1 nixos-rebuild-ng --flake .#"$hostname" repl +why-depends $hostname $attrpath: + nix why-depends .#nixosConfigurations."$hostname".config.system.build.toplevel .#nixosConfigurations."$hostname".pkgs."$attrpath" + report hostname=`just _a_host`: nix eval .#nixosReports."{{hostname}}" --json --show-trace | yq . --yaml-output --width=999999 | bat --language yaml --style plain --paging never diff --git a/profiles/base/ccache/default.nix b/profiles/base/ccache/default.nix index 45a72dd..6cd767f 100644 --- a/profiles/base/ccache/default.nix +++ b/profiles/base/ccache/default.nix @@ -7,6 +7,7 @@ # serge <3 # TODO: distributed (s)ccache (with redis?) +# TODO: garbage collect this { programs.ccache.enable = true; diff --git a/profiles/base/nix.nix b/profiles/base/nix.nix index 2433a28..5d7ce4f 100644 --- a/profiles/base/nix.nix +++ b/profiles/base/nix.nix @@ -14,12 +14,21 @@ !include ${config.sops.secrets.nix-access-tokens-all.path} ''; + # https://nix.dev/manual/nix/stable/command-ref/conf-file.html + # https://nix.dev/manual/nix/latest/command-ref/conf-file.html + # https://docs.lix.systems/manual/lix/stable/command-ref/conf-file.html nix.settings = { + + # === behaviour experimental-features = [ "nix-command" "flakes" # "pipe-operator" # not supported on lix 2.91 ]; + log-lines = 35; + # keep-going = true; + + # === access #nix.settings.allowed-users = [ "@builders" ]; # TODO: this allowed-users = [ # default is [ "*" ] @@ -30,13 +39,20 @@ "root" "@wheel" ]; + + # === eval and realization keep-derivations = true; # keep .drv in store, great with nix-diff + max-silent-time = 3600; # kill long-running silent builds + + # === substitution + connect-timeout = 5; # timeout in seconds for binary caches + download-attempts = lib.mkDefault 2; # download attempts, in case a binary cache fails + # fallback = lib.mkDefault true; # fallback to building if a binary cache fails + + # === store + #settings.keep-failed = true; # fills up $TMPDIR auto-optimise-store = true; # deduplicate with hardlinks, expensive. Alternative: nix-store --optimise - max-silent-time = 3600; - connect-timeout = 5; # seconds timeout for binary caches - #nix.settings.keep-failed = true; # fills up $TMPDIR - log-lines = 35; - min-free = 3 * 1024 * 1024 * 1024; # starts cg + min-free = 5 * 1024 * 1024 * 1024; # starts cg max-free = 20 * 1024 * 1024 * 1024; # condition to end gc triggered by min-free # should not be needed since https://github.com/NixOS/nixpkgs/pull/383052 @@ -53,8 +69,9 @@ ]; }; + #nix.optimize.automatic = true; # periodic store optimization, alternative nix.settings.auto-optimise-store + nix.gc = { - #nix.optimize.automatic = true; # periodic optimization automatic = true; dates = "weekly"; options = lib.mkIf config.system.autoUpgrade.enable "--delete-older-than 15d"; diff --git a/profiles/known-hosts/default.nix b/profiles/known-hosts/default.nix index 3b32a98..5d06585 100644 --- a/profiles/known-hosts/default.nix +++ b/profiles/known-hosts/default.nix @@ -161,12 +161,23 @@ in { description = "Which specialization this is, if any."; }; - - config = { nix.settings.max-jobs = lib.mkIf ((thisHost.buildMachine.maxJobs or 0) > 0) (lib.mkDefault thisHost.buildMachine.maxJobs); }; + # TODO: + # nix.buildMachines = [ + # { + # protocol = null; + # hostName = "localhost"; + # speedFactor = SOMETHING; // perhaps by looking up self in hosts.toml, perhaps by always preferring self, perhaps by always preferring remotes + # maxJobs = config.nix.settings.SOMETHING; + # system = config.nix.settings.SOMETHING; + # supportedFeatures = config.nix.settings.SOMETHING; + # } + # ]; + + } diff --git a/users/pbsds/home/profiles/nix.nix b/users/pbsds/home/profiles/nix.nix index 4172e48..481302f 100644 --- a/users/pbsds/home/profiles/nix.nix +++ b/users/pbsds/home/profiles/nix.nix @@ -1,16 +1,16 @@ { pkgs, ... }: let # why not just use functions normally? ctrl-alt-e is why! - _tmpfn_name = "_tmpfn_ex4aiNgu"; # pwgen ftw - mkArgsAlias = alias: ''${_tmpfn_name}() { unset -f ${_tmpfn_name}; ${alias}; }; ${_tmpfn_name}''; + _tmpfn_name_ = "_tmpfn_ex4aiNgu_"; # pwgen ftw + mkArgsAlias = alias: ''${_tmpfn_name_}() { unset -f ${_tmpfn_name_}; ${alias}; }; ${_tmpfn_name_}''; in { home.packages = with pkgs; [ - /* flox */ - /* devenv */ - /* cachix */ - /* nix-template */ + # flox + # devenv + # cachix + # nix-template nix-output-monitor nix-du nix-tree @@ -23,11 +23,11 @@ in unstable.nix-init unstable.deadnix unstable.statix - /* unstable.nixtract */ + # unstable.nixtract unstable.nixfmt-rfc-style nurl # manix - #comma # collides with nix-index-database + # comma # collides with nix-index-database # devenv nix-fast-build nix-eval-jobs diff --git a/users/pbsds/home/profiles/shell.nix b/users/pbsds/home/profiles/shell.nix index 88c7551..124d468 100644 --- a/users/pbsds/home/profiles/shell.nix +++ b/users/pbsds/home/profiles/shell.nix @@ -3,8 +3,8 @@ let # why not just use functions normally? ctrl-alt-e is why! - _tmpfn_name = "_tmpfn_ex4aiNgu"; # pwgen ftw - mkArgsAlias = alias: ''${_tmpfn_name}() { unset -f ${_tmpfn_name}; ${alias}; }; ${_tmpfn_name}''; + _tmpfn_name_ = "_tmpfn_ex4aiNgu_"; # pwgen ftw + mkArgsAlias = alias: ''${_tmpfn_name_}() { unset -f ${_tmpfn_name_}; ${alias}; }; ${_tmpfn_name_}''; in @@ -136,7 +136,11 @@ in home.shellAliases.killall = "killall -v"; # bin = "python -c 'import sys; sys.stdout.write(sys.stdin.read().strip())' | curl -is -X POST https://i.kuklef.se/upload -F content=@- -F expiration=10d | grep '^location:' | cut -d' ' -f2-"; - home.shellAliases.bin = "${lib.getExe pkgs.netcat} termbin.com 9999"; + home.shellAliases.termbin = "${lib.getExe pkgs.netcat} termbin.com 9999"; + + # https://github.com/nwtgck/piping-server + home.shellAliases.httppipe-in = mkArgsAlias ''set -x; curl -T - https://ppng.io/"''${1:-ijoh1aeJiXail9gahlah}"''; # pwgen ftw + home.shellAliases.httppipe-out = mkArgsAlias ''set -x; curl https://ppng.io/"''${1:-ijoh1aeJiXail9gahlah}"''; # pwgen ftw # old alias, just learn to use ncdu lol home.shellAliases.dush = "du -shc * | sort -h";