Skip to content

Commit

Permalink
switch devenv -> devshells
Browse files Browse the repository at this point in the history
  • Loading branch information
Lehmanator committed Jan 31, 2024
1 parent c73194b commit 8772ea1
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
use flake . --impure
use flake .
105 changes: 62 additions & 43 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
} @ inputs:
flake-parts.lib.mkFlake {inherit inputs;} {
imports = [
inputs.devenv.flakeModule
#inputs.devshell.flakeModule
#inputs.devenv.flakeModule
inputs.devshell.flakeModule
inputs.flake-parts.flakeModules.easyOverlay
inputs.hercules-ci-effects.flakeModule
#inputs.pre-commit-hooks-nix.flakeModule
Expand Down Expand Up @@ -54,46 +54,62 @@
pkgs,
...
}: {
devenv.shells.default = {
name = "resume.nix";
#certificates = ["resume.samlehman.dev"];
#devcontainer = { enable= true; settings= {}; };
difftastic.enable = true;
enterShell = ''
echo "Welcome to resume.nix!"
'';
env = {};
#hosts = {"resume.samlehman.dev" = "127.0.0.1";};
languages = {
javascript.enable = true;
nix.enable = true;
#texlive = {enable=true; packages=["collection-basic"]; base=pkgs.texlive;};
};
packages = with config.packages; [
pkgs.nix-direnv
pkgs.resumed
pkgs.puppeteer-cli
default
jsonresume-theme-elegant
jsonresume-theme-full
jsonresume-theme-fullmoon
jsonresume-theme-kendall
jsonresume-theme-macchiato
jsonresume-theme-stackoverflow
#config.treefmt.build.wrapper
#config.treefmt.build.programs
#devenv.shells.default = {
# name = "resume.nix";
# #certificates = ["resume.samlehman.dev"];
# #devcontainer = { enable= true; settings= {}; };
# difftastic.enable = true;
# enterShell = ''
# echo "Welcome to resume.nix!"
# '';
# env = {};
# #hosts = {"resume.samlehman.dev" = "127.0.0.1";};
# languages = {
# javascript.enable = true;
# nix.enable = true;
# #texlive = {enable=true; packages=["collection-basic"]; base=pkgs.texlive;};
# };
# packages = with config.packages; [
# pkgs.nix-direnv
# pkgs.resumed
# pkgs.puppeteer-cli
# default
# jsonresume-theme-elegant
# jsonresume-theme-full
# jsonresume-theme-fullmoon
# jsonresume-theme-kendall
# jsonresume-theme-macchiato
# jsonresume-theme-stackoverflow
# #config.treefmt.build.wrapper
# #config.treefmt.build.programs
# ];
# #pre-commit = {}; #https://github.com/cachix/pre-commit-hooks.nix
# #process = {
# # after = "";
# # before = "";
# # implementation = "honcho"; # honcho|overmind|process-compose|hivemind
# # process-compose = {port=9999; tui=true; version="0.5"; };
# #};
# starship = {
# enable = true;
# #config = {enable = true; path = "${config.env.DEVENV_ROOT}/starship.toml";};
# };
#};
devshells.default = {
commands = [
{
name = "build-default";
command = "nix build";
}
{
name = "build-html";
command = "nix build .#jsonresume-html";
}
{
name = "build-pdf";
command = "nix build .#jsonresume-pdf";
}
];
#pre-commit = {}; #https://github.com/cachix/pre-commit-hooks.nix
#process = {
# after = "";
# before = "";
# implementation = "honcho"; # honcho|overmind|process-compose|hivemind
# process-compose = {port=9999; tui=true; version="0.5"; };
#};
starship = {
enable = true;
#config = {enable = true; path = "${config.env.DEVENV_ROOT}/starship.toml";};
};
};
hercules-ci.github-pages = {
settings = {contents = config.packages.default;};
Expand All @@ -117,6 +133,7 @@
};
packages = let
version = "0.1.0";
defaultTheme = "fullmoon";
builder = theme: let
htmlPkgName = "jsonresume-html-${theme}";
htmlPkg = config.packages.${htmlPkgName};
Expand Down Expand Up @@ -163,8 +180,8 @@
resume = pkgs.symlinkJoin {
name = "resume";
paths = [
config.packages.jsonresume-html-fullmoon
config.packages.jsonresume-pdf-fullmoon
config.packages.jsonresume-html
config.packages.jsonresume-pdf
];
};

Expand All @@ -186,13 +203,15 @@
};

# TODO: Genericize
jsonresume-html = config.packages."jsonresume-html-${defaultTheme}";
jsonresume-html-full = (builder "full").html;
jsonresume-html-fullmoon = (builder "fullmoon").html;
jsonresume-html-elegant = (builder "elegant").html;
jsonresume-html-kendall = (builder "kendall").html;
jsonresume-html-macchiato = (builder "macchiato").html;
jsonresume-html-stackoverflow = (builder "stackoverflow").html;

jsonresume-pdf = config.packages."jsonresume-pdf-${defaultTheme}";
jsonresume-pdf-full = (builder "full").pdf;
jsonresume-pdf-fullmoon = (builder "fullmoon").pdf;
jsonresume-pdf-elegant = (builder "elegant").pdf;
Expand Down

0 comments on commit 8772ea1

Please sign in to comment.