Initial flake.nix
This commit is contained in:
57
flake.nix
Normal file
57
flake.nix
Normal file
@@ -0,0 +1,57 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs?ref=refs/tags/22.11";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = (import nixpkgs {
|
||||
inherit system;
|
||||
config = {
|
||||
packageOverrides = pkgs: rec {
|
||||
ruby = pkgs.ruby_3_1;
|
||||
bundler = pkgs.bundler.override {
|
||||
inherit ruby;
|
||||
};
|
||||
bundix = pkgs.bundix.override {
|
||||
inherit bundler;
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
in {
|
||||
devShells.${system} = {
|
||||
default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
ruby_3_1 postgresql git redis curl nginx openssl coreutils ffmpeg gcc exiftool glib pkg-config
|
||||
];
|
||||
shellHook = ''
|
||||
PS1="(deps) $PS1"
|
||||
'';
|
||||
};
|
||||
bundix = pkgs.mkShell {
|
||||
buildInputs = [ pkgs.bundix ];
|
||||
shellHook = ''
|
||||
PS1="(bundix) $PS1"
|
||||
'';
|
||||
};
|
||||
};
|
||||
packages.${system}.default =
|
||||
let
|
||||
gems = pkgs.bundlerEnv {
|
||||
name = "danbooru";
|
||||
rubt = pkgs.ruby;
|
||||
gemdir = ./.;
|
||||
};
|
||||
in pkgs.stdenv.mkDerivation {
|
||||
name = "danbooru";
|
||||
src = ./.;
|
||||
buildInputs = [ gems pkgs.ruby ];
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp -r $src $out
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user