Skip to content

Commit

Permalink
Remove an IFD when importing nixos-appstream-data.
Browse files Browse the repository at this point in the history
I recently added a flake for nixos-appstream-data. This allows us to
depend on that flake instead of doing an IFD to load its
default.nix.

An IFD in nix-software-center is problematic for users who use
flakes and have multiple nixos configurations with different
architectures. Because of NixOS/nix#4265
this causes `nix flake check` to fail for them.

Note that users of nix-software-center that do not rely on the flake
will still need an IFD. I'm not aware of a better way (other than
upstreaming both in nixpkgs).

TODO: point this back to snowfallorg's repo after
snowfallorg/nixos-appstream-data#1 is merged.
  • Loading branch information
korfuri committed Apr 11, 2024
1 parent 68e87fb commit 42092ac
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 21 deletions.
21 changes: 9 additions & 12 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
{ pkgs ? import <nixpkgs> { }
, lib ? import <nixpkgs/lib>
}:
let
nixos-appstream-data = (import
(pkgs.fetchFromGitHub {
owner = "vlinkz";
repo = "nixos-appstream-data";
rev = "66b3399e6d81017c10265611a151d1109ff1af1b";
hash = "sha256-oiEZD4sMpb2djxReg99GUo0RHWAehxSyQBbiz8Z4DJk=";
})
{ set = "all"; stdenv = pkgs.stdenv; lib = pkgs.lib; pkgs = pkgs; });
in
pkgs.stdenv.mkDerivation rec {
, nixos-appstream-data ? (import
(pkgs.fetchFromGitHub {
owner = "vlinkz";
repo = "nixos-appstream-data";
rev = "66b3399e6d81017c10265611a151d1109ff1af1b";
hash = "sha256-oiEZD4sMpb2djxReg99GUo0RHWAehxSyQBbiz8Z4DJk=";
})
{ set = "all"; stdenv = pkgs.stdenv; lib = pkgs.lib; pkgs = pkgs; })
}: pkgs.stdenv.mkDerivation rec {
pname = "nix-software-center";
version = "0.1.2";

Expand Down
25 changes: 25 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 8 additions & 9 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,24 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
utils.url = "github:numtide/flake-utils";
nixos-appstream-data = {
url = "github:korfuri/nixos-appstream-data/flake";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "utils";
};
};

outputs = { self, nixpkgs, utils, ... }:
outputs = { self, nixpkgs, utils, nixos-appstream-data, ... }:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
nixos-appstream-data = pkgs.fetchFromGitHub {
owner = "vlinkz";
repo = "nixos-appstream-data";
rev = "66b3399e6d81017c10265611a151d1109ff1af1b";
hash = "sha256-oiEZD4sMpb2djxReg99GUo0RHWAehxSyQBbiz8Z4DJk=";
};
in
rec
{
packages = let
nix-software-center = pkgs.callPackage ./default.nix {};
nix-software-center = pkgs.callPackage ./default.nix { inherit (nixos-appstream-data.packages."${system}") nixos-appstream-data; };
in {
inherit nix-software-center;
default = nix-software-center;
Expand Down Expand Up @@ -54,7 +53,7 @@
polkit
sqlite
wrapGAppsHook4
nixos-appstream-data
nixos-appstream-data.packages."${system}".nixos-appstream-data
];
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
};
Expand Down

0 comments on commit 42092ac

Please sign in to comment.