diff --git a/flake.nix b/flake.nix index afb5887..4176b04 100644 --- a/flake.nix +++ b/flake.nix @@ -196,54 +196,7 @@ }; }; - pvv = home-manager.lib.homeManagerConfiguration { - inherit pkgs; - - extraSpecialArgs = { - inherit inputs; - inherit unstable-pkgs; - inherit yet-unstabler-pkgs; - inherit (self) extendedLib; - machineName = "pvv-machine"; - machineVars = { - headless = true; - # fixDisplayCommand = "echo 'not available'"; - gaming = false; - development = true; - laptop = false; - battery = null; - wlanInterface = null; - wayland = false; - }; - }; - - modules = [ - ./home/home.nix - ./modules/machineVars.nix - inputs.sops-nix.homeManagerModules.sops - ({ config, pkgs, lib, ... }: { - home = { - username = lib.mkForce "oysteikt"; - homeDirectory = lib.mkForce "/home/pvv/d/oysteikt"; - stateVersion = "25.05"; - packages = [ - # NOTE: nix on pvv machines is severely outdated - # putting it in the path of home-manager - # will ensure we use the new one by default - config.nix.package - ]; - }; - - nix.package = pkgs.nix; - nix.settings.use-xdg-base-directories = lib.mkForce false; - - local.shell.aliases."Nix Stuff" = { - nxr = lib.mkForce "echo \"Local rebuilds are not available on this machine\""; - nxrl = lib.mkForce "echo \"Local rebuilds are not available on this machine\""; - }; - }) - ] ++ (builtins.attrValues self.homeModules); - }; + pvv = import ./home/pvv/default.nix { inherit inputs unstable-pkgs yet-unstabler-pkgs; inherit (nixpkgs) lib; }; }; nixosConfigurations = let diff --git a/home/pvv/build-pvv-home.sh b/home/pvv/build-pvv-home.sh new file mode 100755 index 0000000..b85fb89 --- /dev/null +++ b/home/pvv/build-pvv-home.sh @@ -0,0 +1,56 @@ +#! /usr/bin/env nix-shell +#! nix-shell -i bash -p bash git nix nix-output-monitor + +set -euo pipefail + +set -x + +declare -r GIT_ROOT="$(git rev-parse --show-toplevel)" +declare -r GIT_CWD="$GIT_ROOT/home/pvv" + +declare -r _HOME=/home/pvv/d/oysteikt + +declare -r _NIX_DIR="${_HOME}/.local/nix" +declare -r _NIX_STORE="${_NIX_DIR}/store" +declare -r _NIX_STATE="${_NIX_DIR}/var/nix" +declare -r _NIX_LOG="${_NIX_DIR}/var/log" +declare -r _NIX_STORE_EXPR="local?store=${_NIX_STORE}&state=${_NIX_STATE}&log=${_NIX_LOG}" + +# ulimit -n 1000000 +# export TMPDIR="${HOME}/.cache/nix/build-dir" + +# nix build --store "local?store=${NIX_STORE}&state=${NIX_STATE}&log=${NIX_LOG}" .#pkgs.binutils -L + +# for i in $(seq 1 100); do +# nix build --store "local?store=${NIX_STORE}&state=${NIX_STATE}&log=${NIX_LOG}" .#homeConfigurations.pvv.activationPackage -L --impure --keep-going +# done + + +sudo rm -rf "$_NIX_DIR" ||: + +declare -a _NIX_ARGS=( + -L + --impure + --store "$_NIX_STORE_EXPR" + --option substitute false + # --builders 'nix-builder-wenche ; nix-builder-gluttony' + # --keep-going +) + + +STAGE0_DRV_NAME="$(nix eval --raw '.#homeConfigurations.pvv.pkgs.make-minimal-bootstrap-sources.name')" + +nix build 'nixpkgs#make-minimal-bootstrap-sources' -L --out-link "$GIT_CWD/result-bootstrap-sources" + +nix hash path --store "$_NIX_STORE_EXPR" --type sha256 "$GIT_CWD/result-bootstrap-sources" > "$GIT_CWD/minimal-bootstrap-hash" + +nix store add --store "$_NIX_STORE_EXPR" --hash-algo sha256 --name "$STAGE0_DRV_NAME" "$GIT_CWD/result-bootstrap-sources" + +nix build "${_NIX_ARGS[@]}" .#homeConfigurations.pvv.pkgs.bash + +# for i in $(seq 1 100); do +# nix build "${NIX_ARGS[@]}" .#homeConfigurations.pvv.activationPackage +# done + +# nom build --store "local?store=${NIX_STORE}&state=${NIX_STATE}&log=${NIX_LOG}" .#homeConfigurations.pvv.activationPackage --impure +# nom build --store "local?store=${NIX_STORE}&state=${NIX_STATE}&log=${NIX_LOG}" .#homeConfigurations.pvv.activationPackage --impure diff --git a/home/pvv/default.nix b/home/pvv/default.nix new file mode 100644 index 0000000..78559c9 --- /dev/null +++ b/home/pvv/default.nix @@ -0,0 +1,61 @@ +{ + lib, + inputs, + unstable-pkgs, + yet-unstabler-pkgs, +}: +inputs.home-manager.lib.homeManagerConfiguration { + pkgs = import inputs.nixpkgs { + system = "x86_64-linux"; + overlays = [ + (final: prev: { + + }) + ]; + }; + + extraSpecialArgs = { + inherit inputs; + inherit unstable-pkgs; + inherit yet-unstabler-pkgs; + inherit (inputs.self) extendedLib; + machineName = "pvv-machine"; + machineVars = { + headless = true; + # fixDisplayCommand = "echo 'not available'"; + gaming = false; + development = true; + laptop = false; + battery = null; + wlanInterface = null; + wayland = false; + }; + }; + + modules = [ + ../home.nix + ../../modules/machineVars.nix + inputs.sops-nix.homeManagerModules.sops + ({ config, pkgs, lib, ... }: { + home = { + username = lib.mkForce "oysteikt"; + homeDirectory = lib.mkForce "/home/pvv/d/oysteikt"; + stateVersion = "26.05"; + packages = [ + # NOTE: nix on pvv machines is severely outdated + # putting it in the path of home-manager + # will ensure we use the new one by default + config.nix.package + ]; + }; + + nix.package = pkgs.nix; + nix.settings.use-xdg-base-directories = lib.mkForce false; + + local.shell.aliases."Nix Stuff" = { + nxr = lib.mkForce "echo \"Local rebuilds are not available on this machine\""; + nxrl = lib.mkForce "echo \"Local rebuilds are not available on this machine\""; + }; + }) + ] ++ (builtins.attrValues inputs.self.homeModules); +} diff --git a/home/pvv/minimal-bootstrap-hash b/home/pvv/minimal-bootstrap-hash new file mode 100644 index 0000000..fdc4a74 --- /dev/null +++ b/home/pvv/minimal-bootstrap-hash @@ -0,0 +1 @@ +sha256-IpoXLphyBaSctH9cI5wPqNd4mSqMPOmj7Z2VMV9x0jI= diff --git a/scripts/build-pvv-home.sh b/scripts/build-pvv-home.sh deleted file mode 100755 index 88a7672..0000000 --- a/scripts/build-pvv-home.sh +++ /dev/null @@ -1,37 +0,0 @@ -#! /usr/bin/env nix-shell -#! nix-shell -i bash -p bash nix nix-output-monitor - -set -euo pipefail - -declare -r HOME=/home/pvv/d/oysteikt - -declare -r NIX_DIR="${HOME}/.local/nix" -declare -r NIX_STORE="${NIX_DIR}/store" -declare -r NIX_STATE="${NIX_DIR}/var/nix" -declare -r NIX_LOG="${NIX_DIR}/var/log" -declare -r NIX_STORE="local?store=${NIX_STORE}&state=${NIX_STATE}&log=${NIX_LOG}" - -# ulimit -n 1000000 -# export TMPDIR="${HOME}/.cache/nix/build-dir" - -# nix build --store "local?store=${NIX_STORE}&state=${NIX_STATE}&log=${NIX_LOG}" .#pkgs.binutils -L - -# for i in $(seq 1 100); do -# nix build --store "local?store=${NIX_STORE}&state=${NIX_STATE}&log=${NIX_LOG}" .#homeConfigurations.pvv.activationPackage -L --impure --keep-going -# done - -NIX_ARGS=( - -L - --impure - --store "$NIX_STORE" - --option substitute false - --builders 'nix-builder-wenche ; nix-builder-gluttony' - # --keep-going -) - -# for i in $(seq 1 100); do -nix build "${NIX_ARGS[@]}" .#homeConfigurations.pvv.activationPackage -# done - -# nom build --store "local?store=${NIX_STORE}&state=${NIX_STATE}&log=${NIX_LOG}" .#homeConfigurations.pvv.activationPackage --impure -# nom build --store "local?store=${NIX_STORE}&state=${NIX_STATE}&log=${NIX_LOG}" .#homeConfigurations.pvv.activationPackage --impure