Skip to content

Commit

Permalink
nix flake: add overlay, conform to standards
Browse files Browse the repository at this point in the history
  • Loading branch information
kmein committed Dec 30, 2024
1 parent c625667 commit c697c60
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@
supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
in {
packages = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
package = pkgs.haskellPackages.callPackage ./default.nix {};
in {
default = package;
brockman = package;
overlays.default = self: super: {
go-shortener = self.haskellPackages.callPackage ./default.nix {};
};

packages = forAllSystems (system: {
default = (import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
}).go-shortener;
vm = nixos-generators.nixosGenerate {
inherit pkgs;
modules = [ self.nixosModule (import nix/vm.nix) ];
pkgs = nixpkgs.legacyPackages.${system};
modules = [ self.nixosModules.default (import nix/vm.nix) ];
format = "vm-nogui";
};
});
Expand Down Expand Up @@ -62,9 +63,9 @@
buildInputs = [ pkgs.cabal-install ];
}));

nixosModule = { config, lib, pkgs, ... }: import nix/module.nix {
package = pkgs.haskellPackages.callPackage ./default.nix {};
inherit config lib pkgs;
nixosModules.default = { ... }: {
imports = [nix/module.nix];
nixpkgs.overlays = [ self.overlays.default ];
};
};
}

0 comments on commit c697c60

Please sign in to comment.