From 9ad889e37313764e391a7bf4c512c1c7a62e9958 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Sat, 14 Dec 2024 18:53:36 +0000 Subject: [PATCH] docs(nix): pkgs.system -> pkgs.stdenv.hostPlatform.system (#309) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs(nix): `pkgs.system` -> `pkgs.stdenv.hostPlatform.system` `pkgs.system` is not generally recommended. It's usually better to explicitly using the "host platform" system from `pkgs.stdenv`. This is required to support cross-compile, for example. * docs(nix): define package in `let-in` block * docs(nix): define `system` in `let-in` block * docs(nix): use github-admonition for truststore note * docs(nix): add note regarding `specialArgs` * docs(nix): simplify version string No need to interpolate a string into a string 😁 * docs(nix): simplify input flakeref url This is the preferred syntax for github-based flake refs. * docs(nix): fix typo `umu= {` -> `umu = {` --- README.md | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e2cb1e877..e86b15afd 100644 --- a/README.md +++ b/README.md @@ -145,8 +145,8 @@ If there is any problem with the flake feel free to open a bug report and tag an If you want to add umu-launcher as a flake add this to your inputs in `flake.nix` ```nix inputs = { - umu= { - url = "git+https://github.com/Open-Wine-Components/umu-launcher/?dir=packaging\/nix&submodules=1"; + umu = { + url = "github:Open-Wine-Components/umu-launcher?dir=packaging/nix"; inputs.nixpkgs.follows = "nixpkgs"; }; } @@ -154,12 +154,38 @@ If you want to add umu-launcher as a flake add this to your inputs in `flake.nix and in your `configuration.nix` ```nix {inputs, pkgs, ... }: +let + inherit (pkgs.stdenv.hostPlatform) system; + umu = inputs.umu.packages.${system}.umu.override { + version = inputs.umu.shortRev; + truststore = true; + }; +in { - environment.systemPackages = [ (inputs.umu.packages.${pkgs.system}.umu.override {version = "${inputs.umu.shortRev}"; truststore = true;}) ]; + environment.systemPackages = [ umu ]; } ``` +> [!NOTE] > truststore is an optional dependency that is enabled by default if you want to keep it that way you can remove the `truststore = true;` part +> [!NOTE] +> The example above relies on having your flake's `inputs` passed through to your nixos configuration. +> This can be done with `specialArgs` or `_module.args`, e.g: +> ```nix +> { +> # inputs omitted ... +> +> # Assign a name to the input args using @inputs +> outputs = { self, nixpkgs, ... }@inputs: { +> nixosConfiurations."your-hostname" = nixpkgs.lib.nixosSystem { +> system = "x86_64-linux"; +> specialArgs = { inherit self inputs; }; +> # modules omitted ... +> }; +> }; +> } +> ``` + ## Contributing Contributions are welcome and appreciated. To get started, install [ruff](https://github.com/astral-sh/ruff) from your distribution and enable [ruff server](https://github.com/astral-sh/ruff/blob/main/crates/ruff_server/README.md) in your editor.