mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-08-09 05:14:41 -05:00
Compare commits
No commits in common. "27781d3d0fdb56be7b26d62b78bb585250e43da3" and "6f24d2a2add54544aba2eb6e57ae713662fe6561" have entirely different histories.
27781d3d0f
...
6f24d2a2ad
42 changed files with 1 additions and 2478 deletions
|
@ -158,10 +158,6 @@
|
||||||
path = ./templates/elm;
|
path = ./templates/elm;
|
||||||
description = "Elm Environment";
|
description = "Elm Environment";
|
||||||
};
|
};
|
||||||
website = {
|
|
||||||
path = ./templates/website;
|
|
||||||
description = "Elm/Haskell Environment";
|
|
||||||
};
|
|
||||||
haskell = {
|
haskell = {
|
||||||
path = ./templates/haskell;
|
path = ./templates/haskell;
|
||||||
description = "Haskell Environment";
|
description = "Haskell Environment";
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
{ instancesFunctions }:
|
|
||||||
let
|
|
||||||
inherit (instancesFunctions)
|
|
||||||
domain0
|
|
||||||
servicePath
|
|
||||||
sslPath
|
|
||||||
sopsPath
|
|
||||||
;
|
|
||||||
|
|
||||||
label = "Kanboard";
|
|
||||||
name = "kanboard";
|
|
||||||
subdomain = "todo";
|
|
||||||
domain = "${subdomain}.${domain0}";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
label = label;
|
|
||||||
name = name;
|
|
||||||
email = {
|
|
||||||
address0 = "noreply@${name}.${domain0}";
|
|
||||||
};
|
|
||||||
sops = {
|
|
||||||
path0 = "${sopsPath}/${name}";
|
|
||||||
};
|
|
||||||
domains = {
|
|
||||||
url0 = domain;
|
|
||||||
};
|
|
||||||
subdomain = subdomain;
|
|
||||||
paths = {
|
|
||||||
path0 = "${servicePath}/${label}";
|
|
||||||
};
|
|
||||||
ports = {
|
|
||||||
port0 = 3128;
|
|
||||||
};
|
|
||||||
ssl = {
|
|
||||||
cert = "${sslPath}/${subdomain}.${domain0}/fullchain.pem";
|
|
||||||
key = "${sslPath}/${subdomain}.${domain0}/key.pem";
|
|
||||||
};
|
|
||||||
}
|
|
0
modules/config/instances/config/podgrab.nix
Executable file → Normal file
0
modules/config/instances/config/podgrab.nix
Executable file → Normal file
|
@ -162,7 +162,6 @@ in
|
||||||
ghostty
|
ghostty
|
||||||
prismLauncher
|
prismLauncher
|
||||||
steam
|
steam
|
||||||
airshipper
|
|
||||||
zed
|
zed
|
||||||
vsCode
|
vsCode
|
||||||
feishin
|
feishin
|
||||||
|
|
|
@ -9,6 +9,5 @@ builtins.attrValues {
|
||||||
;
|
;
|
||||||
inherit (pkgs.elmPackages)
|
inherit (pkgs.elmPackages)
|
||||||
elm-language-server
|
elm-language-server
|
||||||
elm-review
|
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
{
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
home.packages = builtins.attrValues {
|
|
||||||
inherit (pkgs)
|
|
||||||
airshipper
|
|
||||||
;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -82,6 +82,7 @@ in
|
||||||
logrotate
|
logrotate
|
||||||
mastodon
|
mastodon
|
||||||
minecraft
|
minecraft
|
||||||
|
podgrab
|
||||||
ollama
|
ollama
|
||||||
website
|
website
|
||||||
postgresql
|
postgresql
|
||||||
|
@ -90,7 +91,6 @@ in
|
||||||
vaultwarden
|
vaultwarden
|
||||||
forgejo
|
forgejo
|
||||||
xserver
|
xserver
|
||||||
# podgrab
|
|
||||||
# kanboard
|
# kanboard
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,7 +9,6 @@ let
|
||||||
(podcastHelper "https://sigmanutrition.libsyn.com/rss/" "Sigma Nutrition Radio")
|
(podcastHelper "https://sigmanutrition.libsyn.com/rss/" "Sigma Nutrition Radio")
|
||||||
(podcastHelper "https://wakingup.libsyn.com/rss" "Making Sense with Sam Harris")
|
(podcastHelper "https://wakingup.libsyn.com/rss" "Making Sense with Sam Harris")
|
||||||
(podcastHelper "https://feeds.simplecast.com/uNKL_XD_" "Docs Who Lift")
|
(podcastHelper "https://feeds.simplecast.com/uNKL_XD_" "Docs Who Lift")
|
||||||
(podcastHelper "https://feeds.redcircle.com/677da6c9-d33f-49df-95d7-dc8821b797b4" "Mayo Clinic on Nutrition")
|
|
||||||
];
|
];
|
||||||
podcastEntries = builtins.map (podcast: podcast) podcastData;
|
podcastEntries = builtins.map (podcast: podcast) podcastData;
|
||||||
in
|
in
|
||||||
|
|
0
modules/nixos/services/podgrab/default.nix
Executable file → Normal file
0
modules/nixos/services/podgrab/default.nix
Executable file → Normal file
|
@ -1 +0,0 @@
|
||||||
use flake
|
|
1
templates/website/.gitignore
vendored
1
templates/website/.gitignore
vendored
|
@ -1 +0,0 @@
|
||||||
.direnv
|
|
1
templates/website/backend/.gitignore
vendored
1
templates/website/backend/.gitignore
vendored
|
@ -1 +0,0 @@
|
||||||
/dist-newstyle
|
|
|
@ -1,12 +0,0 @@
|
||||||
cabal-version: 3.0
|
|
||||||
name: backend
|
|
||||||
version: 0.1.0.0
|
|
||||||
|
|
||||||
executable main
|
|
||||||
main-is: Main.hs
|
|
||||||
build-depends:
|
|
||||||
, base
|
|
||||||
, scotty
|
|
||||||
, wai-cors
|
|
||||||
default-language: Haskell2010
|
|
||||||
hs-source-dirs: src
|
|
|
@ -1,4 +0,0 @@
|
||||||
module Main where
|
|
||||||
|
|
||||||
main :: IO ()
|
|
||||||
main = putStrLn "Hello, World!"
|
|
147
templates/website/flake.lock
generated
147
templates/website/flake.lock
generated
|
@ -1,147 +0,0 @@
|
||||||
{
|
|
||||||
"nodes": {
|
|
||||||
"flake-compat": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1696426674,
|
|
||||||
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-parts": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs-lib": "nixpkgs-lib"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1730504689,
|
|
||||||
"narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=",
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "flake-parts",
|
|
||||||
"rev": "506278e768c2a08bec68eb62932193e341f55c90",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"id": "flake-parts",
|
|
||||||
"type": "indirect"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"gitignore": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"pre-commit-hooks-nix",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1709087332,
|
|
||||||
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "gitignore.nix",
|
|
||||||
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "gitignore.nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"haskell-flake": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1749105244,
|
|
||||||
"narHash": "sha256-gV/B1PWOwpLjy2OCHMS/fJ8GItMRoflW/g3kXB8/skg=",
|
|
||||||
"owner": "srid",
|
|
||||||
"repo": "haskell-flake",
|
|
||||||
"rev": "af2ba40f23824556b12d1cdfdf392e263876d644",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "srid",
|
|
||||||
"repo": "haskell-flake",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1750386251,
|
|
||||||
"narHash": "sha256-1ovgdmuDYVo5OUC5NzdF+V4zx2uT8RtsgZahxidBTyw=",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "076e8c6678d8c54204abcb4b1b14c366835a58bb",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"ref": "nixpkgs-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs-lib": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1730504152,
|
|
||||||
"narHash": "sha256-lXvH/vOfb4aGYyvFmZK/HlsNsr/0CVWlwYvo2rxJk3s=",
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/NixOS/nixpkgs/archive/cc2f28000298e1269cea6612cd06ec9979dd5d7f.tar.gz"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/NixOS/nixpkgs/archive/cc2f28000298e1269cea6612cd06ec9979dd5d7f.tar.gz"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs_2": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1730768919,
|
|
||||||
"narHash": "sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE=",
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "a04d33c0c3f1a59a2c1cb0c6e34cd24500e5a1dc",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NixOS",
|
|
||||||
"ref": "nixpkgs-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"pre-commit-hooks-nix": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-compat": "flake-compat",
|
|
||||||
"gitignore": "gitignore",
|
|
||||||
"nixpkgs": "nixpkgs_2"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1749636823,
|
|
||||||
"narHash": "sha256-WUaIlOlPLyPgz9be7fqWJA5iG6rHcGRtLERSCfUDne4=",
|
|
||||||
"owner": "cachix",
|
|
||||||
"repo": "pre-commit-hooks.nix",
|
|
||||||
"rev": "623c56286de5a3193aa38891a6991b28f9bab056",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "cachix",
|
|
||||||
"repo": "pre-commit-hooks.nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-parts": "flake-parts",
|
|
||||||
"haskell-flake": "haskell-flake",
|
|
||||||
"nixpkgs": "nixpkgs",
|
|
||||||
"pre-commit-hooks-nix": "pre-commit-hooks-nix"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": "root",
|
|
||||||
"version": 7
|
|
||||||
}
|
|
|
@ -1,22 +0,0 @@
|
||||||
{
|
|
||||||
inputs = {
|
|
||||||
haskell-flake.url = "github:srid/haskell-flake";
|
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
|
||||||
pre-commit-hooks-nix.url = "github:cachix/pre-commit-hooks.nix";
|
|
||||||
};
|
|
||||||
outputs =
|
|
||||||
inputs@{
|
|
||||||
self,
|
|
||||||
nixpkgs,
|
|
||||||
flake-parts,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
|
||||||
imports = [
|
|
||||||
inputs.haskell-flake.flakeModule
|
|
||||||
inputs.pre-commit-hooks-nix.flakeModule
|
|
||||||
./parts
|
|
||||||
];
|
|
||||||
systems = nixpkgs.lib.systems.flakeExposed;
|
|
||||||
};
|
|
||||||
}
|
|
7
templates/website/frontend/.gitignore
vendored
7
templates/website/frontend/.gitignore
vendored
|
@ -1,7 +0,0 @@
|
||||||
/dist
|
|
||||||
/.elm-land
|
|
||||||
/.env
|
|
||||||
/elm-stuff
|
|
||||||
/node_modules
|
|
||||||
.DS_Store
|
|
||||||
*.pem
|
|
|
@ -1,16 +0,0 @@
|
||||||
# frontend
|
|
||||||
> Built with [Elm Land](https://elm.land) 🌈
|
|
||||||
|
|
||||||
## Local development
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Requires Node.js v18+ (https://nodejs.org)
|
|
||||||
npx elm-land server
|
|
||||||
```
|
|
||||||
|
|
||||||
## Deploying to production
|
|
||||||
|
|
||||||
Elm Land projects are most commonly deployed as static websites.
|
|
||||||
|
|
||||||
Please visit [the "Deployment" guide](https://elm.land/guide/deploying) to learn more
|
|
||||||
about deploying your app for free using Netlify or Vercel.
|
|
|
@ -1,26 +0,0 @@
|
||||||
{
|
|
||||||
"app": {
|
|
||||||
"elm": {
|
|
||||||
"development": { "debugger": true },
|
|
||||||
"production": { "debugger": false }
|
|
||||||
},
|
|
||||||
"env": [],
|
|
||||||
"html": {
|
|
||||||
"attributes": {
|
|
||||||
"html": { "lang": "en" },
|
|
||||||
"head": {}
|
|
||||||
},
|
|
||||||
"title": "Elm Land",
|
|
||||||
"meta": [
|
|
||||||
{ "charset": "UTF-8" },
|
|
||||||
{ "http-equiv": "X-UA-Compatible", "content": "IE=edge" },
|
|
||||||
{ "name": "viewport", "content": "width=device-width, initial-scale=1.0" }
|
|
||||||
],
|
|
||||||
"link": [],
|
|
||||||
"script": []
|
|
||||||
},
|
|
||||||
"router": {
|
|
||||||
"useHashRouting": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,56 +0,0 @@
|
||||||
{
|
|
||||||
"type": "application",
|
|
||||||
"source-directories": [
|
|
||||||
"src",
|
|
||||||
".elm-land/src"
|
|
||||||
],
|
|
||||||
"elm-version": "0.19.1",
|
|
||||||
"dependencies": {
|
|
||||||
"direct": {
|
|
||||||
"dillonkearns/elm-markdown": "7.0.1",
|
|
||||||
"elm/browser": "1.0.2",
|
|
||||||
"elm/core": "1.0.5",
|
|
||||||
"elm/html": "1.0.0",
|
|
||||||
"elm/http": "2.0.0",
|
|
||||||
"elm/json": "1.1.3",
|
|
||||||
"elm/svg": "1.0.1",
|
|
||||||
"elm/url": "1.0.0",
|
|
||||||
"elm-community/list-extra": "8.7.0",
|
|
||||||
"elm-community/maybe-extra": "5.3.0",
|
|
||||||
"gampleman/elm-visualization": "2.4.2",
|
|
||||||
"hecrj/html-parser": "2.4.0",
|
|
||||||
"mdgriffith/elm-ui": "1.1.8"
|
|
||||||
},
|
|
||||||
"indirect": {
|
|
||||||
"avh4/elm-color": "1.0.0",
|
|
||||||
"elm/bytes": "1.0.8",
|
|
||||||
"elm/file": "1.0.5",
|
|
||||||
"elm/parser": "1.1.0",
|
|
||||||
"elm/random": "1.0.0",
|
|
||||||
"elm/regex": "1.0.0",
|
|
||||||
"elm/time": "1.0.0",
|
|
||||||
"elm/virtual-dom": "1.0.3",
|
|
||||||
"elmcraft/core-extra": "2.2.0",
|
|
||||||
"folkertdev/elm-deque": "3.0.1",
|
|
||||||
"folkertdev/one-true-path-experiment": "6.0.1",
|
|
||||||
"folkertdev/svg-path-lowlevel": "4.0.1",
|
|
||||||
"gampleman/elm-rosetree": "1.1.0",
|
|
||||||
"ianmackenzie/elm-1d-parameter": "1.0.1",
|
|
||||||
"ianmackenzie/elm-float-extra": "1.1.0",
|
|
||||||
"ianmackenzie/elm-geometry": "3.11.0",
|
|
||||||
"ianmackenzie/elm-interval": "3.1.0",
|
|
||||||
"ianmackenzie/elm-triangular-mesh": "1.1.0",
|
|
||||||
"ianmackenzie/elm-units": "2.10.0",
|
|
||||||
"ianmackenzie/elm-units-interval": "3.2.0",
|
|
||||||
"ianmackenzie/elm-units-prefixed": "2.8.0",
|
|
||||||
"justinmimbs/date": "4.1.0",
|
|
||||||
"justinmimbs/time-extra": "1.2.0",
|
|
||||||
"rtfeldman/elm-hex": "1.0.0",
|
|
||||||
"ryan-haskell/date-format": "1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"test-dependencies": {
|
|
||||||
"direct": {},
|
|
||||||
"indirect": {}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,94 +0,0 @@
|
||||||
module Config.Helpers.Response exposing
|
|
||||||
( contentContainer
|
|
||||||
, pageList
|
|
||||||
, pageListCenter
|
|
||||||
, pageListFormat
|
|
||||||
, topLevelContainer
|
|
||||||
)
|
|
||||||
|
|
||||||
import Config.Style.Colour.Helpers exposing (colourTheme)
|
|
||||||
import Element as E
|
|
||||||
exposing
|
|
||||||
( Attribute
|
|
||||||
, Device
|
|
||||||
, DeviceClass(..)
|
|
||||||
, Element
|
|
||||||
, Orientation(..)
|
|
||||||
, alignTop
|
|
||||||
, centerX
|
|
||||||
, centerY
|
|
||||||
, el
|
|
||||||
, fill
|
|
||||||
, height
|
|
||||||
, maximum
|
|
||||||
, minimum
|
|
||||||
, padding
|
|
||||||
, paddingXY
|
|
||||||
, scrollbarY
|
|
||||||
, spacing
|
|
||||||
, width
|
|
||||||
)
|
|
||||||
import Element.Background as B exposing (color)
|
|
||||||
import Html.Attributes exposing (style)
|
|
||||||
|
|
||||||
|
|
||||||
topLevelContainer : Element msg -> Element msg
|
|
||||||
topLevelContainer =
|
|
||||||
el
|
|
||||||
[ width fill
|
|
||||||
, height fill
|
|
||||||
, B.color colourTheme.backgroundLightGrey
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
pageListCenter : Device -> List (Attribute msg)
|
|
||||||
pageListCenter device =
|
|
||||||
[ centerY
|
|
||||||
]
|
|
||||||
++ pageListFormat device
|
|
||||||
|
|
||||||
|
|
||||||
pageList : Device -> List (Attribute msg)
|
|
||||||
pageList device =
|
|
||||||
[ alignTop
|
|
||||||
]
|
|
||||||
++ pageListFormat device
|
|
||||||
|
|
||||||
|
|
||||||
pageListFormat : Device -> List (Attribute msg)
|
|
||||||
pageListFormat device =
|
|
||||||
let
|
|
||||||
pageListAttr =
|
|
||||||
[ centerX
|
|
||||||
, width fill
|
|
||||||
, height fill
|
|
||||||
, scrollbarY
|
|
||||||
]
|
|
||||||
in
|
|
||||||
pageListAttr
|
|
||||||
++ (case ( device.class, device.orientation ) of
|
|
||||||
( Phone, Portrait ) ->
|
|
||||||
[ spacing 0
|
|
||||||
, paddingXY 10 30
|
|
||||||
]
|
|
||||||
|
|
||||||
( Tablet, Portrait ) ->
|
|
||||||
[ spacing 0
|
|
||||||
, paddingXY 10 30
|
|
||||||
]
|
|
||||||
|
|
||||||
_ ->
|
|
||||||
[ spacing 20
|
|
||||||
, paddingXY 30 30
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
contentContainer : Element msg -> Element msg
|
|
||||||
contentContainer =
|
|
||||||
el
|
|
||||||
[ width (fill |> minimum 100)
|
|
||||||
, width (fill |> maximum 875)
|
|
||||||
, padding 10
|
|
||||||
, centerX
|
|
||||||
]
|
|
|
@ -1,16 +0,0 @@
|
||||||
module Config.Helpers.Viewport exposing
|
|
||||||
( Msg
|
|
||||||
, resetViewport
|
|
||||||
)
|
|
||||||
|
|
||||||
import Browser.Dom as Dom exposing (setViewport)
|
|
||||||
import Task exposing (attempt)
|
|
||||||
|
|
||||||
|
|
||||||
type Msg
|
|
||||||
= NoOp
|
|
||||||
|
|
||||||
|
|
||||||
resetViewport : Cmd Msg
|
|
||||||
resetViewport =
|
|
||||||
Task.attempt (\_ -> NoOp) (Dom.setViewportOf "scroll-container" 0 0)
|
|
|
@ -1,118 +0,0 @@
|
||||||
module Config.Style.Colour.Helpers exposing
|
|
||||||
( ThemeColor(..)
|
|
||||||
, colourTheme
|
|
||||||
, getThemeColor
|
|
||||||
, syntaxTheme
|
|
||||||
)
|
|
||||||
|
|
||||||
import Config.Style.Colour.Types
|
|
||||||
exposing
|
|
||||||
( SyntaxColors
|
|
||||||
, Theme
|
|
||||||
)
|
|
||||||
import Element as E
|
|
||||||
exposing
|
|
||||||
( Color
|
|
||||||
, rgb255
|
|
||||||
, rgba
|
|
||||||
)
|
|
||||||
import Element.Font as F exposing (color)
|
|
||||||
|
|
||||||
|
|
||||||
colourTheme : Theme
|
|
||||||
colourTheme =
|
|
||||||
{ textLightGrey = rgb255 212 212 212
|
|
||||||
, textDarkGrey = rgb255 126 126 126
|
|
||||||
, textLightOrange = rgb255 204 102 0
|
|
||||||
, textDarkOrange = rgb255 120 60 0
|
|
||||||
, textDeepDarkOrange = rgb255 60 30 0
|
|
||||||
, backgroundLightGrey = rgb255 40 40 40
|
|
||||||
, backgroundDarkGrey = rgb255 30 30 30
|
|
||||||
, backgroundDeepDarkGrey = rgb255 20 20 20
|
|
||||||
, backgroundSpreadsheet = rgb255 36 36 36
|
|
||||||
, backgroundSpreadsheetDark = rgb255 26 26 26
|
|
||||||
, shadow = rgb255 10 10 10
|
|
||||||
, barGreen = rgb255 0 102 0
|
|
||||||
, barRed = rgb255 102 0 0
|
|
||||||
, debugColour = rgb255 227 28 121
|
|
||||||
, transparent = rgba 1 1 1 0
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
syntaxTheme : SyntaxColors
|
|
||||||
syntaxTheme =
|
|
||||||
{ punctuation = rgb255 202 158 230
|
|
||||||
, key = rgb255 138 173 244
|
|
||||||
, string = rgb255 166 218 149
|
|
||||||
, keyword = rgb255 245 169 127
|
|
||||||
, operator = rgb255 178 185 194
|
|
||||||
, background = rgb255 36 39 58
|
|
||||||
, text = rgb255 202 211 245
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
type ThemeColor
|
|
||||||
= TextLightGrey
|
|
||||||
| TextDarkGrey
|
|
||||||
| TextLightOrange
|
|
||||||
| TextDarkOrange
|
|
||||||
| TextDeepDarkOrange
|
|
||||||
| BackgroundLightGrey
|
|
||||||
| BackgroundDarkGrey
|
|
||||||
| BackgroundDeepDarkGrey
|
|
||||||
| BackgroundSpreadsheet
|
|
||||||
| BackgroundSpreadsheetDark
|
|
||||||
| Shadow
|
|
||||||
| BarGreen
|
|
||||||
| BarRed
|
|
||||||
| DebugColour
|
|
||||||
| Transparent
|
|
||||||
|
|
||||||
|
|
||||||
getThemeColor : ThemeColor -> Color
|
|
||||||
getThemeColor color =
|
|
||||||
case color of
|
|
||||||
TextLightGrey ->
|
|
||||||
colourTheme.textLightGrey
|
|
||||||
|
|
||||||
TextDarkGrey ->
|
|
||||||
colourTheme.textDarkGrey
|
|
||||||
|
|
||||||
TextLightOrange ->
|
|
||||||
colourTheme.textLightOrange
|
|
||||||
|
|
||||||
TextDarkOrange ->
|
|
||||||
colourTheme.textDarkOrange
|
|
||||||
|
|
||||||
TextDeepDarkOrange ->
|
|
||||||
colourTheme.textDeepDarkOrange
|
|
||||||
|
|
||||||
BackgroundLightGrey ->
|
|
||||||
colourTheme.backgroundLightGrey
|
|
||||||
|
|
||||||
BackgroundDarkGrey ->
|
|
||||||
colourTheme.backgroundDarkGrey
|
|
||||||
|
|
||||||
BackgroundDeepDarkGrey ->
|
|
||||||
colourTheme.backgroundDeepDarkGrey
|
|
||||||
|
|
||||||
BackgroundSpreadsheet ->
|
|
||||||
colourTheme.backgroundSpreadsheet
|
|
||||||
|
|
||||||
BackgroundSpreadsheetDark ->
|
|
||||||
colourTheme.backgroundSpreadsheetDark
|
|
||||||
|
|
||||||
Shadow ->
|
|
||||||
colourTheme.shadow
|
|
||||||
|
|
||||||
BarGreen ->
|
|
||||||
colourTheme.barGreen
|
|
||||||
|
|
||||||
BarRed ->
|
|
||||||
colourTheme.barRed
|
|
||||||
|
|
||||||
DebugColour ->
|
|
||||||
colourTheme.debugColour
|
|
||||||
|
|
||||||
Transparent ->
|
|
||||||
colourTheme.transparent
|
|
|
@ -1,36 +0,0 @@
|
||||||
module Config.Style.Colour.Types exposing
|
|
||||||
( SyntaxColors
|
|
||||||
, Theme
|
|
||||||
)
|
|
||||||
|
|
||||||
import Element exposing (Color)
|
|
||||||
|
|
||||||
|
|
||||||
type alias Theme =
|
|
||||||
{ textLightGrey : Color
|
|
||||||
, textDarkGrey : Color
|
|
||||||
, textLightOrange : Color
|
|
||||||
, textDarkOrange : Color
|
|
||||||
, textDeepDarkOrange : Color
|
|
||||||
, backgroundLightGrey : Color
|
|
||||||
, backgroundDarkGrey : Color
|
|
||||||
, backgroundDeepDarkGrey : Color
|
|
||||||
, backgroundSpreadsheet : Color
|
|
||||||
, backgroundSpreadsheetDark : Color
|
|
||||||
, shadow : Color
|
|
||||||
, barGreen : Color
|
|
||||||
, barRed : Color
|
|
||||||
, debugColour : Color
|
|
||||||
, transparent : Color
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
type alias SyntaxColors =
|
|
||||||
{ punctuation : Color
|
|
||||||
, key : Color
|
|
||||||
, string : Color
|
|
||||||
, keyword : Color
|
|
||||||
, operator : Color
|
|
||||||
, background : Color
|
|
||||||
, text : Color
|
|
||||||
}
|
|
|
@ -1,50 +0,0 @@
|
||||||
module Config.Style.Fonts exposing
|
|
||||||
( defaultFontSize
|
|
||||||
, headerFontSizeBig
|
|
||||||
, headerFontSizeMedium
|
|
||||||
, paragraphSpacing
|
|
||||||
, smallTextFontSize
|
|
||||||
, spartanFont
|
|
||||||
)
|
|
||||||
|
|
||||||
import Element
|
|
||||||
exposing
|
|
||||||
( Attr
|
|
||||||
, Attribute
|
|
||||||
, spacing
|
|
||||||
)
|
|
||||||
import Element.Font as F
|
|
||||||
exposing
|
|
||||||
( size
|
|
||||||
, typeface
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
spartanFont : F.Font
|
|
||||||
spartanFont =
|
|
||||||
F.typeface "League Spartan"
|
|
||||||
|
|
||||||
|
|
||||||
paragraphSpacing : Attribute msg
|
|
||||||
paragraphSpacing =
|
|
||||||
spacing 0
|
|
||||||
|
|
||||||
|
|
||||||
headerFontSizeBig : Attr decorative msg
|
|
||||||
headerFontSizeBig =
|
|
||||||
F.size 23
|
|
||||||
|
|
||||||
|
|
||||||
headerFontSizeMedium : Attr decorative msg
|
|
||||||
headerFontSizeMedium =
|
|
||||||
F.size 20
|
|
||||||
|
|
||||||
|
|
||||||
defaultFontSize : Attr decorative msg
|
|
||||||
defaultFontSize =
|
|
||||||
F.size 18
|
|
||||||
|
|
||||||
|
|
||||||
smallTextFontSize : Attr decorative msg
|
|
||||||
smallTextFontSize =
|
|
||||||
F.size 16
|
|
|
@ -1,24 +0,0 @@
|
||||||
module Config.Style.Glow exposing
|
|
||||||
( glowDeepDarkGrey
|
|
||||||
, glowDeepDarkGreyNavbar
|
|
||||||
, glowDeepDarkOrange
|
|
||||||
)
|
|
||||||
|
|
||||||
import Config.Style.Colour.Helpers exposing (ThemeColor(..), colourTheme, getThemeColor)
|
|
||||||
import Element exposing (Attr)
|
|
||||||
import Element.Border as D exposing (glow)
|
|
||||||
|
|
||||||
|
|
||||||
glowDeepDarkGrey : Attr decorative msg
|
|
||||||
glowDeepDarkGrey =
|
|
||||||
D.glow (getThemeColor Shadow) 4
|
|
||||||
|
|
||||||
|
|
||||||
glowDeepDarkOrange : Attr decorative msg
|
|
||||||
glowDeepDarkOrange =
|
|
||||||
D.glow (getThemeColor TextDeepDarkOrange) 4
|
|
||||||
|
|
||||||
|
|
||||||
glowDeepDarkGreyNavbar : Attr decorative msg
|
|
||||||
glowDeepDarkGreyNavbar =
|
|
||||||
D.glow (getThemeColor Shadow) 10
|
|
|
@ -1,32 +0,0 @@
|
||||||
module Config.Style.Icons.Helpers exposing (buildSvg)
|
|
||||||
|
|
||||||
import Config.Style.Icons.Types as SvgTypes
|
|
||||||
exposing
|
|
||||||
( InnerPart
|
|
||||||
, OuterPart
|
|
||||||
)
|
|
||||||
import Element as E
|
|
||||||
exposing
|
|
||||||
( Element
|
|
||||||
, el
|
|
||||||
, html
|
|
||||||
)
|
|
||||||
import Svg exposing (svg)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{- buildSvg consumes an inner record to construct most of an SVG, and an outer record to supply
|
|
||||||
any potentially varying TypedSvg.Core.Attribute msgs and wrap it in an Element.el so it can be
|
|
||||||
used by elm-ui. It provides a consistent interface for inserting SVGs into elm-ui code.
|
|
||||||
-}
|
|
||||||
|
|
||||||
|
|
||||||
buildSvg : SvgTypes.OuterPart msg -> SvgTypes.InnerPart msg -> Element msg
|
|
||||||
buildSvg outer inner =
|
|
||||||
el
|
|
||||||
outer.elementAttributes
|
|
||||||
<|
|
|
||||||
html <|
|
|
||||||
Svg.svg
|
|
||||||
(outer.svgAttributes ++ inner.svgAttributes)
|
|
||||||
inner.svg
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,28 +0,0 @@
|
||||||
module Config.Style.Icons.Types exposing
|
|
||||||
( InnerPart
|
|
||||||
, OuterPart
|
|
||||||
)
|
|
||||||
|
|
||||||
{-| The types used for SVG management.
|
|
||||||
-}
|
|
||||||
|
|
||||||
import Element exposing (Attribute)
|
|
||||||
import Shared exposing (Model)
|
|
||||||
import Svg exposing (svg)
|
|
||||||
|
|
||||||
|
|
||||||
{-| The outer record for the SVG builder. This is explained in ../Helpers/Svg.elm.
|
|
||||||
-}
|
|
||||||
type alias OuterPart msg =
|
|
||||||
{ elementAttributes : List (Element.Attribute msg)
|
|
||||||
, sharedModel : Shared.Model
|
|
||||||
, svgAttributes : List (Svg.Attribute msg)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
{-| The inner record for the SVG builder. This is explained in ../Helpers/Svg.elm.
|
|
||||||
-}
|
|
||||||
type alias InnerPart msg =
|
|
||||||
{ svgAttributes : List (Svg.Attribute msg)
|
|
||||||
, svg : List (Svg.Svg msg)
|
|
||||||
}
|
|
|
@ -1,69 +0,0 @@
|
||||||
module Config.Style.Transitions exposing (..)
|
|
||||||
|
|
||||||
import Config.Style.Colour.Helpers exposing (colourTheme)
|
|
||||||
import Config.Style.Glow
|
|
||||||
exposing
|
|
||||||
( glowDeepDarkGrey
|
|
||||||
, glowDeepDarkOrange
|
|
||||||
)
|
|
||||||
import Element
|
|
||||||
exposing
|
|
||||||
( Attribute
|
|
||||||
, htmlAttribute
|
|
||||||
, mouseOver
|
|
||||||
)
|
|
||||||
import Element.Background as B exposing (color)
|
|
||||||
import Element.Border as D exposing (color)
|
|
||||||
import Element.Font as F exposing (color)
|
|
||||||
import Html.Attributes as H exposing (style)
|
|
||||||
|
|
||||||
|
|
||||||
transitionStyleSlow : Attribute msg
|
|
||||||
transitionStyleSlow =
|
|
||||||
htmlAttribute <| style "transition" "all 0.4s ease-in-out"
|
|
||||||
|
|
||||||
|
|
||||||
transitionStyleMedium : Attribute msg
|
|
||||||
transitionStyleMedium =
|
|
||||||
htmlAttribute <| style "transition" "all 0.2s ease-in-out"
|
|
||||||
|
|
||||||
|
|
||||||
transitionStyleFast : Attribute msg
|
|
||||||
transitionStyleFast =
|
|
||||||
htmlAttribute <| style "transition" "all 0.1s ease-in-out"
|
|
||||||
|
|
||||||
|
|
||||||
specialNavbarTransition : Attribute msg
|
|
||||||
specialNavbarTransition =
|
|
||||||
htmlAttribute <| style "transition" "opacity .4s"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- This special transition is needed to avoid weird animation sequencing rather in Chrome-based browsers.
|
|
||||||
|
|
||||||
|
|
||||||
hoverFontLightOrange : Attribute msg
|
|
||||||
hoverFontLightOrange =
|
|
||||||
mouseOver [ F.color colourTheme.textLightOrange ]
|
|
||||||
|
|
||||||
|
|
||||||
hoverFontDarkOrange : Attribute msg
|
|
||||||
hoverFontDarkOrange =
|
|
||||||
mouseOver [ F.color colourTheme.textDarkOrange ]
|
|
||||||
|
|
||||||
|
|
||||||
hoverCircleButtonDarkOrange : Attribute msg
|
|
||||||
hoverCircleButtonDarkOrange =
|
|
||||||
mouseOver
|
|
||||||
[ D.color colourTheme.textDarkOrange
|
|
||||||
, B.color colourTheme.textDarkOrange
|
|
||||||
, glowDeepDarkOrange
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
hoverPageButtonDeepDarkOrange : Attribute msg
|
|
||||||
hoverPageButtonDeepDarkOrange =
|
|
||||||
mouseOver
|
|
||||||
[ B.color colourTheme.textDeepDarkOrange
|
|
||||||
, F.color colourTheme.textLightOrange
|
|
||||||
]
|
|
|
@ -1,194 +0,0 @@
|
||||||
module Effect exposing
|
|
||||||
( Effect
|
|
||||||
, none, batch
|
|
||||||
, sendCmd, sendMsg
|
|
||||||
, pushRoute, replaceRoute, loadExternalUrl
|
|
||||||
, map, toCmd
|
|
||||||
)
|
|
||||||
|
|
||||||
{-|
|
|
||||||
|
|
||||||
@docs Effect
|
|
||||||
@docs none, batch
|
|
||||||
@docs sendCmd, sendMsg
|
|
||||||
@docs pushRoute, replaceRoute, loadExternalUrl
|
|
||||||
|
|
||||||
@docs map, toCmd
|
|
||||||
|
|
||||||
-}
|
|
||||||
|
|
||||||
import Browser.Navigation
|
|
||||||
import Dict exposing (Dict)
|
|
||||||
import Route exposing (Route)
|
|
||||||
import Route.Path
|
|
||||||
import Shared.Model
|
|
||||||
import Shared.Msg
|
|
||||||
import Task
|
|
||||||
import Url exposing (Url)
|
|
||||||
|
|
||||||
|
|
||||||
type Effect msg
|
|
||||||
= -- BASICS
|
|
||||||
None
|
|
||||||
| Batch (List (Effect msg))
|
|
||||||
| SendCmd (Cmd msg)
|
|
||||||
-- ROUTING
|
|
||||||
| PushUrl String
|
|
||||||
| ReplaceUrl String
|
|
||||||
| LoadExternalUrl String
|
|
||||||
-- SHARED
|
|
||||||
| SendSharedMsg Shared.Msg.Msg
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- BASICS
|
|
||||||
|
|
||||||
|
|
||||||
{-| Don't send any effect.
|
|
||||||
-}
|
|
||||||
none : Effect msg
|
|
||||||
none =
|
|
||||||
None
|
|
||||||
|
|
||||||
|
|
||||||
{-| Send multiple effects at once.
|
|
||||||
-}
|
|
||||||
batch : List (Effect msg) -> Effect msg
|
|
||||||
batch =
|
|
||||||
Batch
|
|
||||||
|
|
||||||
|
|
||||||
{-| Send a normal `Cmd msg` as an effect, something like `Http.get` or `Random.generate`.
|
|
||||||
-}
|
|
||||||
sendCmd : Cmd msg -> Effect msg
|
|
||||||
sendCmd =
|
|
||||||
SendCmd
|
|
||||||
|
|
||||||
|
|
||||||
{-| Send a message as an effect. Useful when emitting events from UI components.
|
|
||||||
-}
|
|
||||||
sendMsg : msg -> Effect msg
|
|
||||||
sendMsg msg =
|
|
||||||
Task.succeed msg
|
|
||||||
|> Task.perform identity
|
|
||||||
|> SendCmd
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- ROUTING
|
|
||||||
|
|
||||||
|
|
||||||
{-| Set the new route, and make the back button go back to the current route.
|
|
||||||
-}
|
|
||||||
pushRoute :
|
|
||||||
{ path : Route.Path.Path
|
|
||||||
, query : Dict String String
|
|
||||||
, hash : Maybe String
|
|
||||||
}
|
|
||||||
-> Effect msg
|
|
||||||
pushRoute route =
|
|
||||||
PushUrl (Route.toString route)
|
|
||||||
|
|
||||||
{-| Set given path as route (without any query params or hash), and make the back button go back to the current route.
|
|
||||||
-}
|
|
||||||
pushPath :
|
|
||||||
Route.Path.Path
|
|
||||||
-> Effect msg
|
|
||||||
pushPath path =
|
|
||||||
PushUrl (Route.toString { path = path, query = Dict.empty, hash = Nothing })
|
|
||||||
|
|
||||||
{-| Set the new route, but replace the previous one, so clicking the back
|
|
||||||
button **won't** go back to the previous route.
|
|
||||||
-}
|
|
||||||
replaceRoute :
|
|
||||||
{ path : Route.Path.Path
|
|
||||||
, query : Dict String String
|
|
||||||
, hash : Maybe String
|
|
||||||
}
|
|
||||||
-> Effect msg
|
|
||||||
replaceRoute route =
|
|
||||||
ReplaceUrl (Route.toString route)
|
|
||||||
|
|
||||||
{-| Set given path as route (without any query params or hash), but replace the previous route,
|
|
||||||
so clicking the back button **won't** go back to the previous route
|
|
||||||
-}
|
|
||||||
replacePath :
|
|
||||||
Route.Path.Path
|
|
||||||
-> Effect msg
|
|
||||||
replacePath path =
|
|
||||||
ReplaceUrl (Route.toString { path = path, query = Dict.empty, hash = Nothing })
|
|
||||||
|
|
||||||
{-| Redirect users to a new URL, somewhere external your web application.
|
|
||||||
-}
|
|
||||||
loadExternalUrl : String -> Effect msg
|
|
||||||
loadExternalUrl =
|
|
||||||
LoadExternalUrl
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- INTERNALS
|
|
||||||
|
|
||||||
|
|
||||||
{-| Elm Land depends on this function to connect pages and layouts
|
|
||||||
together into the overall app.
|
|
||||||
-}
|
|
||||||
map : (msg1 -> msg2) -> Effect msg1 -> Effect msg2
|
|
||||||
map fn effect =
|
|
||||||
case effect of
|
|
||||||
None ->
|
|
||||||
None
|
|
||||||
|
|
||||||
Batch list ->
|
|
||||||
Batch (List.map (map fn) list)
|
|
||||||
|
|
||||||
SendCmd cmd ->
|
|
||||||
SendCmd (Cmd.map fn cmd)
|
|
||||||
|
|
||||||
PushUrl url ->
|
|
||||||
PushUrl url
|
|
||||||
|
|
||||||
ReplaceUrl url ->
|
|
||||||
ReplaceUrl url
|
|
||||||
|
|
||||||
LoadExternalUrl url ->
|
|
||||||
LoadExternalUrl url
|
|
||||||
|
|
||||||
SendSharedMsg sharedMsg ->
|
|
||||||
SendSharedMsg sharedMsg
|
|
||||||
|
|
||||||
|
|
||||||
{-| Elm Land depends on this function to perform your effects.
|
|
||||||
-}
|
|
||||||
toCmd :
|
|
||||||
{ key : Browser.Navigation.Key
|
|
||||||
, url : Url
|
|
||||||
, shared : Shared.Model.Model
|
|
||||||
, fromSharedMsg : Shared.Msg.Msg -> msg
|
|
||||||
, batch : List msg -> msg
|
|
||||||
, toCmd : msg -> Cmd msg
|
|
||||||
}
|
|
||||||
-> Effect msg
|
|
||||||
-> Cmd msg
|
|
||||||
toCmd options effect =
|
|
||||||
case effect of
|
|
||||||
None ->
|
|
||||||
Cmd.none
|
|
||||||
|
|
||||||
Batch list ->
|
|
||||||
Cmd.batch (List.map (toCmd options) list)
|
|
||||||
|
|
||||||
SendCmd cmd ->
|
|
||||||
cmd
|
|
||||||
|
|
||||||
PushUrl url ->
|
|
||||||
Browser.Navigation.pushUrl options.key url
|
|
||||||
|
|
||||||
ReplaceUrl url ->
|
|
||||||
Browser.Navigation.replaceUrl options.key url
|
|
||||||
|
|
||||||
LoadExternalUrl url ->
|
|
||||||
Browser.Navigation.load url
|
|
||||||
|
|
||||||
SendSharedMsg sharedMsg ->
|
|
||||||
Task.succeed sharedMsg
|
|
||||||
|> Task.perform options.fromSharedMsg
|
|
|
@ -1,74 +0,0 @@
|
||||||
module Pages.Home_ exposing (Model, Msg, page)
|
|
||||||
|
|
||||||
import Effect exposing (Effect)
|
|
||||||
import Element as E exposing (..)
|
|
||||||
import Element.Background as B exposing (..)
|
|
||||||
import Element.Border as D exposing (..)
|
|
||||||
import Html
|
|
||||||
import Html.Attributes exposing (..)
|
|
||||||
import Page exposing (Page)
|
|
||||||
import Route exposing (Route)
|
|
||||||
import Shared
|
|
||||||
import View exposing (View)
|
|
||||||
|
|
||||||
|
|
||||||
page : Shared.Model -> Route () -> Page Model Msg
|
|
||||||
page shared route =
|
|
||||||
Page.new
|
|
||||||
{ init = init
|
|
||||||
, update = update
|
|
||||||
, subscriptions = subscriptions
|
|
||||||
, view = view
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- INIT
|
|
||||||
|
|
||||||
|
|
||||||
type alias Model =
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
init : () -> ( Model, Effect Msg )
|
|
||||||
init () =
|
|
||||||
( {}
|
|
||||||
, Effect.none
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- UPDATE
|
|
||||||
|
|
||||||
|
|
||||||
type Msg
|
|
||||||
= NoOp
|
|
||||||
|
|
||||||
|
|
||||||
update : Msg -> Model -> ( Model, Effect Msg )
|
|
||||||
update msg model =
|
|
||||||
case msg of
|
|
||||||
NoOp ->
|
|
||||||
( model
|
|
||||||
, Effect.none
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- SUBSCRIPTIONS
|
|
||||||
|
|
||||||
|
|
||||||
subscriptions : Model -> Sub Msg
|
|
||||||
subscriptions model =
|
|
||||||
Sub.none
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- VIEW
|
|
||||||
|
|
||||||
|
|
||||||
view : Model -> View Msg
|
|
||||||
view model =
|
|
||||||
{ title = "Pages.Home_"
|
|
||||||
, body = [ Html.text "/" ]
|
|
||||||
}
|
|
|
@ -1,69 +0,0 @@
|
||||||
module Pages.NotFound_ exposing (Model, Msg, page)
|
|
||||||
|
|
||||||
import Effect exposing (Effect)
|
|
||||||
import Html exposing (..)
|
|
||||||
import Page exposing (Page)
|
|
||||||
import Route exposing (Route)
|
|
||||||
import Route.Path
|
|
||||||
import Shared
|
|
||||||
import View exposing (View)
|
|
||||||
|
|
||||||
|
|
||||||
page : Shared.Model -> Route () -> Page Model Msg
|
|
||||||
page shared route =
|
|
||||||
Page.new
|
|
||||||
{ init = init
|
|
||||||
, update = update
|
|
||||||
, subscriptions = subscriptions
|
|
||||||
, view = view
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- INIT
|
|
||||||
|
|
||||||
|
|
||||||
type alias Model =
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
init : () -> ( Model, Effect Msg )
|
|
||||||
init () =
|
|
||||||
( {}
|
|
||||||
, Effect.none
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- UPDATE
|
|
||||||
|
|
||||||
|
|
||||||
type Msg
|
|
||||||
= NoOp
|
|
||||||
|
|
||||||
|
|
||||||
update : Msg -> Model -> ( Model, Effect Msg )
|
|
||||||
update msg model =
|
|
||||||
case msg of
|
|
||||||
NoOp ->
|
|
||||||
( model
|
|
||||||
, Effect.none
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- SUBSCRIPTIONS
|
|
||||||
|
|
||||||
|
|
||||||
subscriptions : Model -> Sub Msg
|
|
||||||
subscriptions model =
|
|
||||||
Sub.none
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- VIEW
|
|
||||||
|
|
||||||
|
|
||||||
view : Model -> View Msg
|
|
||||||
view model =
|
|
||||||
View.fromString "Page not found"
|
|
|
@ -1,74 +0,0 @@
|
||||||
module Shared exposing
|
|
||||||
( Flags, decoder
|
|
||||||
, Model, Msg
|
|
||||||
, init, update, subscriptions
|
|
||||||
)
|
|
||||||
|
|
||||||
{-|
|
|
||||||
|
|
||||||
@docs Flags, decoder
|
|
||||||
@docs Model, Msg
|
|
||||||
@docs init, update, subscriptions
|
|
||||||
|
|
||||||
-}
|
|
||||||
|
|
||||||
import Effect exposing (Effect)
|
|
||||||
import Json.Decode
|
|
||||||
import Route exposing (Route)
|
|
||||||
import Route.Path
|
|
||||||
import Shared.Model
|
|
||||||
import Shared.Msg
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- FLAGS
|
|
||||||
|
|
||||||
|
|
||||||
type alias Flags =
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
decoder : Json.Decode.Decoder Flags
|
|
||||||
decoder =
|
|
||||||
Json.Decode.succeed {}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- INIT
|
|
||||||
|
|
||||||
|
|
||||||
type alias Model =
|
|
||||||
Shared.Model.Model
|
|
||||||
|
|
||||||
|
|
||||||
init : Result Json.Decode.Error Flags -> Route () -> ( Model, Effect Msg )
|
|
||||||
init flagsResult route =
|
|
||||||
( {}
|
|
||||||
, Effect.none
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- UPDATE
|
|
||||||
|
|
||||||
|
|
||||||
type alias Msg =
|
|
||||||
Shared.Msg.Msg
|
|
||||||
|
|
||||||
|
|
||||||
update : Route () -> Msg -> Model -> ( Model, Effect Msg )
|
|
||||||
update route msg model =
|
|
||||||
case msg of
|
|
||||||
Shared.Msg.NoOp ->
|
|
||||||
( model
|
|
||||||
, Effect.none
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- SUBSCRIPTIONS
|
|
||||||
|
|
||||||
|
|
||||||
subscriptions : Route () -> Model -> Sub Msg
|
|
||||||
subscriptions route model =
|
|
||||||
Sub.none
|
|
|
@ -1,14 +0,0 @@
|
||||||
module Shared.Model exposing (Model)
|
|
||||||
|
|
||||||
{-| -}
|
|
||||||
|
|
||||||
|
|
||||||
{-| Normally, this value would live in "Shared.elm"
|
|
||||||
but that would lead to a circular dependency import cycle.
|
|
||||||
|
|
||||||
For that reason, both `Shared.Model` and `Shared.Msg` are in their
|
|
||||||
own file, so they can be imported by `Effect.elm`
|
|
||||||
|
|
||||||
-}
|
|
||||||
type alias Model =
|
|
||||||
{}
|
|
|
@ -1,14 +0,0 @@
|
||||||
module Shared.Msg exposing (Msg(..))
|
|
||||||
|
|
||||||
{-| -}
|
|
||||||
|
|
||||||
|
|
||||||
{-| Normally, this value would live in "Shared.elm"
|
|
||||||
but that would lead to a circular dependency import cycle.
|
|
||||||
|
|
||||||
For that reason, both `Shared.Model` and `Shared.Msg` are in their
|
|
||||||
own file, so they can be imported by `Effect.elm`
|
|
||||||
|
|
||||||
-}
|
|
||||||
type Msg
|
|
||||||
= NoOp
|
|
|
@ -1,72 +0,0 @@
|
||||||
module View exposing
|
|
||||||
( View, map
|
|
||||||
, none, fromString
|
|
||||||
, toBrowserDocument
|
|
||||||
)
|
|
||||||
|
|
||||||
{-|
|
|
||||||
|
|
||||||
@docs View, map
|
|
||||||
@docs none, fromString
|
|
||||||
@docs toBrowserDocument
|
|
||||||
|
|
||||||
-}
|
|
||||||
|
|
||||||
import Browser
|
|
||||||
import Html exposing (Html)
|
|
||||||
import Route exposing (Route)
|
|
||||||
import Shared.Model
|
|
||||||
|
|
||||||
|
|
||||||
type alias View msg =
|
|
||||||
{ title : String
|
|
||||||
, body : List (Html msg)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
{-| Used internally by Elm Land to create your application
|
|
||||||
so it works with Elm's expected `Browser.Document msg` type.
|
|
||||||
-}
|
|
||||||
toBrowserDocument :
|
|
||||||
{ shared : Shared.Model.Model
|
|
||||||
, route : Route ()
|
|
||||||
, view : View msg
|
|
||||||
}
|
|
||||||
-> Browser.Document msg
|
|
||||||
toBrowserDocument { view } =
|
|
||||||
{ title = view.title
|
|
||||||
, body = view.body
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
{-| Used internally by Elm Land to connect your pages together.
|
|
||||||
-}
|
|
||||||
map : (msg1 -> msg2) -> View msg1 -> View msg2
|
|
||||||
map fn view =
|
|
||||||
{ title = view.title
|
|
||||||
, body = List.map (Html.map fn) view.body
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
{-| Used internally by Elm Land whenever transitioning between
|
|
||||||
authenticated pages.
|
|
||||||
-}
|
|
||||||
none : View msg
|
|
||||||
none =
|
|
||||||
{ title = ""
|
|
||||||
, body = []
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
{-| If you customize the `View` module, anytime you run `elm-land add page`,
|
|
||||||
the generated page will use this when adding your `view` function.
|
|
||||||
|
|
||||||
That way your app will compile after adding new pages, and you can see
|
|
||||||
the new page working in the web browser!
|
|
||||||
|
|
||||||
-}
|
|
||||||
fromString : String -> View msg
|
|
||||||
fromString moduleName =
|
|
||||||
{ title = moduleName
|
|
||||||
, body = [ Html.text moduleName ]
|
|
||||||
}
|
|
|
@ -1,25 +0,0 @@
|
||||||
// This returns the flags passed into your Elm application
|
|
||||||
export const flags = async ({ env } : ElmLand.FlagsArgs) => {
|
|
||||||
return {}
|
|
||||||
}
|
|
||||||
|
|
||||||
// This function is called after your Elm app starts
|
|
||||||
export const onReady = ({ app, env } : ElmLand.OnReadyArgs) => {
|
|
||||||
console.log('Elm is ready', app)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Type definitions for Elm Land
|
|
||||||
namespace ElmLand {
|
|
||||||
export type FlagsArgs = {
|
|
||||||
env: Record<string, string>
|
|
||||||
}
|
|
||||||
export type OnReadyArgs = {
|
|
||||||
env: Record<string, string>
|
|
||||||
app: { ports?: Record<string, Port> }
|
|
||||||
}
|
|
||||||
export type Port = {
|
|
||||||
send?: (data: unknown) => void
|
|
||||||
subscribe?: (callback: (data: unknown) => unknown) => void
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,52 +0,0 @@
|
||||||
{
|
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
haskellProjects.default = {
|
|
||||||
devShell = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
tools = hp: {
|
|
||||||
inherit (hp)
|
|
||||||
cabal-fmt
|
|
||||||
haskell-language-server
|
|
||||||
;
|
|
||||||
|
|
||||||
inherit (pkgs)
|
|
||||||
dhall
|
|
||||||
dhall-json
|
|
||||||
dhall-lsp-server
|
|
||||||
helix-gpt
|
|
||||||
age
|
|
||||||
just
|
|
||||||
nil
|
|
||||||
nixd
|
|
||||||
sops
|
|
||||||
ssh-to-age
|
|
||||||
nixfmt-rfc-style
|
|
||||||
libz
|
|
||||||
ngrep
|
|
||||||
stripe-cli
|
|
||||||
vscode-langservers-extracted
|
|
||||||
zlib
|
|
||||||
;
|
|
||||||
inherit (pkgs.elmPackages)
|
|
||||||
elm
|
|
||||||
elm-format
|
|
||||||
elm-land
|
|
||||||
elm-language-server
|
|
||||||
elm-review
|
|
||||||
elm-test
|
|
||||||
;
|
|
||||||
inherit (pkgs.haskellPackages)
|
|
||||||
nixfmt
|
|
||||||
;
|
|
||||||
};
|
|
||||||
|
|
||||||
hlsCheck.enable = true;
|
|
||||||
mkShellArgs.shellHook = "${config.pre-commit.installationScript}";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,4 +0,0 @@
|
||||||
{ self, ... }:
|
|
||||||
{
|
|
||||||
packages.default = self.packages.example;
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
pre-commit.settings.hooks = {
|
|
||||||
nixfmt-rfc-style.enable = true;
|
|
||||||
# commitizen.enable = true;
|
|
||||||
statix.enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
{
|
|
||||||
perSystem =
|
|
||||||
{
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
self',
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
configPath = ./config;
|
|
||||||
|
|
||||||
devshellImports =
|
|
||||||
let
|
|
||||||
files = builtins.attrNames (builtins.readDir configPath);
|
|
||||||
in
|
|
||||||
map (name: configPath + "/${name}") (
|
|
||||||
builtins.filter (name: builtins.match ".*\\.nix$" name != null) files
|
|
||||||
);
|
|
||||||
in
|
|
||||||
{
|
|
||||||
imports = devshellImports;
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue