Closed StefanSchroeder closed 1 month 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;
};
}
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'
They assume you're already using flakes. If you aren't, you need to migrate your configuration first.
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!!!
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.