summaryrefslogtreecommitdiff
path: root/pkgs
diff options
context:
space:
mode:
authorSimon Parri <simonparri@ganzeria.com>2025-06-16 15:29:57 -0500
committerSimon Parri <simonparri@ganzeria.com>2025-06-16 17:21:23 -0500
commitbd12cf94f99a786809056719c50d1431df28a00b (patch)
tree523c24cdb8d95a3dbdb0d31fcfad6c983e70daaa /pkgs
parentec6673aad60d45f8deab71a327e0fb3c08f098a9 (diff)
downloadnixos-config-bd12cf94f99a786809056719c50d1431df28a00b.tar.gz
nixos-config-bd12cf94f99a786809056719c50d1431df28a00b.zip
pkgs: Initialize and add oauth2token
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/all-packages.nix5
-rw-r--r--pkgs/flake.lock27
-rw-r--r--pkgs/flake.nix11
-rw-r--r--pkgs/oauth2token.nix29
-rwxr-xr-xpkgs/update-lock9
5 files changed, 81 insertions, 0 deletions
diff --git a/pkgs/all-packages.nix b/pkgs/all-packages.nix
new file mode 100644
index 0000000..d214742
--- /dev/null
+++ b/pkgs/all-packages.nix
@@ -0,0 +1,5 @@
+{ pkgs, ... }:
+
+{
+ oauth2token = pkgs.python3Packages.callPackage ./oauth2token.nix {};
+}
diff --git a/pkgs/flake.lock b/pkgs/flake.lock
new file mode 100644
index 0000000..345934f
--- /dev/null
+++ b/pkgs/flake.lock
@@ -0,0 +1,27 @@
+{
+ "nodes": {
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1750005367,
+ "narHash": "sha256-h/aac1dGLhS3qpaD2aZt25NdKY7b+JT0ZIP2WuGsJMU=",
+ "owner": "nixos",
+ "repo": "nixpkgs",
+ "rev": "6c64dabd3aa85e0c02ef1cdcb6e1213de64baee3",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nixos",
+ "ref": "nixos-25.05",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "nixpkgs": "nixpkgs"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/pkgs/flake.nix b/pkgs/flake.nix
new file mode 100644
index 0000000..72e562c
--- /dev/null
+++ b/pkgs/flake.nix
@@ -0,0 +1,11 @@
+{
+ inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
+ outputs = { nixpkgs, self }:
+ let eachSystem = f: nixpkgs.lib.genAttrs
+ nixpkgs.lib.systems.flakeExposed
+ (s: f nixpkgs.legacyPackages.${s});
+ in {
+ packages = eachSystem (pkgs:
+ import ./all-packages.nix { inherit pkgs; });
+ };
+}
diff --git a/pkgs/oauth2token.nix b/pkgs/oauth2token.nix
new file mode 100644
index 0000000..791de4f
--- /dev/null
+++ b/pkgs/oauth2token.nix
@@ -0,0 +1,29 @@
+{
+ lib,
+ buildPythonPackage,
+ fetchPypi,
+ pyxdg,
+ google-auth-oauthlib,
+}:
+
+buildPythonPackage rec {
+ pname = "oauth2token";
+ version = "0.0.3";
+
+ src = fetchPypi {
+ inherit pname version;
+ hash = "sha256-3wJHPYP74rTdqAfVKZ7LrzwP4tCeV+VRasoqs1uw/vg=";
+ };
+
+ propagatedBuildInputs = [
+ pyxdg
+ google-auth-oauthlib
+ ];
+
+ meta = with lib; {
+ description = "Simple cli tools to create and use oauth2token";
+ homepage = "https://github.com/VannTen/oauth2token";
+ license = licenses.gpl3;
+ maintainers = [];
+ };
+}
diff --git a/pkgs/update-lock b/pkgs/update-lock
new file mode 100755
index 0000000..8690241
--- /dev/null
+++ b/pkgs/update-lock
@@ -0,0 +1,9 @@
+#!/usr/bin/ruby
+require "json"
+
+dir = File.dirname $0
+lock = JSON.parse(File.read(File.expand_path "#{dir}/../flake.lock"))
+lock.merge!({"nodes" => lock["nodes"]
+ .filter {|k| ["nixpkgs", "root"].include? k }
+ .merge({"root" => {"inputs" => {"nixpkgs" => "nixpkgs"}}})})
+File.write "#{dir}/flake.lock", JSON.pretty_generate(lock)+"\n"