From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.6 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 17EFEC18B; Wed, 21 Dec 2022 11:19:17 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 496) id BB0ABC176; Wed, 21 Dec 2022 11:19:14 +0000 (UTC) Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by atuin.qyliss.net (Postfix) with ESMTPS id 52C16C174 for ; Wed, 21 Dec 2022 11:19:11 +0000 (UTC) Received: by mail-ej1-x631.google.com with SMTP id jo4so27123437ejb.7 for ; Wed, 21 Dec 2022 03:19:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unikie.com; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=SXMAML+DYCtvHz3lO0lgOwjyM0Q27jlKTAgAYryTHxg=; b=e7J8+25/Nfu64YHeGqZczVpmEFXHrLKpDg1AZfPK+UJWjzAMfg/DRBITAFOk5jR9le gaEzY32XBhv2kZsJeGJESRX6XNIVQc7RxtQeybCYxhs9PWtw5n38ixc0/7Kymd/md/HE bj2QFjq+ukue/2/LChGcWiB/HBSxkZXd0+/zFbuD3/yFNWeYy/0pOhuhVHnNRShZ80K+ 9j2cdXbOawyFkyhVcfhxSMdTb9QCNY9osW8gJvTSjjrEeVR/bL0HIIBY3Lhy3pa9iwbR +vSuQwLwuWcy5rhDD9+RrRqBpV8J94gWJ2AKpat8YirZug/j27d46mjIzyEAAGMwFQCw ZAkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=SXMAML+DYCtvHz3lO0lgOwjyM0Q27jlKTAgAYryTHxg=; b=yWLs/GNUNxp/hI5j7fxkUEtJeR09NYWuX1THjZfDdYKitVgfxPCwIM/tX+sWwOUwKd DYFTCU2t9gJQVKiLG5WBxWjJWjdANmbiMvYyBzc2RqZ5PZoZWRiafHzdhIM2mNf0VME7 pMCgtmSnGC0+1HwX1R2Z8IV5GJ3KQQ9rX2jfYpAm+hDJiwUfv0r/SuryCAJdrhtPtqz4 KFwj8RCjhnNvsdIFLnlPkxNKvL/q51NpzlSp3eS+QDSFHyZuUqLSNOWBSY21FJ55FMSJ NkbrYSJsxWVTznoOZkOktVK6/CI4pAZZd7kDLRU0ZmteWRD3PmMxCS5cUCWYxIYpcgqL gd9Q== X-Gm-Message-State: AFqh2kqizwlar8E8JmFSYZfTSYgdR33/pC6hcHELKi0+P40nUNIgjJzE +sfWClbztF0v1xWyD5P6xSGjVij+ZfPBWziI X-Google-Smtp-Source: AMrXdXsNgGtNVvnNkQPAOGi1lF4/cqm5lR7KVdqiR4R/gTgyDUyC222LuVh0/xlDZIpXWtph8V/D8A== X-Received: by 2002:a17:906:4f14:b0:7c1:98e:ed20 with SMTP id t20-20020a1709064f1400b007c1098eed20mr1075373eju.35.1671621550593; Wed, 21 Dec 2022 03:19:10 -0800 (PST) Received: from x220.qyliss.net (p200300ed671036010000000000000006.dip0.t-ipconnect.de. [2003:ed:6710:3601::6]) by smtp.gmail.com with ESMTPSA id j18-20020a17090623f200b007e5856d6359sm6618048ejg.66.2022.12.21.03.19.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 03:19:10 -0800 (PST) Received: by x220.qyliss.net (Postfix, from userid 1000) id 65EFA293; Wed, 21 Dec 2022 11:19:09 +0000 (UTC) Date: Wed, 21 Dec 2022 11:19:09 +0000 From: Alyssa Ross To: Valentin Kharin Subject: Re: [PATCH 1/2] Add flakes support Message-ID: <20221221111909.erhucrbdtylm45vo@x220> References: <20221214110954.141676-1-valentin.kharin@unikie.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="e7dknc3ias7whpbm" Content-Disposition: inline In-Reply-To: <20221214110954.141676-1-valentin.kharin@unikie.com> Message-ID-Hash: 7W3ZYRCVOUMQQQ2BMX2AFMDRPBQTY7SC X-Message-ID-Hash: 7W3ZYRCVOUMQQQ2BMX2AFMDRPBQTY7SC X-MailFrom: alyssa.ross@unikie.com X-Mailman-Rule-Hits: header-match-devel.spectrum-os.org-0 X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1 CC: devel@spectrum-os.org X-Mailman-Version: 3.3.5 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --e7dknc3ias7whpbm Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 14, 2022 at 01:09:53PM +0200, Valentin Kharin wrote: > Signed-off-by: Valentin Kharin Thanks! I've been ill so just getting around to looking at this now. I've left some comments below, but it looks on the right track. > --- > flake.lock | 43 +++++++++++++++++++++++++++++++++ > flake.nix | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 114 insertions(+) > create mode 100644 flake.lock > create mode 100644 flake.nix Both files need license information attached. Following existing conventions in Spectrum, this should be: - MIT for flake.nix - CC0-1.0 for flake.lock Since flake.lock is a generated file, you can put the license information in a flake.lock.license file =E2=80=94 there are other examples= of this in the tree you can refer to. You can do a basic check that the license information looks right by running `reuse lint`. > diff --git a/flake.lock b/flake.lock > new file mode 100644 > index 0000000..aa4ee5e > --- /dev/null > +++ b/flake.lock > @@ -0,0 +1,43 @@ > +{ > + "nodes": { > + "flake-utils": { > + "locked": { > + "lastModified": 1667395993, > + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA= =3D", > + "owner": "numtide", > + "repo": "flake-utils", > + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", > + "type": "github" > + }, > + "original": { > + "owner": "numtide", > + "repo": "flake-utils", > + "type": "github" > + } > + }, > + "nixpkgs": { > + "locked": { > + "lastModified": 1669635185, > + "narHash": "sha256-vYg6GjnsEWNWt/4TmfFN9WtQmSXb4S796J2UOfyTcW0= =3D", > + "ref": "refs/heads/rootfs", > + "rev": "3176ddef4b4cec85faa2f49d29ce74816d452dc0", > + "revCount": 429673, > + "type": "git", > + "url": "https://spectrum-os.org/git/nixpkgs/" > + }, > + "original": { > + "ref": "refs/heads/rootfs", > + "type": "git", > + "url": "https://spectrum-os.org/git/nixpkgs/" > + } > + }, > + "root": { > + "inputs": { > + "flake-utils": "flake-utils", > + "nixpkgs": "nixpkgs" > + } > + } > + }, > + "root": "root", > + "version": 7 > +} > diff --git a/flake.nix b/flake.nix > new file mode 100644 > index 0000000..6e77006 > --- /dev/null > +++ b/flake.nix > @@ -0,0 +1,71 @@ > +{ > + description =3D "A compartmentalized operating system"; > + > + # NOTE: Revision specification format is ?ref=3Drefs%2fheads%2f&rev=3D > + inputs.nixpkgs.url =3D > + "git+https://spectrum-os.org/git/nixpkgs/?ref=3Drefs%2fheads%2frootf= s"; > + inputs.flake-utils.url =3D "github:numtide/flake-utils"; > + > + outputs =3D { self, nixpkgs, flake-utils }: > + flake-utils.lib.eachDefaultSystem (system: We should probably list only supported platforms here, right? (And then maybe we wouldn't need the flake-utils dependency?) > + let > + pkgs =3D nixpkgs.legacyPackages.${system}; > + config =3D { inherit pkgs; }; > + lib =3D pkgs.lib; > + > + mkEntryPoint =3D { name ? builtins.baseNameOf path, path > + , enableShell ? true, enablePackage ? true }: > + let > + shell =3D { > + # NOTE: https://stackoverflow.com/a/43850372 > + devShells.${name} =3D > + import (path + "/shell.nix") { inherit config; }; > + }; > + package =3D { packages.${name} =3D import path { inherit con= fig; }; }; > + in (if enableShell then shell else { }) > + // (if enablePackage then package else { }); > + > + # Entry point is a directory with shell.nix and default.nix > + # This function maps every entry point to corresponding devShell= and package > + mapEntryPoints =3D epoints: > + builtins.foldl' lib.recursiveUpdate { } (map mkEntryPoint epoi= nts); > + in lib.recursiveUpdate (mapEntryPoints [ > + { > + path =3D ./.; > + enablePackage =3D false; > + } > + { path =3D ./host/initramfs; } > + { path =3D ./host/rootfs; } > + { path =3D ./host/start-vm; } > + { path =3D ./img/app; } > + { path =3D ./release/live; } > + { path =3D ./vm/sys/net; } > + ]) { > + # Add some other flake schema related stuff here. > + # NOTE: flake-utils.lib.eachDefaultSystem automagically adds ${s= ystem}. > + devShells.documentation =3D import ./Documentation { inherit con= fig; }; > + packages.documentation =3D import ./Documentation { inherit conf= ig; }; > + > + nixosModules =3D let > + substituters =3D [ "https://cache.dataaturservice.se/spectrum/= " ]; > + trusted-public-keys =3D [ > + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDSh= jY=3D" > + "spectrum-os.org-1:rnnSumz3+Dbs5uewPlwZSTP0k3g/5SRG4hD7Wbr9Y= uQ=3D" > + ]; > + in { > + # NOTE: See https://nixos.org/manual/nix/stable/command-ref/co= nf-file.html#conf-substituters > + # and https://nixos.org/manual/nix/stable/command-ref/conf-fil= e.html#conf-trusted-substituters > + # to understand difference between these two modules. > + binary-cache =3D { ... }: { > + nix.settings =3D { inherit trusted-public-keys substituters;= }; > + }; > + # Doesn't enabled by This comment looks unfinished? > + trusted-binary-cache =3D { ... }: { > + nix.settings =3D { > + inherit trusted-public-keys; > + trusted-substituters =3D substituters; > + }; > + }; > + }; > + }); > +} > -- > 2.38.1 > > --e7dknc3ias7whpbm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEH9wgcxqlHM/ARR3h+dvtSFmyccAFAmOi66sACgkQ+dvtSFmy ccAUFQ//Zsa+5NqEZApXrRBfrPytxPE8RE+jrG2TGKJiqu4fl6SNvxgHKpKbmaTZ nI2FF1eDCfopJvwFPpG63Mk1iDfw8Nd4NSXbL550NaxRQx0utkngs4DfqGk5FJdC 7TSrY8OdMkonY3Ew6phK/XGaAKdWFCiX5ltprXI0SIUd66/KnzFzmV7J2QKiIiyl AfdYCA8Sl0jJRQeVH+IHPIM3Zq3Er9Doggn42C7/TP2GUTjg7y2MEBIAVHks/l5P 6nBESP5QO70uph2SCMsT3TKMP2oYlD2NgtRhktANPRZ4duTRvAitVHYjTsvpECE5 6asyvSHWG8tsbe8yQu65ahzUzfHKOQUFZvtfcPm5Qyl6Lvke17Ig5ky0QQpQ/qYN K7CU6LpXIhyHmdSyHKbpdmRx9uDFGs4MJzx0gYMTdb4v3ok8aXI/jvrZo+FzSrKj C+PVn4ZsM4nkp8wDOC5mQZ0HlAN8cXayVj+2vePGcej/1OMUxkmEuKsrrs11KDtx 8FMGuwHHF7QP7Pfjn+2f0ifsx1NIlh9sWXMt41ooGZRYA9hJ8GMcqJJowX6HYiC+ BJA0ayz6lpTO5GskRJ2V5BR35RqD4QABck0zIntAjmS/70GLJEgpR58Q/LOdb8Bc 2TVBPpvNKCoAYZtBtyH7qKpbwvIGWfQZqATIyLCDLxB/iUh2wqE= =BFaa -----END PGP SIGNATURE----- --e7dknc3ias7whpbm--