Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write user config to nix.custom.conf, defer nix.conf to determinate when using determinate #1379

Merged
merged 25 commits into from
Jan 13, 2025

Conversation

grahamc
Copy link
Member

@grahamc grahamc commented Jan 10, 2025

Description

Currently we have an untenable scenario where our nix configs are not "stable" with Determinate:

  1. nix-installer writes out a nix.conf
  2. determinate-nixd runs, moves the nix.conf to /etc/nix/nix.custom.conf and writes its own nix.conf

Then if the user runs the package again…

  1. nix-installer merges its favorite configs with determinate-nixd's config, and updates nix.conf
  2. determinate-nixd runs, moves nix.conf's contents into the end of nix.custom.conf, and writes its own nix.conf …

Every time the package is re-run, the nix.custom.conf grows bigger.

Let's fix some "original sin" where determinate-nixd is ultra-accommodating, and make everything a bit more Determinate.

Changes to nix-installer:

  1. nix-installer will always write extra user-specified config to nix.custom.conf, and the generated nix.conf for upstream Nix will also use nix.custom.conf.
  2. when installing Determinate, nix-installer won't write out its own nix.conf, and will defer that job to determinate-nixd init.

ref FH-539

Checklist
  • Formatted with cargo fmt
  • Built with nix build
  • Ran flake checks with nix flake check
  • Added or updated relevant tests (leave unchecked if not applicable)
  • Added or updated relevant documentation (leave unchecked if not applicable)
  • Linked to related issues (leave unchecked if not applicable)
Validating with install.determinate.systems

If a maintainer has added the upload to s3 label to this PR, it will become available for installation via install.determinate.systems:

curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix/pr/$PR_NUMBER | sh -s -- install

src/action/common/place_nix_configuration.rs Outdated Show resolved Hide resolved
src/action/common/place_nix_configuration.rs Outdated Show resolved Hide resolved
src/action/common/place_nix_configuration.rs Outdated Show resolved Hide resolved
grahamc and others added 15 commits January 13, 2025 12:26
…conf settings to nix.custom.conf, which are included by nix.conf.
Flake lock file updates:

• Added input 'crane':
    'github:ipetkov/crane/72e2d02dbac80c8c86bf6bf3e785536acf8ee926?narHash=sha256-3aH/0Y6ajIlfy7j52FGZ%2Bs4icVX0oHhqBzRdlOeztqg%3D' (2024-12-21)
• Added input 'determinate':
    'https://api.flakehub.com/f/pinned/DeterminateSystems/determinate/0.1.165%2Brev-657395244a854da1bc71e38454958ecd57c0e241/0193b781-6c27-7703-bca6-fc9648fca81d/source.tar.gz?narHash=sha256-nUTutqzg/Z0eEXrC1ACTa4a9Ik5Iyxgqo8uL9DYib7I%3D' (2024-12-11)
• Added input 'determinate/determinate-nixd-aarch64-darwin':
    'https://install.determinate.systems/determinate-nixd/rev/0de4fff87b3bbf09c3e510c4a57eb014f98ab247/macOS?narHash=sha256-QF2Zi8Avz39kbh9iZMZoKiZLU5pdTPlicYE21291QSY%3D'
• Added input 'determinate/determinate-nixd-aarch64-linux':
    'https://install.determinate.systems/determinate-nixd/rev/0de4fff87b3bbf09c3e510c4a57eb014f98ab247/aarch64-linux?narHash=sha256-brFdvFUU9BLrwwDuwi841peDI/kwN1tzi9RZEIdPM%2B0%3D'
• Added input 'determinate/determinate-nixd-x86_64-darwin':
    follows ''
• Added input 'determinate/determinate-nixd-x86_64-linux':
    'https://install.determinate.systems/determinate-nixd/rev/0de4fff87b3bbf09c3e510c4a57eb014f98ab247/x86_64-linux?narHash=sha256-WapB5UqrZpK32/TrUltUhE9Rp%2BwYAQj/0asXtL0OUSY%3D'
• Added input 'determinate/nix':
    follows 'nix'
• Added input 'determinate/nixpkgs':
    follows 'nixpkgs'
• Added input 'flake-compat':
    'https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz?narHash=sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U%3D' (2023-10-04)
• Added input 'nix':
    'https://api.flakehub.com/f/pinned/DeterminateSystems/nix/2.25.3/01939864-5191-788c-b898-163d916a3333/source.tar.gz?narHash=sha256-rOFE8TSwWoup%2BLPNbmtTs6oLy7lYZ12L9GN%2BaZuQQaA%3D' (2024-12-03)
• Added input 'nix/nix':
    'https://api.flakehub.com/f/pinned/NixOS/nix/2.25.3/01938786-bc70-79e3-b7ee-bb61f8e7f238/source.tar.gz?narHash=sha256-T%2BwFMm3cj8pGJSwXmPuxG5pz%2B1gRDJoToF9OBxtzocA%3D' (2024-11-29)
• Added input 'nix/nix/flake-compat':
    'github:edolstra/flake-compat/0f9255e01c2351cc7d116c072cb317785dd33b33?narHash=sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U%3D' (2023-10-04)
• Added input 'nix/nix/flake-parts':
    'github:hercules-ci/flake-parts/9227223f6d922fee3c7b190b2cc238a99527bbb7?narHash=sha256-pQMhCCHyQGRzdfAkdJ4cIWiw%2BJNuWsTX7f0ZYSyz0VY%3D' (2024-07-03)
• Added input 'nix/nix/flake-parts/nixpkgs-lib':
    follows 'nix/nix/nixpkgs'
• Added input 'nix/nix/git-hooks-nix':
    'github:cachix/git-hooks.nix/f451c19376071a90d8c58ab1a953c6e9840527fd?narHash=sha256-6FPUl7HVtvRHCCBQne7Ylp4p%2BdpP3P/OYuzjztZ4s70%3D' (2024-07-15)
• Added input 'nix/nix/git-hooks-nix/flake-compat':
    follows 'nix/nix'
• Added input 'nix/nix/git-hooks-nix/gitignore':
    follows 'nix/nix'
• Added input 'nix/nix/git-hooks-nix/nixpkgs':
    follows 'nix/nix/nixpkgs'
• Added input 'nix/nix/git-hooks-nix/nixpkgs-stable':
    follows 'nix/nix/nixpkgs'
• Added input 'nix/nix/libgit2':
    'github:libgit2/libgit2/36f7e21ad757a3dacc58cf7944329da6bc1d6e96?narHash=sha256-J2rCxTecyLbbDdsyBWn9w7r3pbKRMkI9E7RvRgAqBdY%3D' (2024-05-16)
• Added input 'nix/nix/nixpkgs':
    'github:NixOS/nixpkgs/c3d4ac725177c030b1e289015989da2ad9d56af0?narHash=sha256-sqLwJcHYeWLOeP/XoLwAtYjr01TISlkOfz%2BNG82pbdg%3D' (2024-08-15)
• Added input 'nix/nix/nixpkgs-23-11':
    'github:NixOS/nixpkgs/a62e6edd6d5e1fa0329b8653c801147986f8d446?narHash=sha256-oamiKNfr2MS6yH64rUn99mIZjc45nGJlj9eGth/3Xuw%3D' (2024-05-31)
• Added input 'nix/nix/nixpkgs-regression':
    'github:NixOS/nixpkgs/215d4d0fd80ca5163643b03a33fde804a29cc1e2?narHash=sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw%3D' (2022-01-24)
• Added input 'nix/nixpkgs':
    'https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2411.710194%2Brev-f9f0d5c5380be0a599b1fb54641fa99af8281539/01938be8-64ce-75c6-94d4-dbc2e4d547fe/source.tar.gz?narHash=sha256-En%2BgSoVJ3iQKPDU1FHrR6zIxSLXKjzKY%2Bpnh9tt%2BYts%3D' (2024-12-02)
• Added input 'nixpkgs':
    'https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.737298%2Brev-ed4a395ea001367c1f13d34b1e01aa10290f67d6/01945f5f-4175-7e72-8809-a1e482c4a443/source.tar.gz?narHash=sha256-jG/%2BMvjVY7SlTakzZ2fJ5dC3V1PrKKrUEOEE30jrOKA%3D' (2025-01-12)
@grahamc grahamc force-pushed the defer-nix-config-to-determinate branch from 93e294c to 6f79b1e Compare January 13, 2025 17:27
Comment on lines 300 to 304
- uses: namespacelabs/breakpoint-action@v0
if: failure()
with:
duration: 30m
authorized-users: grahamc, cole-h
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- uses: namespacelabs/breakpoint-action@v0
if: failure()
with:
duration: 30m
authorized-users: grahamc, cole-h

flake.nix Outdated
Comment on lines 25 to 37

inputs.determinate-nixd-aarch64-linux = {
url = "https://install.determinate.systems/determinate-nixd/pr/190/aarch64-linux";
flake = false;
};
inputs.determinate-nixd-x86_64-linux = {
url = "https://install.determinate.systems/determinate-nixd/pr/190/x86_64-linux";
flake = false;
};
inputs.determinate-nixd-aarch64-darwin = {
url = "https://install.determinate.systems/determinate-nixd/pr/190/macOS";
flake = false;
};
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
inputs.determinate-nixd-aarch64-linux = {
url = "https://install.determinate.systems/determinate-nixd/pr/190/aarch64-linux";
flake = false;
};
inputs.determinate-nixd-x86_64-linux = {
url = "https://install.determinate.systems/determinate-nixd/pr/190/x86_64-linux";
flake = false;
};
inputs.determinate-nixd-aarch64-darwin = {
url = "https://install.determinate.systems/determinate-nixd/pr/190/macOS";
flake = false;
};

Flake lock file updates:

• Updated input 'determinate':
    'https://api.flakehub.com/f/pinned/DeterminateSystems/determinate/0.1.165%2Brev-657395244a854da1bc71e38454958ecd57c0e241/0193b781-6c27-7703-bca6-fc9648fca81d/source.tar.gz?narHash=sha256-nUTutqzg/Z0eEXrC1ACTa4a9Ik5Iyxgqo8uL9DYib7I%3D' (2024-12-11)
  → 'https://api.flakehub.com/f/pinned/DeterminateSystems/determinate/0.1.168%2Brev-29d4697d480dc9ed0e0a1d260d621ac8d4b7fa41/019461c4-62df-70e8-9684-46317d87e052/source.tar.gz?narHash=sha256-guIdbsg1LBURqqoeHYIkU4ECPvYjXX2NI%2BgGeJTR9us%3D' (2025-01-13)
• Updated input 'determinate/determinate-nixd-aarch64-darwin':
    'https://install.determinate.systems/determinate-nixd/pr/190/macOS?narHash=sha256-KzLWlikcqKqgYTZqt6E71RjYc7ybREz%2BHLFNqxOjpoQ%3D'
  → 'https://install.determinate.systems/determinate-nixd/tag/v0.3.0/macOS?narHash=sha256-yLy38fgeC%2BorxYylwUwLUuRUdgi9WLEflLX9j9NDIUI%3D'
• Updated input 'determinate/determinate-nixd-aarch64-linux':
    'https://install.determinate.systems/determinate-nixd/pr/190/aarch64-linux?narHash=sha256-/EPA3KEa9uIcbHx3dIsJOOML2v6YMegb8%2B2o3MGlyTo%3D'
  → 'https://install.determinate.systems/determinate-nixd/tag/v0.3.0/aarch64-linux?narHash=sha256-9/HjI0v/ZLoTqOy%2B5%2BviIQh8iGjf49qMLRVthVZ3V9U%3D'
• Updated input 'determinate/determinate-nixd-x86_64-linux':
    'https://install.determinate.systems/determinate-nixd/pr/190/x86_64-linux?narHash=sha256-1deA6Rexdk7A9FlUNjLrxDeevO1RI6olIgIkPBhbryE%3D'
  → 'https://install.determinate.systems/determinate-nixd/tag/v0.3.0/x86_64-linux?narHash=sha256-cyvqGm%2BWT5l3N40wSO6FSJTm7Lxm9w1owpXjAYtGAm4%3D'
@grahamc grahamc merged commit ea722ee into main Jan 13, 2025
22 checks passed
@grahamc grahamc deleted the defer-nix-config-to-determinate branch January 13, 2025 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants