Update the flake such that it uses nixpkgs' package (#17)

* Update the flake such that it uses nixpkgs' package with an overriden source rather than keeping a copy

* Update flake.nix

* Update the flake lock file, and make supported systems match the package

* remove surplus whitespace
This commit is contained in:
Skyler 2022-06-05 13:37:33 +01:00 committed by GitHub
parent 6b284ff6e8
commit 02cb0c50c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 48 deletions

View File

@ -2,10 +2,9 @@
"nodes": { "nodes": {
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1653087707, "lastModified": 0,
"narHash": "sha256-zfno3snrzZTWQ2B7K53QHrGZwrjnJLTRPalymrSsziU=", "narHash": "sha256-kP4m7ZgFYj8fh7oW2L0uW0sJw/e0k1HY26HYJcvNEKM=",
"path": "/nix/store/3g25cg20m43hvsy17d7nz0jxwk79a77w-source", "path": "/nix/store/ayvjhxw0zjwp5ipvwlhbhrwqqw553h2f-source",
"rev": "cbd40c72b2603ab54e7208f99f9b35fc158bc009",
"type": "path" "type": "path"
}, },
"original": { "original": {
@ -13,9 +12,26 @@
"type": "indirect" "type": "indirect"
} }
}, },
"nixpkgs-unstable": {
"locked": {
"lastModified": 1654245945,
"narHash": "sha256-PV6MZ+HuNnyLxQGa2rwt0BmCRkQS2xqhc+SeJLQM+WU=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "442db9429b9fbdb6352cfb937afc8ecccfe2633f",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable"
} }
} }
}, },

View File

@ -1,55 +1,26 @@
{ {
description = "A flake to run pridefetch"; description = "A flake to run pridefetch";
outputs = { self, nixpkgs }: let inputs = {
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
};
outputs = { self, nixpkgs, nixpkgs-unstable }: let
system = "x86_64-linux"; system = "x86_64-linux";
forAllSystems = f: nixpkgs.lib.genAttrs nixpkgs.lib.systems.supported.hydra (system: f system); forAllSystems = f: nixpkgs.lib.genAttrs nixpkgs.lib.platforms.all (system: f system);
in rec { in rec {
packages = forAllSystems (system: let packages = forAllSystems (system: let
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
}; };
in { pkgs-unstable = import nixpkgs-unstable {
pridefetch = pkgs.stdenv.mkDerivation { inherit system;
name = "pridefetch";
buildInputs = with pkgs; [
(python39.withPackages (pythonPackages: with pythonPackages; [
distro
]))
zip
];
unpackPhase = "true";
installPhase = ''
mkdir -p $out/bin
cd ${./src}
zip -r $out/pridefetch.zip *
echo '#!/usr/bin/env python' | cat - $out/pridefetch.zip > $out/bin/pridefetch
chmod +x $out/bin/pridefetch
rm $out/pridefetch.zip
'';
meta = with pkgs.lib; {
description = "Print out system statistics with pride flags";
longDescription = ''
Pridefetch prints your system statistics (similarly to neofetch, screenfetch or pfetch) along with a pride flag.
The flag which is printed is configurable, as well as the width of the output.
'';
homepage = https://github.com/SpyHoodle/pridefetch;
license = "bsd";
# https://static.domenkozar.com/nixpkgs-manual-sphinx-exp/meta.xml.html
# > Catch-all for licenses that are essentially similar to the original BSD license with the advertising clause removed, i.e. permissive non-copyleft free software licenses. This includes the X11 (“MIT”) License.
# our license is MIT, so BSD is set here
maintainers = [
{
email = "skyler3665@gmail.com";
github = "minion3665";
githubId = 34243578;
name = "Skyler Grey";
}
]; # TODO: Replace this with a reference to the maintainer list after adding myself to it
platforms = systems.supported.hydra;
};
}; };
in {
pridefetch = pkgs-unstable.pridefetch.overrideAttrs (finalAttrs: previousAttrs: {
src = builtins.path { path = ./.; name = "pridefetch"; };
});
}); });
defaultPackage = forAllSystems (system: self.packages.${system}.pridefetch); defaultPackage = forAllSystems (system: self.packages.${system}.pridefetch);