Skip to content

Commit

Permalink
chore(nix): move build files to build/ directory
Browse files Browse the repository at this point in the history
  • Loading branch information
zakuciael committed Apr 16, 2024
1 parent 6b97331 commit 768d066
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions default.nix → build/default.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{ stdenvNoCC, lib, theme }:
let
themes = builtins.map (theme: (builtins.head (lib.strings.splitString "." theme))) (builtins.attrNames (builtins.readDir ./assets/backgrounds));
themes = builtins.map (theme: (builtins.head (lib.strings.splitString "." theme))) (builtins.attrNames (builtins.readDir ./../assets/backgrounds));
in
assert builtins.any (x: x == theme) themes;

stdenvNoCC.mkDerivation {
name = "distro-grub-themes";
src = ./.;
src = ./../.;

installPhase = ''
mkdir -p $out
Expand Down
2 changes: 1 addition & 1 deletion module.nix → build/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
with lib;
let
cfg = config.distro-grub-themes;
themes = builtins.map (theme: (builtins.head (lib.strings.splitString "." theme))) (builtins.attrNames (builtins.readDir ./assets/backgrounds));
themes = builtins.map (theme: (builtins.head (lib.strings.splitString "." theme))) (builtins.attrNames (builtins.readDir ./../assets/backgrounds));
in
{
options.distro-grub-themes = {
Expand Down
6 changes: 3 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@
(theme:
let name = (builtins.head (pkgs.lib.strings.splitString "." theme)); in {
name = name + "-grub-theme";
value = pkgs.callPackage ./default.nix { theme = name; };
value = pkgs.callPackage ./build/default.nix { theme = name; };
})
themeNames);
in
{
packages = {
default = pkgs.callPackage ./default.nix { theme = "nixos"; };
default = pkgs.callPackage ./build/default.nix { theme = "nixos"; };
} // themePackages;

devShells.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [ nixd nixpkgs-fmt act jq ];
};

nixosModules.default = ./module.nix;
nixosModules.default = ./build/module.nix;
}
);
}
Expand Down

0 comments on commit 768d066

Please sign in to comment.