Skip to content

Commit 3c68f1e

Browse files
committed
docs: add nix page
1 parent 125ed58 commit 3c68f1e

File tree

2 files changed

+110
-1
lines changed

2 files changed

+110
-1
lines changed

docs/ags/installation.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44

55
maintainer: [@Aylur](https://github.com/Aylur)
66

7-
Read more about it on the [nix page](../getting-started/nix.md)
7+
Read more about it on the [nix page](../getting-started/nix#ags)
8+
9+
You can try without installing.
10+
11+
<!--TODO: remove v2 after merge-->
12+
```sh
13+
nix run github:aylur/ags/v2 -- --help
14+
```
815

916
## Bulding AGS from source
1017

@@ -38,6 +45,7 @@ sudo zypper install go npm gjs
3845

3946
3. Clone the repo and Install
4047

48+
<!--TODO: remove v2 after merge-->
4149
```sh
4250
git clone https://github.com/aylur/ags.git
4351
cd ags

docs/getting-started/nix.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,102 @@
11
# Nix
2+
3+
## Astal
4+
5+
Using Astal on Nix will require you to package your project.
6+
7+
:::code-group
8+
9+
```nix [typescript.nix]
10+
# Not documented yet
11+
```
12+
13+
```nix [lua.nix]
14+
# Not documented yet
15+
```
16+
17+
```nix [python.nix]
18+
# Not documented yet
19+
```
20+
21+
```nix [vala.nix]
22+
# Not documented yet
23+
```
24+
25+
:::
26+
27+
## AGS
28+
29+
The recommended way to use AGS on NixOS is through the home-manager module.
30+
31+
Example content of a `flake.nix` file that contains your `homeConfigurations`.
32+
33+
<!--TODO: remove v2 after merge-->
34+
35+
:::code-group
36+
37+
```nix [flake.nix]
38+
{
39+
inputs = {
40+
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
41+
home-manager = {
42+
url = "github:nix-community/home-manager";
43+
inputs.nixpkgs.follows = "nixpkgs";
44+
};
45+
46+
# add ags https://github.com/Aylur/ags/pull/504
47+
ags.url = "github:aylur/ags/v2";
48+
};
49+
50+
outputs = { home-manager, nixpkgs, ... }@inputs:
51+
let
52+
system = "x86_64-linux";
53+
in
54+
{
55+
homeConfigurations."${username}" = home-manager.lib.homeManagerConfiguration {
56+
pkgs = import nixpkgs { inherit system; };
57+
58+
# pass inputs as specialArgs
59+
extraSpecialArgs = { inherit inputs; };
60+
61+
# import your home.nix
62+
modules = [ ./home-manager/home.nix ];
63+
};
64+
};
65+
}
66+
```
67+
68+
:::
69+
70+
Example content of `home.nix` file
71+
72+
:::code-group
73+
74+
```nix [home.nix]
75+
{ inputs, pkgs, ... }:
76+
{
77+
# add the home manager module
78+
imports = [ inputs.ags.homeManagerModules.default ];
79+
80+
programs.ags = {
81+
enable = true;
82+
configDir = ../ags;
83+
84+
# additional packages to add to gjs's runtime
85+
extraPackages = with pkgs; [
86+
inputs.ags.packages.${pkgs.system}.battery
87+
fzf
88+
];
89+
};
90+
}
91+
```
92+
93+
:::
94+
95+
AGS by default only includes the core `libastal` library.
96+
If you want to include any other [library](../libraries/references) you have to add them to `extraPackages`.
97+
You can also add binaries which will be added to `$PATH`.
98+
99+
:::warning
100+
The `configDir` option symlinks the given path to `~/.config/ags`.
101+
If you already have your source code there leave it as `null`.
102+
:::

0 commit comments

Comments
 (0)