|
1 | 1 | # 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