summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--README.md3
-rw-r--r--flake.lock27
-rw-r--r--flake.nix42
-rw-r--r--meson.build4
-rw-r--r--version1
6 files changed, 77 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..a2f80a3
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+build/
+result/
diff --git a/README.md b/README.md
index dff3ccc..da32bad 100644
--- a/README.md
+++ b/README.md
@@ -29,6 +29,9 @@ meson compile -C build
meson install -C build
```
+> [!NOTE]
+> on NixOS you will have to add `security.pam.services.astal-auth = {}` in `configuration.nix`
+
## Usage
This library can be used from any language supporting GObject Introspection.
Have a look at the [examples](examples) for how it can be used in C and gjs.
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..13f566b
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,27 @@
+{
+ "nodes": {
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1716137900,
+ "narHash": "sha256-sowPU+tLQv8GlqtVtsXioTKeaQvlMz/pefcdwg8MvfM=",
+ "owner": "nixos",
+ "repo": "nixpkgs",
+ "rev": "6c0b7a92c30122196a761b440ac0d46d3d9954f1",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nixos",
+ "ref": "nixos-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "nixpkgs": "nixpkgs"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..39b0289
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,42 @@
+{
+ description = "Authentication library and cli tool";
+
+ inputs.nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
+
+ outputs = { self, nixpkgs }:
+ let
+ version = builtins.replaceStrings ["\n"] [""] (builtins.readFile ./version);
+ system = "x86_64-linux";
+ pkgs = import nixpkgs { inherit system; };
+
+ nativeBuildInputs = with pkgs; [
+ gobject-introspection
+ meson
+ pkg-config
+ ninja
+ vala
+ ];
+
+ buildInputs = with pkgs; [
+ glib
+ pam
+ ];
+ in {
+ packages.${system} = rec {
+ default = auth;
+ auth = pkgs.stdenv.mkDerivation {
+ inherit nativeBuildInputs buildInputs;
+ pname = "astal-auth";
+ version = version;
+ src = ./.;
+ outputs = ["out" "dev"];
+ };
+ };
+
+ devShells.${system} = {
+ default = pkgs.mkShell {
+ inherit nativeBuildInputs buildInputs;
+ };
+ };
+ };
+}
diff --git a/meson.build b/meson.build
index cfca691..e9facb1 100644
--- a/meson.build
+++ b/meson.build
@@ -1,6 +1,6 @@
project('astal_auth',
'c',
- version : '0.1.0',
+ version : run_command('cat', join_paths(meson.project_source_root(), 'version')).stdout().strip(),
default_options : [
'c_std=gnu11',
'warning_level=3',
@@ -30,4 +30,4 @@ endif
install_data(
'pam/astal-auth',
install_dir : get_option('sysconfdir') / 'pam.d'
-) \ No newline at end of file
+)
diff --git a/version b/version
new file mode 100644
index 0000000..6e8bf73
--- /dev/null
+++ b/version
@@ -0,0 +1 @@
+0.1.0