Skip to content

Commit

Permalink
chore: cleanup nix flake
Browse files Browse the repository at this point in the history
  • Loading branch information
tulilirockz committed May 13, 2024
1 parent e791271 commit def8a94
Showing 1 changed file with 10 additions and 22 deletions.
32 changes: 10 additions & 22 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,28 +1,17 @@
# This flake was initially generated by fh, the CLI for FlakeHub (version 0.1.9)
{
description = "Project Template";
description = "Atomic Studio CLI";

inputs = {
flake-schemas.url = "https://flakehub.com/f/DeterminateSystems/flake-schemas/*.tar.gz";
utility-flake.url = "https://flakehub.com/f/atomic-studio-org/Utility-Flake-Library/*.tar.gz";
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/*.tar.gz";
};
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";

outputs = { self, flake-schemas, nixpkgs, utility-flake }:
outputs = { self, nixpkgs }:
let
supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit system; };
});
in
{
schemas = flake-schemas.schemas;

formatter = forEachSupportedSystem ({ pkgs }: pkgs.nixpkgs-fmt);

checks = forEachSupportedSystem ({ pkgs }: {
inherit (utility-flake.checks.${pkgs.system}) pre-commit-check;
});
formatter = forEachSupportedSystem ({ pkgs }: pkgs.nixfmt-rfc-style);

packages = forEachSupportedSystem ({ pkgs }: rec {
default = studio;
Expand All @@ -34,18 +23,17 @@
buildInputs = with pkgs; [ podman distrobox ];

buildCommand = ''
mkdir -p $out/bin $out/libexec
cp $src/src/${pname} $out/bin
substituteInPlace $out/bin/${pname} --replace './libexec' "$out/libexec"
cp -r $src/src/libexec/* $out/libexec
'';
mkdir -p $out/bin $out/libexec
cp $src/src/${pname} $out/bin
substituteInPlace $out/bin/${pname} --replace './libexec' "$out/libexec"
cp -r $src/src/libexec/* $out/libexec
'';
};
inherit (utility-flake.packages.${pkgs.system}) cosign-generate;
});

devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
packages = utility-flake.lib.${pkgs.system}.devShellPackages ++ (with pkgs; [ earthly go-task melange apko ]);
packages = with pkgs; [ earthly go-task melange apko rpm ];
};
});
};
Expand Down

0 comments on commit def8a94

Please sign in to comment.