Merge pull request #222 from MasterEvarior/master

Added instructions on how to use the flake.nix
This commit is contained in:
Vince 2024-06-02 01:15:40 +08:00 committed by GitHub
commit 0628270f03
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -37,6 +37,54 @@ sudo ./install.sh -b -t tela
sudo ./install.sh -r -t tela sudo ./install.sh -r -t tela
``` ```
## Installation with NixOS:
To use this theme with NixOS you will have to enable [flakes](https://nixos.wiki/wiki/flakes). Before you do this, please inform yourself if you really want to, because flakes are still an unstable feature.
First you will have to add grub2 to your `flake.nix` file as a new input.
```nix
# flake.nix
{
description = "NixOS configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# Add grub2 themes to your inputs ...
grub2-themes = {
url = "github:vinceliuice/grub2-themes";
};
};
outputs = inputs@{ nixpkgs, grub2-themes, ... }: {
nixosConfigurations = {
my_host = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
# ... and then to your modules
modules = [
./configuration.nix
grub2-themes.nixosModules.default
];
};
};
};
}
```
After that, you can configure the theme as shown below. In this example it is inside the `configuration.nix` file but it can be any file you choose.
```nix
# configuration.nix
{ inputs, config, pkgs, lib, ... }:
{
boot.loader.grub = { ... };
boot.loader.grub2-theme = {
enable = true;
theme = "stylish";
footer = true;
};
}
```
## Issues / tweaks: ## Issues / tweaks:
### Correcting display resolution: ### Correcting display resolution: