~misterio/IC

f13bb6accd7ab51f2b0bbd04d1d720a976732c77 — Gabriel Fontes 1 year, 8 months ago 667837d
reorganizar flake e adicionar texto em subdiretorio
9 files changed, 37 insertions(+), 34 deletions(-)

M .gitignore
M README.md
M flake.lock
M flake.nix
A project/.gitignore
R Makefile => project/Makefile
R default.nix => project/default.nix
R notes.md => project/notes.md
R project.md => project/project.md
M .gitignore => .gitignore +1 -1
@@ 1,1 1,1 @@
*.pdf
result

M README.md => README.md +4 -2
@@ 1,4 1,6 @@
# Textos da minha IC

Para compilar em pdf, basta `nix build`. Caso você não tenha o nix use `make`
(requer gnumake, pandoc, pdflatex).
Para compilar algum dos textos em pdf, basta `nix build .#nome`.

Caso você não tenha o nix, entre no diretório desejado e use `make` (requer
pandoc e pdflatex).

M flake.lock => flake.lock +5 -5
@@ 24,15 24,15 @@
    },
    "utils": {
      "locked": {
        "lastModified": 1650807908,
        "narHash": "sha256-40KmOhMe59bYgMQFKInt0bbm4auXb1tlh9Xow3qUm2g=",
        "owner": "misterio77",
        "lastModified": 1652776076,
        "narHash": "sha256-gzTw/v1vj4dOVbpBSJX4J0DwUR6LIyXo7/SuuTJp1kM=",
        "owner": "numtide",
        "repo": "flake-utils",
        "rev": "029918d4ef937909b5caf16fd95d26847cda875d",
        "rev": "04c1b180862888302ddfb2e3ad9eaa63afc60cf8",
        "type": "github"
      },
      "original": {
        "owner": "misterio77",
        "owner": "numtide",
        "repo": "flake-utils",
        "type": "github"
      }

M flake.nix => flake.nix +19 -16
@@ 1,24 1,27 @@
{
  description = "Scientific Initiation - NixOS computer lab";
  description = "Gabriel Fontes - Scientific Initiation";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    utils.url = "github:misterio77/flake-utils";
    utils.url = "github:numtide/flake-utils";
  };

  outputs = { self, nixpkgs, utils }: rec {
    overlays = rec {
      project = final: _: { project = final.callPackage ./. { inherit self; }; };
      default = project;
    };
  outputs = { self, nixpkgs, utils }: utils.lib.eachDefaultSystem (system:
    let
      inherit (builtins) attrValues;
      pkgs = import nixpkgs { inherit system; };
      version = self.shortRev or "dirty";
    in
    rec {
      packages = {
        # Projeto inicial
        project = pkgs.callPackage ./project { inherit version; };
      };

    packages = utils.lib.eachDefaultSystemMap (system:
      let
        pkgs = import nixpkgs { inherit system; overlays = [ overlays.default ]; };
      in
      rec {
        inherit (pkgs) project;
        default = project;
      });
  };
      devShells = {
        # Shell com inputs de todos os pacotes
        default = pkgs.mkShell { name = "ic-gabriel"; inputsFrom = attrValues packages; };
      };
    }
  );
}

A project/.gitignore => project/.gitignore +1 -0
@@ 0,0 1,1 @@
*.pdf

R Makefile => project/Makefile +0 -7
@@ 1,11 1,4 @@
PREFIX ?= /usr/share
INSTALL_DIR ?= $(PREFIX)/docs/misterio

PANDOC ?= pandoc

project.pdf: project.md
	$(PANDOC) -i $< -o $@

install: project.pdf
	install -d $(INSTALL_DIR)
	install -t $(INSTALL_DIR) $<

R default.nix => project/default.nix +7 -3
@@ 1,12 1,16 @@
{ stdenv, pandoc, texlive, self }:
{ stdenv, pandoc, texlive, version }:

stdenv.mkDerivation {
  pname = "ic-project";
  version = self.shortRev or "dirty";
  inherit version;

  src = ./.;

  buildInputs = [ pandoc texlive.combined.scheme-small ];
  makeFlags = [ "INSTALL_DIR=$(out)"];

  installPhase = ''
    install -d $out
    install -t $out project.pdf
  '';
}


R notes.md => project/notes.md +0 -0
R project.md => project/project.md +0 -0