vinceliuice / grub2-themes

Modern Design theme for Grub2
GNU General Public License v3.0
3.29k stars 236 forks source link

Please provide instructions how to use the flake.nix #190

Closed StefanSchroeder closed 1 month ago

StefanSchroeder commented 1 year ago

I am using Nixos and would like to use the flake.nix to get the themes. But I have no experience with flakes. Could you please add a few notes to the README how to get use the themes with the flake, please?

Thanks in advance.

tmarkov commented 1 year ago
# flake.nix
{
  description = "NixOS configuration";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    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; };
        modules = [
          ./configuration.nix
          grub2-themes.nixosModules.default
        ];
      };
    };
  };
}
# configuration.nix
{ inputs, config, pkgs, lib, ... }:
{
  #...
  boot.loader.grub = { ... };
  boot.grub2-theme = {
    enable = true;
    theme = "stylish";
    footer = true;
  };
}
StefanSchroeder commented 1 year ago

These instructions produce:

warning: creating lock file '/etc/nixos/flake.lock'
error: flake 'path:/etc/nixos' does not provide attribute 'packages.x86_64-linux.nixosConfigurations."nixos".config.system.build.nixos-rebuild', 'legacyPackages.x86_64-linux.nixosConfigurations."nixos".config.system.build.nixos-rebuild' or 'nixosConfigurations."nixos".config.system.build.nixos-rebuild'
tmarkov commented 1 year ago

They assume you're already using flakes. If you aren't, you need to migrate your configuration first.

leon-erd commented 5 months ago

Small correction: it actually has to be boot.loader.grub2-theme in your configuration.nix ;) Could be nice to add this to the README I think.

PS: thanks a lot for your amazingly styled themes!!!