diff options
author | kotontrion <[email protected]> | 2024-05-21 13:08:51 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2024-05-21 13:08:51 +0200 |
commit | 33b3b60ee513ce2d313ce31c292afc114a110eb3 (patch) | |
tree | ce63b21d13c2fcdbb9c6f6fee5b583c15654315f | |
parent | 611f7ec8154869c4dc131feb6b082d3a890c369e (diff) | |
parent | 0a209680c532bab47e99e07bc090240bf851c218 (diff) |
Merge pull request #1 from astal-sh/nix-flake
add flake.nix
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | flake.lock | 27 | ||||
-rw-r--r-- | flake.nix | 42 | ||||
-rw-r--r-- | meson.build | 4 | ||||
-rw-r--r-- | version | 1 |
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/ @@ -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 +) @@ -0,0 +1 @@ +0.1.0 |