forked from pub-solar/pub.solar
Use tritonshell instead of shell.nix
https://git.greenbaum.cloud/dev/tritonshell Also don't source triton profile when starting tritonshell by setting the TRITON_DONT_SOURCE_PROFILE env var
This commit is contained in:
parent
c95a684dd1
commit
1aa49d739e
6
.envrc
6
.envrc
|
@ -1,4 +1,4 @@
|
||||||
# reload when these files change
|
# reload when these files change
|
||||||
watch_file shell.nix
|
export TRITON_DONT_SOURCE_PROFILE=1
|
||||||
|
watch_file flake.nix
|
||||||
use nix
|
use_flake
|
||||||
|
|
95
flake.lock
Normal file
95
flake.lock
Normal file
|
@ -0,0 +1,95 @@
|
||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"devshell": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": [
|
||||||
|
"flake-utils"
|
||||||
|
],
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1663445644,
|
||||||
|
"narHash": "sha256-+xVlcK60x7VY1vRJbNUEAHi17ZuoQxAIH4S4iUFUGBA=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "devshell",
|
||||||
|
"rev": "e3dc3e21594fe07bdb24bdf1c8657acaa4cb8f66",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "devshell",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-utils": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1659877975,
|
||||||
|
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1665449268,
|
||||||
|
"narHash": "sha256-cw4xrQIAZUyJGj58Dp5VLICI0rscd+uap83afiFzlcA=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "285e77efe87df64105ec14b204de6636fb0a7a27",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"devshell": "devshell",
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
|
"nixpkgs": "nixpkgs",
|
||||||
|
"tritonshell-module": "tritonshell-module"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tritonshell-module": {
|
||||||
|
"inputs": {
|
||||||
|
"devshell": [
|
||||||
|
"devshell"
|
||||||
|
],
|
||||||
|
"flake-utils": [
|
||||||
|
"flake-utils"
|
||||||
|
],
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1665580466,
|
||||||
|
"narHash": "sha256-q8kVIE3XaOSCVl7oqkaKs2LDEbBcZRIzlnSG8PIKRQ0=",
|
||||||
|
"ref": "main",
|
||||||
|
"rev": "70d759b6d8b5e076bee6a28255614ab3d75f6763",
|
||||||
|
"revCount": 49,
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.greenbaum.cloud/dev/tritonshell"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"ref": "main",
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.greenbaum.cloud/dev/tritonshell"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
60
flake.nix
Normal file
60
flake.nix
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
{
|
||||||
|
description = "devs & ops environment for nix'ing with triton";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
|
||||||
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
|
||||||
|
devshell.url = "github:numtide/devshell";
|
||||||
|
devshell.inputs.flake-utils.follows = "flake-utils";
|
||||||
|
devshell.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
|
tritonshell-module.url = "git+https://git.greenbaum.cloud/dev/tritonshell?ref=main";
|
||||||
|
tritonshell-module.inputs.devshell.follows = "devshell";
|
||||||
|
tritonshell-module.inputs.flake-utils.follows = "flake-utils";
|
||||||
|
tritonshell-module.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, flake-utils, devshell, tritonshell-module, nixpkgs }:
|
||||||
|
flake-utils.lib.simpleFlake {
|
||||||
|
inherit self nixpkgs;
|
||||||
|
name = "infra-project";
|
||||||
|
preOverlays = [ devshell.overlay ];
|
||||||
|
shell = { pkgs }:
|
||||||
|
let
|
||||||
|
google-font-downloader = pkgs.writeShellScriptBin "google-font-downloader" ''
|
||||||
|
echo "Attempting to fetch $1"
|
||||||
|
${pkgs.nodejs}/bin/npx google-font-downloader -- $1
|
||||||
|
rm ./_includes/styles/typography.css
|
||||||
|
echo "/* To regenerate this file, run $ google-font-downloader '$1' */" >> ./_includes/styles/typography.css
|
||||||
|
echo "" >> ./_includes/styles/typography.css
|
||||||
|
cat ./google-fonts-*.css >> ./_includes/styles/typography.css
|
||||||
|
rm ./google-fonts-*.css
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
pkgs.devshell.mkShell {
|
||||||
|
imports = [ tritonshell-module.devshellModules.x86_64-linux.tritonshell ];
|
||||||
|
# Now the tritonshell environment nix module options are available
|
||||||
|
environment = {
|
||||||
|
enable = true;
|
||||||
|
# CUSTOMIZE if desired, default options are:
|
||||||
|
#cnsBaseDomain = "greenbaum.zone";
|
||||||
|
#dataCenters = [ "cgn-1" "lev-1" ];
|
||||||
|
#mantaDomain = "eu-central.manta.greenbaum.cloud";
|
||||||
|
#tritonApiDomain = "api.greenbaum.cloud";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Add additional packages you'd like to be available in your devshell
|
||||||
|
# PATH here
|
||||||
|
devshell.packages = with pkgs; [
|
||||||
|
deno
|
||||||
|
google-font-downloader
|
||||||
|
];
|
||||||
|
bash.extra = ''
|
||||||
|
export NVIM_USE_DENOLS=1
|
||||||
|
deno run -Ar https://deno.land/x/lume@v1.12.1/init.ts
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
22
shell.nix
22
shell.nix
|
@ -1,22 +0,0 @@
|
||||||
with (import (fetchTarball https://github.com/nixos/nixpkgs/archive/nixpkgs-unstable.tar.gz) {});
|
|
||||||
let
|
|
||||||
google-font-downloader = writeShellScriptBin "google-font-downloader" ''
|
|
||||||
echo "Attempting to fetch $1"
|
|
||||||
${nodejs}/bin/npx google-font-downloader -- $1
|
|
||||||
rm ./_includes/styles/typography.css
|
|
||||||
echo "/* To regenerate this file, run $ google-font-downloader '$1' */" >> ./_includes/styles/typography.css
|
|
||||||
echo "" >> ./_includes/styles/typography.css
|
|
||||||
cat ./google-fonts-*.css >> ./_includes/styles/typography.css
|
|
||||||
rm ./google-fonts-*.css
|
|
||||||
'';
|
|
||||||
in
|
|
||||||
mkShell {
|
|
||||||
buildInputs = [
|
|
||||||
deno
|
|
||||||
google-font-downloader
|
|
||||||
];
|
|
||||||
|
|
||||||
shellHook = ''
|
|
||||||
deno run -A https://deno.land/x/lume@v1.12.0/install.ts
|
|
||||||
'';
|
|
||||||
}
|
|
Loading…
Reference in a new issue