-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add nix environment and update script
- Loading branch information
Showing
6 changed files
with
163 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
use nix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
*.pyc | ||
.mypy_cache | ||
.ruff_cache | ||
.direnv | ||
MANIFEST | ||
build | ||
dist | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Generated by npins. Do not modify; will be overwritten regularly | ||
let | ||
data = builtins.fromJSON (builtins.readFile ./sources.json); | ||
version = data.version; | ||
|
||
mkSource = spec: | ||
assert spec ? type; let | ||
path = | ||
if spec.type == "Git" then mkGitSource spec | ||
else if spec.type == "GitRelease" then mkGitSource spec | ||
else if spec.type == "PyPi" then mkPyPiSource spec | ||
else if spec.type == "Channel" then mkChannelSource spec | ||
else builtins.throw "Unknown source type ${spec.type}"; | ||
in | ||
spec // { outPath = path; }; | ||
|
||
mkGitSource = { repository, revision, url ? null, hash, ... }: | ||
assert repository ? type; | ||
# At the moment, either it is a plain git repository (which has an url), or it is a GitHub/GitLab repository | ||
# In the latter case, there we will always be an url to the tarball | ||
if url != null then | ||
(builtins.fetchTarball { | ||
inherit url; | ||
sha256 = hash; # FIXME: check nix version & use SRI hashes | ||
}) | ||
else assert repository.type == "Git"; builtins.fetchGit { | ||
url = repository.url; | ||
rev = revision; | ||
# hash = hash; | ||
}; | ||
|
||
mkPyPiSource = { url, hash, ... }: | ||
builtins.fetchurl { | ||
inherit url; | ||
sha256 = hash; | ||
}; | ||
|
||
mkChannelSource = { url, hash, ... }: | ||
builtins.fetchTarball { | ||
inherit url; | ||
sha256 = hash; | ||
}; | ||
in | ||
if version == 3 then | ||
builtins.mapAttrs (_: mkSource) data.pins | ||
else | ||
throw "Unsupported format version ${toString version} in sources.json. Try running `npins upgrade`" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"pins": { | ||
"nixpkgs": { | ||
"type": "Channel", | ||
"name": "nixos-unstable", | ||
"url": "https://releases.nixos.org/nixos/unstable/nixos-24.05pre582649.d934204a0f8d/nixexprs.tar.xz", | ||
"hash": "0qby79hk0rjr0lazlmr4r73vcjbc5haak4y9kmlaym7rqnks8kyx" | ||
} | ||
}, | ||
"version": 3 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
let | ||
sources = import ./npins; | ||
pkgs = import sources.nixpkgs {}; | ||
in | ||
pkgs.mkShell { | ||
nativeBuildInputs = [ | ||
pkgs.gobject-introspection | ||
(pkgs.python3.withPackages (pp: [ | ||
pp.pygobject3 | ||
])) | ||
]; | ||
|
||
buildInputs = [ | ||
pkgs.appstream | ||
pkgs.atk | ||
pkgs.farstream | ||
pkgs.flatpak | ||
pkgs.gdk-pixbuf | ||
pkgs.geoclue2 | ||
pkgs.glib | ||
pkgs.gnome-online-accounts | ||
pkgs.gobject-introspection | ||
pkgs.graphene | ||
pkgs.gsound | ||
pkgs.gspell | ||
pkgs.gst_all_1.gst-plugins-bad # GstWebRTC | ||
pkgs.gst_all_1.gst-plugins-base | ||
pkgs.gst_all_1.gstreamer | ||
pkgs.gtk3 | ||
pkgs.gtk4 | ||
pkgs.gtksourceview4 | ||
pkgs.gtksourceview5 | ||
pkgs.libadwaita | ||
pkgs.libappindicator-gtk3 | ||
pkgs.libayatana-appindicator | ||
pkgs.libgit2-glib | ||
pkgs.libhandy | ||
pkgs.libmanette | ||
pkgs.libpanel | ||
pkgs.librsvg | ||
pkgs.libsecret | ||
pkgs.libsoup | ||
pkgs.libsoup_3 | ||
pkgs.ostree | ||
pkgs.pango | ||
pkgs.vte | ||
pkgs.webkitgtk_6_0 | ||
]; | ||
|
||
env = { | ||
# Ensure the environment is not contaminated. | ||
XDG_DATA_DIRS = ""; | ||
GI_GIR_PATH = ""; | ||
GI_TYPELIB_PATH = ""; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit | ||
|
||
tools/generate.py Adw 1 > src/gi-stubs/repository/Adw.pyi | ||
tools/generate.py AppIndicator3 0.1 > src/gi-stubs/repository/AppIndicator3.pyi | ||
tools/generate.py AppStream 1.0 > src/gi-stubs/repository/AppStream.pyi | ||
tools/generate.py Atk 1.0 > src/gi-stubs/repository/Atk.pyi | ||
tools/generate.py AyatanaAppIndicator3 0.1 > src/gi-stubs/repository/AyatanaAppIndicator3.pyi | ||
tools/generate.py Farstream 0.2 > src/gi-stubs/repository/Farstream.pyi | ||
tools/generate.py Flatpak 1.0 > src/gi-stubs/repository/Flatpak.pyi | ||
tools/generate.py GIRepository 2.0 > src/gi-stubs/repository/GIRepository.pyi | ||
tools/generate.py GLib 2.0 > src/gi-stubs/repository/GLib.pyi | ||
tools/generate.py GModule 2.0 > src/gi-stubs/repository/GModule.pyi | ||
tools/generate.py GObject 2.0 > src/gi-stubs/repository/GObject.pyi | ||
tools/generate.py GSound 1.0 > src/gi-stubs/repository/GSound.pyi | ||
tools/generate.py GdkPixbuf 2.0 > src/gi-stubs/repository/GdkPixbuf.pyi | ||
tools/generate.py Geoclue 2.0 > src/gi-stubs/repository/Geoclue.pyi | ||
tools/generate.py Ggit 1.0 > src/gi-stubs/repository/Ggit.pyi | ||
tools/generate.py Gio 2.0 > src/gi-stubs/repository/Gio.pyi | ||
tools/generate.py Goa 1.0 > src/gi-stubs/repository/Goa.pyi | ||
tools/generate.py Graphene 1.0 > src/gi-stubs/repository/Graphene.pyi | ||
tools/generate.py Gsk 4.0 > src/gi-stubs/repository/Gsk.pyi | ||
tools/generate.py Gspell 1 > src/gi-stubs/repository/Gspell.pyi | ||
tools/generate.py Gst 1.0 > src/gi-stubs/repository/Gst.pyi | ||
tools/generate.py GstPbutils 1.0 > src/gi-stubs/repository/GstPbutils.pyi | ||
tools/generate.py GstSdp 1.0 > src/gi-stubs/repository/GstSdp.pyi | ||
tools/generate.py GstWebRTC 1.0 > src/gi-stubs/repository/GstWebRTC.pyi | ||
tools/generate.py Handy 1 > src/gi-stubs/repository/Handy.pyi | ||
tools/generate.py Manette 0.2 > src/gi-stubs/repository/Manette.pyi | ||
tools/generate.py OSTree 1.0 > src/gi-stubs/repository/OSTree.pyi | ||
tools/generate.py Panel 1 > src/gi-stubs/repository/Panel.pyi | ||
tools/generate.py Pango 1.0 > src/gi-stubs/repository/Pango.pyi | ||
tools/generate.py PangoCairo 1.0 > src/gi-stubs/repository/PangoCairo.pyi | ||
tools/generate.py Rsvg 2.0 > src/gi-stubs/repository/Rsvg.pyi | ||
tools/generate.py Secret 1 > src/gi-stubs/repository/Secret.pyi | ||
tools/generate.py Vte 2.91 > src/gi-stubs/repository/Vte.pyi | ||
tools/generate.py Gdk 3.0 > src/gi-stubs/repository/_Gdk3.pyi | ||
tools/generate.py Gdk 4.0 > src/gi-stubs/repository/_Gdk4.pyi | ||
tools/generate.py Gtk 3.0 > src/gi-stubs/repository/_Gtk3.pyi | ||
tools/generate.py Gtk 4.0 > src/gi-stubs/repository/_Gtk4.pyi | ||
tools/generate.py GtkSource 4.0 > src/gi-stubs/repository/_GtkSource4.pyi | ||
tools/generate.py GtkSource 5.0 > src/gi-stubs/repository/_GtkSource5.pyi | ||
tools/generate.py JavaScriptCore 6.0 > src/gi-stubs/repository/_JavaScriptCore6.pyi | ||
tools/generate.py Soup 2.0 > src/gi-stubs/repository/_Soup2.pyi | ||
tools/generate.py Soup 3.0 > src/gi-stubs/repository/_Soup3.pyi | ||
tools/generate.py WebKit 6.0 > src/gi-stubs/repository/_WebKit6.pyi |