feat(nix-flake): add nix flake and nix module
This commit is contained in:
parent
21d580d1a6
commit
ddaf33b4f8
6 changed files with 226 additions and 0 deletions
24
nix/flake.nix
Normal file
24
nix/flake.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
description = "NixOS flake for discord-tweeter";
|
||||
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||
inputs.gomod2nix.url = "github:nix-community/gomod2nix";
|
||||
inputs.gomod2nix.inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.gomod2nix.inputs.flake-utils.follows = "flake-utils";
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils, gomod2nix }:
|
||||
(flake-utils.lib.eachDefaultSystem
|
||||
(system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
|
||||
callPackage = pkgs.darwin.apple_sdk_11_0.callPackage or pkgs.callPackage;
|
||||
in
|
||||
{
|
||||
nixosModules.default = callPackage ./services.nix { inherit self; };
|
||||
packages.default = callPackage ./. { inherit (gomod2nix.legacyPackages.${system}) buildGoApplication; };
|
||||
devShells.default = callPackage ./shell.nix { inherit (gomod2nix.legacyPackages.${system}) mkGoEnv gomod2nix; };
|
||||
})
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue