diff --git a/.gitignore b/.gitignore index a4abc69..2bbdbfe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ .direnv result -.pre-commit-config.yaml diff --git a/README.md b/README.md index ea32eaa..470fcda 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,3 @@ # 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 e6a793d..0369ec7 100644 --- a/flake.lock +++ b/flake.lock @@ -32,19 +32,36 @@ "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": 1753226458, - "narHash": "sha256-vDhjw+Cm7HniaiIHirwM0B2yzzLYLO3HHMaZsQRL3uw=", + "lastModified": 1745123527, + "narHash": "sha256-FD6GJaiiKkH65N7iDjHtOtaEcWMf1P/t98kktILSkcg=", "owner": "srid", "repo": "ema", - "rev": "7ff434cf8f494c62de7fe6c1a36d8681929beb93", + "rev": "8590cc91e1f3dc3e10409d914c40a484645a2680", "type": "github" }, "original": { "owner": "srid", - "ref": "0.12.0.0", "repo": "ema", "type": "github" } @@ -61,18 +78,16 @@ "heist-extra": "heist-extra", "lvar": "lvar", "nixos-unified": "nixos-unified", - "nixpkgs": [ - "nixpkgs" - ], + "nixpkgs": "nixpkgs_2", "treefmt-nix": "treefmt-nix", "unionmount": "unionmount" }, "locked": { - "lastModified": 1753298660, - "narHash": "sha256-rE84s+P4hx4AtriCPagexOQ7KsqIYsLyXGVx+QyzWFw=", + "lastModified": 1753040695, + "narHash": "sha256-dpOcuQ1eIF6mmjA4b3eGreoYIpffevdhqxs/ykq/IxI=", "owner": "srid", "repo": "emanote", - "rev": "7d505ee7ecfdbce87daff982034561f6a4625abc", + "rev": "fa5d7125fe32c3b25ee271f3b4013753880519f0", "type": "github" }, "original": { @@ -139,11 +154,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1753121425, - "narHash": "sha256-TVcTNvOeWWk1DXljFxVRp+E0tzG1LhrVjOGGoMHuXio=", + "lastModified": 1751413152, + "narHash": "sha256-Tyw1RjYEsp5scoigs1384gIg6e0GoBVjms4aXFfRssQ=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "644e0fc48951a860279da645ba77fe4a6e814c5e", + "rev": "77826244401ea9de6e3bac47c2db46005e1f30b5", "type": "github" }, "original": { @@ -171,9 +186,7 @@ "inputs": { "flake-compat": "flake-compat", "gitignore": "gitignore", - "nixpkgs": [ - "nixpkgs" - ] + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1750779888, @@ -244,16 +257,15 @@ "lvar": { "flake": false, "locked": { - "lastModified": 1753226155, - "narHash": "sha256-Uwg5s0SlxLp83bXHA+6TIQV+L+lu8lwMpBdNuiuk7hg=", + "lastModified": 1745122737, + "narHash": "sha256-ZnYXkkPmnNvt4tA45JgSC7dpttmqhUo4AHfEjB1r1gE=", "owner": "srid", "repo": "lvar", - "rev": "cd110d4823ee7b8bbbf115a47c79bc304c3309cd", + "rev": "047a24c4dcd7f85f9c18058f6be991cea531870e", "type": "github" }, "original": { "owner": "srid", - "ref": "0.2.0.0", "repo": "lvar", "type": "github" } @@ -275,11 +287,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1753399495, - "narHash": "sha256-7XG/QBqhrYOyA2houjRTL2NMa7IKZZ/somBqr+Q/6Wo=", + "lastModified": 1722073938, + "narHash": "sha256-OpX0StkL8vpXyWOGUD6G+MA26wAXK6SpT94kLJXo6B4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0d00f23f023b7215b3f1035adb5247c8ec180dbc", + "rev": "e36e9f57337d0ff0cf77aceb58af4c805472bfae", "type": "github" }, "original": { @@ -304,12 +316,77 @@ "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", + "nixpkgs": "nixpkgs_4", "treefmt-nix": "treefmt-nix_2" } }, @@ -336,16 +413,14 @@ }, "treefmt-nix_2": { "inputs": { - "nixpkgs": [ - "nixpkgs" - ] + "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1753439394, - "narHash": "sha256-Bv9h1AJegLI8uAhiJ1sZ4XAndYxhgf38tMgCQwiEpmc=", + "lastModified": 1753006367, + "narHash": "sha256-tzbhc4XttkyEhswByk5R38l+ztN9UDbnj0cTcP6Hp9A=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "2673921c03d6e75fdf4aa93e025772608d1482cf", + "rev": "421b56313c65a0815a52b424777f55acf0b56ddf", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index ca00a03..cf43d86 100644 --- a/flake.nix +++ b/flake.nix @@ -2,24 +2,24 @@ description = ''''; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-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,73 +30,72 @@ # "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 deleted file mode 100644 index 0aa2332..0000000 --- a/osds-src/index.yaml +++ /dev/null @@ -1,4 +0,0 @@ -template: - sidebar: - enable: true - collapsed: false