diff --git a/.gitignore b/.gitignore index 2bbdbfe..a4abc69 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .direnv result +.pre-commit-config.yaml diff --git a/README.md b/README.md index 470fcda..ea32eaa 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ # Nix Flake Parts Emanote Site Migrating the OSDS site content to an Emanote site. + +```bash +# Run and detach command +nohup nix run .#osds-site >log-osds-site.log 2>&1 & +``` diff --git a/flake.lock b/flake.lock index 0369ec7..e6a793d 100644 --- a/flake.lock +++ b/flake.lock @@ -32,36 +32,19 @@ "type": "github" } }, - "devshell": { - "inputs": { - "nixpkgs": "nixpkgs" - }, - "locked": { - "lastModified": 1741473158, - "narHash": "sha256-kWNaq6wQUbUMlPgw8Y+9/9wP0F8SHkjy24/mN3UAppg=", - "owner": "numtide", - "repo": "devshell", - "rev": "7c9e793ebe66bcba8292989a68c0419b737a22a0", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "devshell", - "type": "github" - } - }, "ema": { "flake": false, "locked": { - "lastModified": 1745123527, - "narHash": "sha256-FD6GJaiiKkH65N7iDjHtOtaEcWMf1P/t98kktILSkcg=", + "lastModified": 1753226458, + "narHash": "sha256-vDhjw+Cm7HniaiIHirwM0B2yzzLYLO3HHMaZsQRL3uw=", "owner": "srid", "repo": "ema", - "rev": "8590cc91e1f3dc3e10409d914c40a484645a2680", + "rev": "7ff434cf8f494c62de7fe6c1a36d8681929beb93", "type": "github" }, "original": { "owner": "srid", + "ref": "0.12.0.0", "repo": "ema", "type": "github" } @@ -78,16 +61,18 @@ "heist-extra": "heist-extra", "lvar": "lvar", "nixos-unified": "nixos-unified", - "nixpkgs": "nixpkgs_2", + "nixpkgs": [ + "nixpkgs" + ], "treefmt-nix": "treefmt-nix", "unionmount": "unionmount" }, "locked": { - "lastModified": 1753040695, - "narHash": "sha256-dpOcuQ1eIF6mmjA4b3eGreoYIpffevdhqxs/ykq/IxI=", + "lastModified": 1753298660, + "narHash": "sha256-rE84s+P4hx4AtriCPagexOQ7KsqIYsLyXGVx+QyzWFw=", "owner": "srid", "repo": "emanote", - "rev": "fa5d7125fe32c3b25ee271f3b4013753880519f0", + "rev": "7d505ee7ecfdbce87daff982034561f6a4625abc", "type": "github" }, "original": { @@ -154,11 +139,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1751413152, - "narHash": "sha256-Tyw1RjYEsp5scoigs1384gIg6e0GoBVjms4aXFfRssQ=", + "lastModified": 1753121425, + "narHash": "sha256-TVcTNvOeWWk1DXljFxVRp+E0tzG1LhrVjOGGoMHuXio=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "77826244401ea9de6e3bac47c2db46005e1f30b5", + "rev": "644e0fc48951a860279da645ba77fe4a6e814c5e", "type": "github" }, "original": { @@ -186,7 +171,9 @@ "inputs": { "flake-compat": "flake-compat", "gitignore": "gitignore", - "nixpkgs": "nixpkgs_3" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { "lastModified": 1750779888, @@ -257,15 +244,16 @@ "lvar": { "flake": false, "locked": { - "lastModified": 1745122737, - "narHash": "sha256-ZnYXkkPmnNvt4tA45JgSC7dpttmqhUo4AHfEjB1r1gE=", + "lastModified": 1753226155, + "narHash": "sha256-Uwg5s0SlxLp83bXHA+6TIQV+L+lu8lwMpBdNuiuk7hg=", "owner": "srid", "repo": "lvar", - "rev": "047a24c4dcd7f85f9c18058f6be991cea531870e", + "rev": "cd110d4823ee7b8bbbf115a47c79bc304c3309cd", "type": "github" }, "original": { "owner": "srid", + "ref": "0.2.0.0", "repo": "lvar", "type": "github" } @@ -287,11 +275,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1722073938, - "narHash": "sha256-OpX0StkL8vpXyWOGUD6G+MA26wAXK6SpT94kLJXo6B4=", + "lastModified": 1753399495, + "narHash": "sha256-7XG/QBqhrYOyA2houjRTL2NMa7IKZZ/somBqr+Q/6Wo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e36e9f57337d0ff0cf77aceb58af4c805472bfae", + "rev": "0d00f23f023b7215b3f1035adb5247c8ec180dbc", "type": "github" }, "original": { @@ -316,77 +304,12 @@ "type": "github" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1752900028, - "narHash": "sha256-dPALCtmik9Wr14MGqVXm+OQcv7vhPBXcWNIOThGnB/Q=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "6b4955211758ba47fac850c040a27f23b9b4008f", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { - "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" - } - }, - "nixpkgs_4": { - "locked": { - "lastModified": 1752950548, - "narHash": "sha256-NS6BLD0lxOrnCiEOcvQCDVPXafX1/ek1dfJHX1nUIzc=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "c87b95e25065c028d31a94f06a62927d18763fdf", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_5": { - "locked": { - "lastModified": 1747958103, - "narHash": "sha256-qmmFCrfBwSHoWw7cVK4Aj+fns+c54EBP8cGqp/yK410=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "fe51d34885f7b5e3e7b59572796e1bcb427eccb1", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "root": { "inputs": { - "devshell": "devshell", "emanote": "emanote", "flake-parts": "flake-parts_2", "git-hooks-nix": "git-hooks-nix", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs", "treefmt-nix": "treefmt-nix_2" } }, @@ -413,14 +336,16 @@ }, "treefmt-nix_2": { "inputs": { - "nixpkgs": "nixpkgs_5" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { - "lastModified": 1753006367, - "narHash": "sha256-tzbhc4XttkyEhswByk5R38l+ztN9UDbnj0cTcP6Hp9A=", + "lastModified": 1753439394, + "narHash": "sha256-Bv9h1AJegLI8uAhiJ1sZ4XAndYxhgf38tMgCQwiEpmc=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "421b56313c65a0815a52b424777f55acf0b56ddf", + "rev": "2673921c03d6e75fdf4aa93e025772608d1482cf", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index cf43d86..ca00a03 100644 --- a/flake.nix +++ b/flake.nix @@ -2,24 +2,24 @@ description = ''''; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; flake-parts.url = "github:hercules-ci/flake-parts"; - devshell.url = "github:numtide/devshell"; emanote.url = "github:srid/emanote"; + emanote.inputs.nixpkgs.follows = "nixpkgs"; git-hooks-nix.url = "github:cachix/git-hooks.nix"; + git-hooks-nix.inputs.nixpkgs.follows = "nixpkgs"; treefmt-nix.url = "github:numtide/treefmt-nix"; + treefmt-nix.inputs.nixpkgs.follows = "nixpkgs"; }; - outputs = - inputs@{ flake-parts, ... }: - flake-parts.lib.mkFlake { inherit inputs; } { + outputs = inputs @ {flake-parts, ...}: + flake-parts.lib.mkFlake {inherit inputs;} { imports = [ # To import a flake module # 1. Add foo to inputs # 2. Add foo as a parameter to the outputs function # 3. Add here: foo.flakeModule - inputs.devshell.flakeModule inputs.emanote.flakeModule inputs.git-hooks-nix.flakeModule inputs.treefmt-nix.flakeModule @@ -30,72 +30,73 @@ # "aarch64-darwin" # "x86_64-darwin" ]; - perSystem = - { - config, - self', - inputs', - pkgs, - system, - ... - }: - { - # Per-system attributes can be defined here. The self' and inputs' - # module parameters provide easy access to attributes of the same - # system. - - # Equivalent to inputs'.nixpkgs.legacyPackages.hello; - packages.default = pkgs.hello; - - pre-commit = { - settings.hooks = { - mdformat.enable = true; - nixfmt-rfc-style.enable = true; - prettier.enable = true; - prettier.excludes = [ - ".*\.md" - "flake.lock" - ]; - stylish-haskell.enable = true; - }; - }; - - devshells.default = { - packages = with pkgs; [ - cowsay - ]; - }; - - emanote.sites = { - osds-site = { - layers = [ - { - path = ./osds-src; - pathString = "osds-src"; - } - ]; - baseUrl = "127.0.0.1"; - port = 8000; - }; - }; - - treefmt = { - programs = { - mdformat.enable = true; - nixfmt.enable = true; - nixfmt.package = pkgs.nixfmt-rfc-style; - prettier.enable = true; - prettier.excludes = [ "*.md" ]; - stylish-haskell.enable = true; - }; - }; - - }; flake = { # The usual flake attributes can be defined here, including system- # agnostic ones like nixosModule and system-enumerating ones, although # those are more easily expressed in perSystem. + }; + perSystem = { + config, + self', + inputs', + pkgs, + system, + ... + }: { + # Per-system attributes can be defined here. The self' and inputs' + # module parameters provide easy access to attributes of the same + # system. + # Equivalent to inputs'.nixpkgs.legacyPackages.hello; + # packages.default = pkgs.hello; + packages.default = self'.packages.osds-site; + apps.default = self'.apps.osds-site; + + devShells.default = pkgs.mkShell { + packages = with pkgs; [ + cowsay + + alejandra + ]; + + shellHook = '' + ${config.pre-commit.installationScript} + echo 1>&2 "Welcome to the development shell!" + ''; + }; + + emanote.sites = { + osds-site = { + layers = [ + { + path = ./osds-src; + pathString = "osds-src"; + } + ]; + baseUrl = "localhost"; + port = 12513; + }; + }; + + pre-commit = { + settings.hooks = { + alejandra.enable = true; + mdformat.enable = true; + prettier.enable = true; + prettier.excludes = [".*\.md" "flake.lock"]; + stylish-haskell.enable = true; + }; + }; + + treefmt = { + programs = { + alejandra.enable = true; + mdformat.enable = true; + prettier.enable = true; + prettier.excludes = ["*.md"]; + stylish-haskell.enable = true; + }; + }; }; }; } diff --git a/osds-src/index.yaml b/osds-src/index.yaml new file mode 100644 index 0000000..0aa2332 --- /dev/null +++ b/osds-src/index.yaml @@ -0,0 +1,4 @@ +template: + sidebar: + enable: true + collapsed: false