From b9dad899deaa51d7a33117a1ea1bbcae30c3f422 Mon Sep 17 00:00:00 2001 From: Alexander Tomokhov Date: Wed, 8 Nov 2023 16:04:50 +0400 Subject: [PATCH] pass /etc/nixos folder as an input to override This way it is expected to have access to this path from build results, making it possible to reproduce the build. --- flake.lock | 30 +----------------------------- flake.nix | 14 ++++++-------- 2 files changed, 7 insertions(+), 37 deletions(-) diff --git a/flake.lock b/flake.lock index 5d15b31..b22e171 100644 --- a/flake.lock +++ b/flake.lock @@ -1,18 +1,5 @@ { "nodes": { - "hardware-configuration-nix": { - "flake": false, - "locked": { - "lastModified": 1692731346, - "narHash": "sha256-rQIpYKwowqbbVVurEl5qNpuPfoRyEUMefoZXrUoO6p8=", - "path": "hardware-configuration.nix", - "type": "path" - }, - "original": { - "id": "hardware-configuration-nix", - "type": "indirect" - } - }, "nixpkgs": { "locked": { "lastModified": 1686476475, @@ -30,10 +17,8 @@ }, "root": { "inputs": { - "hardware-configuration-nix": "hardware-configuration-nix", "nixpkgs": "nixpkgs", - "selfprivacy-overlay": "selfprivacy-overlay", - "userdata-json": "userdata-json" + "selfprivacy-overlay": "selfprivacy-overlay" } }, "selfprivacy-overlay": { @@ -50,19 +35,6 @@ "type": "git", "url": "https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nix-repo.git" } - }, - "userdata-json": { - "flake": false, - "locked": { - "lastModified": 1689259484, - "narHash": "sha256-Co3QGsxCjDspP5Nzzu1zICkee5CEq+ORlxSF3bFqbCY=", - "path": "userdata/userdata.json", - "type": "path" - }, - "original": { - "id": "userdata-json", - "type": "indirect" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index a3842f3..e903a9e 100644 --- a/flake.nix +++ b/flake.nix @@ -7,23 +7,21 @@ selfprivacy-overlay.url = "git+https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nix-repo.git"; - # these inputs are expected to be set by the caller + # the /etc/nixos folder input is expected to be set by the caller # for example, upon nix build using --override-input - userdata-json.flake = false; # userdata.json - hardware-configuration-nix.flake = false; # hardware-configuration.nix + etc-nixos.flake = false; }; outputs = { self + , etc-nixos , nixpkgs , selfprivacy-overlay - , userdata-json - , hardware-configuration-nix }: let system = "x86_64-linux"; - userdata = builtins.fromJSON (builtins.readFile userdata-json); - hardware-configuration = import hardware-configuration-nix; + userdata = + builtins.fromJSON (builtins.readFile "${etc-nixos}/userdata.json"); in { nixosConfigurations = { @@ -33,7 +31,7 @@ # SelfPrivacy overlay { nixpkgs.overlays = [ selfprivacy-overlay.overlay ]; } # machine specifics - hardware-configuration + "${etc-nixos}/hardware-configuration.nix" # main configuration part ./configuration.nix ];