change flake output
This commit is contained in:
parent
c2f3415bea
commit
d672867ffd
2 changed files with 3 additions and 9 deletions
|
|
@ -14,11 +14,11 @@
|
||||||
This is just one HTML file, grab the =index.html= and open it in your favourite browser or host it with whatever webserver you like.
|
This is just one HTML file, grab the =index.html= and open it in your favourite browser or host it with whatever webserver you like.
|
||||||
|
|
||||||
This web page is also available as [[https://nixos.wiki/wiki/Flakes][Nix Flake]].
|
This web page is also available as [[https://nixos.wiki/wiki/Flakes][Nix Flake]].
|
||||||
The =index.html= file is provided in =/var/www/socialize= of the flake output.
|
The =index.html= file is provided in the root of the flake package output.
|
||||||
To use it for example with Nginx, the flakes (here included as =socialize=) content can be accessed like this:
|
To use it for example with Nginx, the flakes (here included as =socialize=) content can be accessed like this:
|
||||||
|
|
||||||
#+begin_example nix
|
#+begin_example nix
|
||||||
services.nginx.virtualHosts."example.org".locations."/".root = "${socialize.packages."<your-arch>".socialize}/var/www/socialize";
|
services.nginx.virtualHosts."example.org".locations."/".root = "${socialize.packages."<your-arch>".socialize}";
|
||||||
#+end_example
|
#+end_example
|
||||||
|
|
||||||
*** Requirements
|
*** Requirements
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,22 @@
|
||||||
{
|
{
|
||||||
description = "socialize web page";
|
description = "socialize web page";
|
||||||
|
|
||||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils }:
|
outputs = { self, nixpkgs, flake-utils }:
|
||||||
|
|
||||||
flake-utils.lib.eachDefaultSystem
|
flake-utils.lib.eachDefaultSystem
|
||||||
(system:
|
(system:
|
||||||
let
|
let
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
# Package
|
|
||||||
packages.socialize =
|
packages.socialize =
|
||||||
pkgs.stdenv.mkDerivation {
|
pkgs.stdenv.mkDerivation {
|
||||||
name = "socialize";
|
name = "socialize";
|
||||||
src = self;
|
src = self;
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
install -m 444 -D index.html $out/var/www/socialize/index.html
|
install -m 444 -D index.html $out/index.html
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
defaultPackage = self.packages.${system}.socialize;
|
defaultPackage = self.packages.${system}.socialize;
|
||||||
}
|
}
|
||||||
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue