Add nix flake and files from older repo.
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
{
|
||||
description = "A custom newtab page.";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
};
|
||||
|
||||
outputs =
|
||||
{ nixpkgs, ... }:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
|
||||
ruby = pkgs.ruby.withPackages (
|
||||
p: with p; [
|
||||
rackup
|
||||
puma
|
||||
sinatra
|
||||
]
|
||||
);
|
||||
|
||||
app = pkgs.stdenv.mkDerivation {
|
||||
pname = "newtab";
|
||||
version = "0.1.0";
|
||||
src = ./.;
|
||||
buildInputs = [ ruby ];
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp -r . $out/
|
||||
'';
|
||||
};
|
||||
|
||||
server = pkgs.writeShellApplication {
|
||||
name = "newtab";
|
||||
runtimeInputs = [ ruby ];
|
||||
text = ''
|
||||
set -euo pipefail
|
||||
exec ruby ${app}/main.rb
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
packages.${system}.default = app;
|
||||
|
||||
apps.${system}.default = {
|
||||
type = "app";
|
||||
program = "${server}/bin/newtab";
|
||||
};
|
||||
|
||||
devShells.${system}.default = pkgs.mkShell {
|
||||
packages = [
|
||||
ruby
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user