From 64e46f5ff035330ae995b740f7ec43ce4f0fe834 Mon Sep 17 00:00:00 2001 From: aaccardo Date: Fri, 23 Jan 2026 12:38:11 +1300 Subject: [PATCH] feat(nix): use determinate nix (#107) This reverts commit bf163fc14b0f6b4fb95a2f971dd47fd5097188b6. --- flake.lock | 344 +++++++++++++++----- flake.nix | 121 +------ modules/nix/{settings.nix => _settings.nix} | 0 modules/nix/determinate-system.nix | 84 +++++ 4 files changed, 357 insertions(+), 192 deletions(-) rename modules/nix/{settings.nix => _settings.nix} (100%) create mode 100644 modules/nix/determinate-system.nix diff --git a/flake.lock b/flake.lock index 9d711c41..aa66eed3 100644 --- a/flake.lock +++ b/flake.lock @@ -63,11 +63,11 @@ }, "crane": { "locked": { - "lastModified": 1767744144, - "narHash": "sha256-9/9ntI0D+HbN4G0TrK3KmHbTvwgswz7p8IEJsWyef8Q=", + "lastModified": 1765145449, + "narHash": "sha256-aBVHGWWRzSpfL++LubA0CwOOQ64WNLegrYHwsVuVN7A=", "owner": "ipetkov", "repo": "crane", - "rev": "2fb033290bf6b23f226d4c8b32f7f7a16b043d7e", + "rev": "69f538cdce5955fcd47abfed4395dc6d5194c1c5", "type": "github" }, "original": { @@ -101,15 +101,14 @@ "locked": { "lastModified": 1768764703, "narHash": "sha256-5ulSDyOG1U+1sJhkJHYsUOWEsmtLl97O0NTVMvgIVyc=", - "owner": "nix-darwin", - "repo": "nix-darwin", "rev": "0fc4e7ac670a0ed874abacf73c4b072a6a58064b", - "type": "github" + "revCount": 2312, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/nix-darwin/nix-darwin/0.1.2312%2Brev-0fc4e7ac670a0ed874abacf73c4b072a6a58064b/019bd2ae-fec6-72ed-9152-a07ee15debeb/source.tar.gz" }, "original": { - "owner": "nix-darwin", - "repo": "nix-darwin", - "type": "github" + "type": "tarball", + "url": "https://flakehub.com/f/nix-darwin/nix-darwin/0.1" } }, "deploy-rs": { @@ -136,6 +135,63 @@ "type": "github" } }, + "determinate": { + "inputs": { + "determinate-nixd-aarch64-darwin": "determinate-nixd-aarch64-darwin", + "determinate-nixd-aarch64-linux": "determinate-nixd-aarch64-linux", + "determinate-nixd-x86_64-linux": "determinate-nixd-x86_64-linux", + "nix": "nix", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1766549083, + "narHash": "sha256-G1Hljg7vIBt8n9cxO382YAZWtZU/mYfQcg3icdNG8RQ=", + "rev": "ba8999fac986e70f52b4cba15047be7bbb7b6346", + "revCount": 318, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/determinate/3.15.1/019b4e8a-dc22-75db-aef5-a447efbb1a13/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/DeterminateSystems/determinate/3" + } + }, + "determinate-nixd-aarch64-darwin": { + "flake": false, + "locked": { + "narHash": "sha256-uWDS94cAYprGj+AwuT42nuuDDicRLj1S0JwalZGeBRU=", + "type": "file", + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.15.1/macOS" + }, + "original": { + "type": "file", + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.15.1/macOS" + } + }, + "determinate-nixd-aarch64-linux": { + "flake": false, + "locked": { + "narHash": "sha256-uHBcZCh2/Bj5/88TDihupA336tSQDk7s5lVP66IDAX0=", + "type": "file", + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.15.1/aarch64-linux" + }, + "original": { + "type": "file", + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.15.1/aarch64-linux" + } + }, + "determinate-nixd-x86_64-linux": { + "flake": false, + "locked": { + "narHash": "sha256-y+l05H6GNv/1WcrMztDYem8VBWqjc9gNg4WjeQ1PQxo=", + "type": "file", + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.15.1/x86_64-linux" + }, + "original": { + "type": "file", + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.15.1/x86_64-linux" + } + }, "devshell": { "inputs": { "nixpkgs": [ @@ -164,20 +220,56 @@ ] }, "locked": { - "lastModified": 1768923567, - "narHash": "sha256-GVJ0jKsyXLuBzRMXCDY6D5J8wVdwP1DuQmmvYL/Vw/Q=", - "owner": "nix-community", - "repo": "disko", - "rev": "00395d188e3594a1507f214a2f15d4ce5c07cb28", + "lastModified": 1768916804, + "narHash": "sha256-mdQZYN8bOK5T4/i1d0HXcBp1id2h8a1YxlH0MeDMXVg=", + "rev": "6d224fe8309f5855cafbd418f48c55b18eec2da1", + "revCount": 1311, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/nix-community/disko/1.13.0/019bdba9-f1ea-7693-afdb-10e0e857365a/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/nix-community/disko/1" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", "type": "github" }, "original": { - "owner": "nix-community", - "repo": "disko", + "owner": "edolstra", + "repo": "flake-compat", "type": "github" } }, "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "determinate", + "nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1748821116, + "narHash": "sha256-F82+gS044J1APL0n4hH50GYdPRv/5JWm34oCJYmVKdE=", + "rev": "49f0870db23e8c1ca0b5259734a02cd9e1e371a1", + "revCount": 377, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/hercules-ci/flake-parts/0.1.377%2Brev-49f0870db23e8c1ca0b5259734a02cd9e1e371a1/01972f28-554a-73f8-91f4-d488cc502f08/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/hercules-ci/flake-parts/0.1" + } + }, + "flake-parts_2": { "inputs": { "nixpkgs-lib": [ "nixpkgs" @@ -186,15 +278,14 @@ "locked": { "lastModified": 1768135262, "narHash": "sha256-PVvu7OqHBGWN16zSi6tEmPwwHQ4rLPU9Plvs8/1TUBY=", - "owner": "hercules-ci", - "repo": "flake-parts", "rev": "80daad04eddbbf5a4d883996a73f3f542fa437ac", - "type": "github" + "revCount": 435, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/hercules-ci/flake-parts/0.1.435%2Brev-80daad04eddbbf5a4d883996a73f3f542fa437ac/019bae22-b551-7786-bf6d-33671a04a044/source.tar.gz" }, "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" + "type": "tarball", + "url": "https://flakehub.com/f/hercules-ci/flake-parts/0.1" } }, "flake-utils": { @@ -226,17 +317,42 @@ ] }, "locked": { - "lastModified": 1768935149, - "narHash": "sha256-S5/BZo4X1D9+U/yJ6xCJyUkXZ8y261q2gPP5Xsq8RPU=", - "owner": "cachix", - "repo": "git-hooks.nix", - "rev": "18cbede9ff6da05b911c5c4802a397c2686ac8fa", - "type": "github" + "lastModified": 1768908798, + "narHash": "sha256-98kaVYyT0tb8CFSkXPxLs+Ezv2FnBH84pwvQVAXrMWw=", + "rev": "be7d943c905ac39110153679404546625757ec5a", + "revCount": 1155, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/cachix/git-hooks.nix/0.1.1155%2Brev-be7d943c905ac39110153679404546625757ec5a/019bdc82-8920-7eb0-9f5a-be51424e567b/source.tar.gz" }, "original": { - "owner": "cachix", - "repo": "git-hooks.nix", - "type": "github" + "type": "tarball", + "url": "https://flakehub.com/f/cachix/git-hooks.nix/0.1" + } + }, + "git-hooks-nix": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": [ + "determinate", + "nix" + ], + "nixpkgs": [ + "determinate", + "nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1747372754, + "narHash": "sha256-2Y53NGIX2vxfie1rOW0Qb86vjRZ7ngizoo+bnXU9D9k=", + "rev": "80479b6ec16fefd9c1db3ea13aeb038c60530f46", + "revCount": 1026, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/cachix/git-hooks.nix/0.1.1026%2Brev-80479b6ec16fefd9c1db3ea13aeb038c60530f46/0196d79a-1b35-7b8e-a021-c894fb62163d/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/cachix/git-hooks.nix/0.1.941" } }, "home-manager": { @@ -248,15 +364,14 @@ "locked": { "lastModified": 1768942641, "narHash": "sha256-i25tkhqjsfo0YKz8To/+gzazW1v4f8qUGqJQ8OLrkqE=", - "owner": "nix-community", - "repo": "home-manager", "rev": "9997de2f62d1875644f02ddf96cf485a4baecb6f", - "type": "github" + "revCount": 6129, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/nix-community/home-manager/0.1.6129%2Brev-9997de2f62d1875644f02ddf96cf485a4baecb6f/019bdd33-ca41-7b26-9762-051337582a6f/source.tar.gz" }, "original": { - "owner": "nix-community", - "repo": "home-manager", - "type": "github" + "type": "tarball", + "url": "https://flakehub.com/f/nix-community/home-manager/0.1" } }, "homebrew-cask": { @@ -318,17 +433,16 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1768307256, - "narHash": "sha256-3yDvlAqWa0Vk3B9hFRJJrSs1xc+FwVQFLtu//VrTR4c=", - "owner": "nix-community", - "repo": "lanzaboote", - "rev": "7e031eb535a494582f4fc58735b5aecba7b57058", - "type": "github" + "lastModified": 1765382359, + "narHash": "sha256-RJmgVDzjRI18BWVogG6wpsl1UCuV6ui8qr4DJ1LfWZ8=", + "rev": "e8c096ade12ec9130ff931b0f0e25d2f1bc63607", + "revCount": 907, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/nix-community/lanzaboote/1.0.0/019b0902-2151-7a47-8eb2-e1d3c9d15f94/source.tar.gz" }, "original": { - "owner": "nix-community", - "repo": "lanzaboote", - "type": "github" + "type": "tarball", + "url": "https://flakehub.com/f/nix-community/lanzaboote/1" } }, "make-shell": { @@ -349,6 +463,27 @@ "type": "github" } }, + "nix": { + "inputs": { + "flake-parts": "flake-parts", + "git-hooks-nix": "git-hooks-nix", + "nixpkgs": "nixpkgs", + "nixpkgs-23-11": "nixpkgs-23-11", + "nixpkgs-regression": "nixpkgs-regression" + }, + "locked": { + "lastModified": 1766546676, + "narHash": "sha256-GsC52VFF9Gi2pgP/haQyPdQoF5Qe2myk1tsPcuJZI28=", + "rev": "51dacdd248e8071cd0243a8245c8c42ac1f33307", + "revCount": 24299, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/nix-src/3.15.1/019b4e84-d036-75db-b6c6-6bc2e2035c53/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/DeterminateSystems/nix-src/%2A" + } + }, "nix-homebrew": { "inputs": { "brew-src": "brew-src" @@ -387,29 +522,6 @@ "type": "github" } }, - "nix4vscode": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ], - "systems": [ - "systems" - ] - }, - "locked": { - "lastModified": 1768875311, - "narHash": "sha256-d4FdAj3nssU7B6eXnLe5PW4qXWBur6VC2gLTJwFQjAw=", - "owner": "nix-community", - "repo": "nix4vscode", - "rev": "1333b79bfb0c1503859575f12697d93f32377be8", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nix4vscode", - "type": "github" - } - }, "nixos-hardware": { "locked": { "lastModified": 1768736227, @@ -421,26 +533,85 @@ }, "original": { "owner": "NixOS", + "ref": "master", "repo": "nixos-hardware", "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1768564909, - "narHash": "sha256-Kell/SpJYVkHWMvnhqJz/8DqQg2b6PguxVWOuadbHCc=", - "owner": "nixos", + "lastModified": 1761597516, + "narHash": "sha256-wxX7u6D2rpkJLWkZ2E932SIvDJW8+ON/0Yy8+a5vsDU=", + "rev": "daf6dc47aa4b44791372d6139ab7b25269184d55", + "revCount": 811874, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2505.811874%2Brev-daf6dc47aa4b44791372d6139ab7b25269184d55/019a3494-3498-707e-9086-1fb81badc7fe/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/NixOS/nixpkgs/0.2505" + } + }, + "nixpkgs-23-11": { + "locked": { + "lastModified": 1717159533, + "narHash": "sha256-oamiKNfr2MS6yH64rUn99mIZjc45nGJlj9eGth/3Xuw=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "e4bae1bd10c9c57b2cf517953ab70060a828ee6f", + "rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446", "type": "github" }, "original": { - "owner": "nixos", - "ref": "nixos-unstable", + "owner": "NixOS", "repo": "nixpkgs", + "rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446", "type": "github" } }, + "nixpkgs-regression": { + "locked": { + "lastModified": 1643052045, + "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1766314097, + "narHash": "sha256-laJftWbghBehazn/zxVJ8NdENVgjccsWAdAqKXhErrM=", + "rev": "306ea70f9eb0fb4e040f8540e2deab32ed7e2055", + "revCount": 914780, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.914780%2Brev-306ea70f9eb0fb4e040f8540e2deab32ed7e2055/019b49b8-ed0f-724e-bdaf-5fd90cc1c590/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/DeterminateSystems/nixpkgs-weekly/0.1" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1768564909, + "narHash": "sha256-Kell/SpJYVkHWMvnhqJz/8DqQg2b6PguxVWOuadbHCc=", + "rev": "e4bae1bd10c9c57b2cf517953ab70060a828ee6f", + "revCount": 928726, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.928726%2Brev-e4bae1bd10c9c57b2cf517953ab70060a828ee6f/019bc8c9-d277-7e35-b3d9-c36e1fdbfb5a/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/NixOS/nixpkgs/0.1" + } + }, "nixvim": { "inputs": { "flake-parts": [ @@ -536,8 +707,9 @@ "custom-homebrew-formulas": "custom-homebrew-formulas", "darwin": "darwin", "deploy-rs": "deploy-rs", + "determinate": "determinate", "disko": "disko", - "flake-parts": "flake-parts", + "flake-parts": "flake-parts_2", "flake-utils": "flake-utils", "git-hooks": "git-hooks", "home-manager": "home-manager", @@ -548,9 +720,8 @@ "make-shell": "make-shell", "nix-homebrew": "nix-homebrew", "nix-index-database": "nix-index-database", - "nix4vscode": "nix4vscode", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_3", "nixvim": "nixvim", "op-shell-plugins": "op-shell-plugins", "opnix": "opnix", @@ -570,11 +741,11 @@ ] }, "locked": { - "lastModified": 1768272338, - "narHash": "sha256-Tg/kL8eKMpZtceDvBDQYU8zowgpr7ucFRnpP/AtfuRM=", + "lastModified": 1765075567, + "narHash": "sha256-KFDCdQcHJ0hE3Nt5Gm5enRIhmtEifAjpxgUQ3mzSJpA=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "03dda130a8701b08b0347fcaf850a190c53a3c1e", + "rev": "769156779b41e8787a46ca3d7d76443aaf68be6f", "type": "github" }, "original": { @@ -646,15 +817,14 @@ "locked": { "lastModified": 1768158989, "narHash": "sha256-67vyT1+xClLldnumAzCTBvU0jLZ1YBcf4vANRWP3+Ak=", - "owner": "numtide", - "repo": "treefmt-nix", "rev": "e96d59dff5c0d7fddb9d113ba108f03c3ef99eca", - "type": "github" + "revCount": 528, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/numtide/treefmt-nix/0.1.528%2Brev-e96d59dff5c0d7fddb9d113ba108f03c3ef99eca/019bb0bc-f5b4-7d3a-be8e-946b6d9fe8e0/source.tar.gz" }, "original": { - "owner": "numtide", - "repo": "treefmt-nix", - "type": "github" + "type": "tarball", + "url": "https://flakehub.com/f/numtide/treefmt-nix/0.1" } }, "vim-autoread": { diff --git a/flake.nix b/flake.nix index 9150595b..eb3d15f2 100644 --- a/flake.nix +++ b/flake.nix @@ -18,7 +18,7 @@ flake = false; }; darwin = { - url = "github:nix-darwin/nix-darwin"; + url = "https://flakehub.com/f/nix-darwin/nix-darwin/0.1"; inputs.nixpkgs.follows = "nixpkgs"; }; deploy-rs = { @@ -29,8 +29,11 @@ nixpkgs.follows = "nixpkgs"; }; }; + determinate = { + url = "https://flakehub.com/f/DeterminateSystems/determinate/3"; + }; disko = { - url = "github:nix-community/disko"; + url = "https://flakehub.com/f/nix-community/disko/1"; inputs.nixpkgs.follows = "nixpkgs"; }; flake-utils = { @@ -38,11 +41,11 @@ inputs.systems.follows = "systems"; }; flake-parts = { - url = "github:hercules-ci/flake-parts"; + url = "https://flakehub.com/f/hercules-ci/flake-parts/0.1"; inputs.nixpkgs-lib.follows = "nixpkgs"; }; git-hooks = { - url = "github:cachix/git-hooks.nix"; + url = "https://flakehub.com/f/cachix/git-hooks.nix/0.1"; inputs = { nixpkgs.follows = "nixpkgs"; # Optional inputs removed @@ -51,7 +54,7 @@ }; }; home-manager = { - url = "github:nix-community/home-manager"; + url = "https://flakehub.com/f/nix-community/home-manager/0.1"; inputs.nixpkgs.follows = "nixpkgs"; }; homebrew-cask = { @@ -66,7 +69,7 @@ url = "github:vic/import-tree"; }; lanzaboote = { - url = "github:nix-community/lanzaboote"; + url = "https://flakehub.com/f/nix-community/lanzaboote/1"; inputs = { pre-commit.follows = "git-hooks"; nixpkgs.follows = "nixpkgs"; @@ -91,18 +94,11 @@ systems.follows = "systems"; }; }; - nix4vscode = { - url = "github:nix-community/nix4vscode"; - inputs = { - nixpkgs.follows = "nixpkgs"; - systems.follows = "systems"; - }; - }; nixpkgs = { - url = "github:nixos/nixpkgs?ref=nixos-unstable"; + url = "https://flakehub.com/f/NixOS/nixpkgs/0.1"; }; nixos-hardware = { - url = "github:NixOS/nixos-hardware"; + url = "github:NixOS/nixos-hardware/master"; }; op-shell-plugins = { url = "github:1password/shell-plugins"; @@ -137,7 +133,7 @@ url = "github:nix-systems/default"; }; treefmt-nix = { - url = "github:numtide/treefmt-nix"; + url = "https://flakehub.com/f/numtide/treefmt-nix/0.1"; inputs.nixpkgs.follows = "nixpkgs"; }; vim-autoread = { @@ -146,95 +142,10 @@ }; }; - /* - outputs = - inputs: - let - inherit (inputs) snowfall-lib treefmt-nix; - - lib = snowfall-lib.mkLib { - inherit inputs; - src = ./.; - - snowfall = { - meta = { - name = "setup-flake"; - title = "My custom MacOS configuration flake"; - }; - - namespace = "aaccardo"; - }; - }; - in - lib.mkFlake { - channels-config = { - # allowBroken = true; - allowUnfree = true; - # showDerivationWarnings = [ "maintainerless" ]; - permittedInsecurePackages = [ ]; - }; - - overlays = with inputs; [ - nix4vscode.overlays.default - ]; - - homes.modules = with inputs; [ - catppuccin.homeModules.catppuccin - inputs.op-shell-plugins.hmModules.default - nix-index-database.homeModules.nix-index - opnix.homeManagerModules.default - ]; - - systems.modules = { - darwin = with inputs; [ - nix-homebrew.darwinModules.nix-homebrew - ( - { - config, - namespace, - ... - }: - { - nix-homebrew = { - inherit (config.${namespace}.tools.homebrew) enable; - user = config.${namespace}.user.name; - taps = { - "homebrew/homebrew-core" = homebrew-core; - "homebrew/homebrew-cask" = homebrew-cask; - "hackardox/homebrew-formulas" = custom-homebrew-formulas; - "slp/homebrew-krunkit" = homebrew-tap-krunkit; - }; - mutableTaps = false; - autoMigrate = true; - }; - } - ) - opnix.darwinModules.default - spicetify-nix.darwinModules.spicetify - ]; - }; - - templates = { - default.description = "Default template"; - expo.description = "Expo template"; - next-js.description = "NextJS template"; - node.description = "Node template"; - python.description = "Python template"; - rust.description = "Rust template"; - }; - - # deploy = lib.mkDeploy { inherit (inputs) self; }; - - outputs-builder = channels: { - formatter = treefmt-nix.lib.mkWrapper channels.nixpkgs ./treefmt.nix; - }; - }; - */ - - nixConfig = { - # abort-on-warn = true; - extra-experimental-features = [ "pipe-operators" ]; - }; + # nixConfig = { + # abort-on-warn = true; + # extra-experimental-features = [ "pipe-operators" ]; + # }; outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules); } diff --git a/modules/nix/settings.nix b/modules/nix/_settings.nix similarity index 100% rename from modules/nix/settings.nix rename to modules/nix/_settings.nix diff --git a/modules/nix/determinate-system.nix b/modules/nix/determinate-system.nix new file mode 100644 index 00000000..9ffbfa32 --- /dev/null +++ b/modules/nix/determinate-system.nix @@ -0,0 +1,84 @@ +{ inputs, lib, ... }: +let + polyModule = + { config, pkgs, ... }: + { + environment.systemPackages = [ pkgs.git ]; + + determinate-nix = { + customSettings = + let + users = [ + "root" + "@wheel" + "nix-builder" + config.system.primaryUser + ]; + in + { + accept-flake-config = lib.mkForce false; + allowed-users = users; + auto-optimise-store = pkgs.stdenv.hostPlatform.isLinux; + builders-use-substitutes = true; + download-buffer-size = 500000000; + experimental-features = [ + "auto-allocate-uids" + "ca-derivations" + "dynamic-derivations" + "pipe-operators" + "recursive-nix" + ]; + fallback = true; + flake-registry = "/etc/nix/registry.json"; + http-connections = 25; + keep-derivations = true; + keep-going = true; + keep-outputs = true; + log-lines = 50; + preallocate-contents = true; + sandbox = "relaxed"; + trusted-users = users; + warn-dirty = false; + + allowed-impure-host-deps = [ + "/bin/sh" + "/dev/random" + "/dev/urandom" + "/dev/zero" + "/usr/bin/ditto" + "/usr/lib/libSystem.B.dylib" + "/usr/lib/libc.dylib" + "/usr/lib/system/libunc.dylib" + ]; + + use-xdg-base-directories = true; + + extra-sandbox-paths = [ + "/System/Library/Frameworks" + "/System/Library/PrivateFrameworks" + "/usr/lib" + "/private/tmp" + "/private/var/tmp" + "/usr/bin/env" + ]; + extra-system-features = [ "recursive-nix" ]; + }; + }; + }; +in +{ + flake.modules.nixos.base = { + imports = [ + inputs.determinate.nixosModules.default + polyModule + ]; + }; + + flake.modules.darwin.base = { + imports = [ + inputs.determinate.darwinModules.default + polyModule + ]; + nix.enable = false; + }; +}