diff --git a/.envrc b/.envrc index 31ca173..3550a30 100644 --- a/.envrc +++ b/.envrc @@ -1,12 +1 @@ -#!/usr/bin/env bash -# ^ added for shellcheck and file-type detection - -# Watch & reload direnv on change -watch_file devshell.toml - -if [[ $(type -t use_flake) != function ]]; then - echo "ERROR: use_flake function missing." - echo "Please update direnv to v2.30.0 or later." - exit 1 -fi -use flake \ No newline at end of file +use flake diff --git a/devshell.toml b/devshell.toml deleted file mode 100644 index 4160f9a..0000000 --- a/devshell.toml +++ /dev/null @@ -1,23 +0,0 @@ -[devshell] -name = "hugo website" - -[[commands]] -package = "hugo" - -[[commands]] -package = "go" - -[[commands]] -command = "hugo server" -name = "server" -help = "Server" - -[[commands]] -command = "hugo server --buildDrafts" -name = "drafts" -help = "Server including drafts" - -[[commands]] -command = "hugo" -name = "build" -help = "Build site – usually not necessary" diff --git a/flake.lock b/flake.lock index 04db494..5cb73b1 100644 --- a/flake.lock +++ b/flake.lock @@ -1,50 +1,15 @@ { "nodes": { - "devshell": { + "flake-utils": { "inputs": { - "nixpkgs": "nixpkgs", "systems": "systems" }, "locked": { - "lastModified": 1692793255, - "narHash": "sha256-yVyj0AE280JkccDHuG1XO9oGxN6bW8ksr/xttXcXzK0=", - "owner": "numtide", - "repo": "devshell", - "rev": "2aa26972b951bc05c3632d4e5ae683cb6771a7c6", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "devshell", - "type": "github" - } - }, - "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-utils": { - "inputs": { - "systems": "systems_2" - }, - "locked": { - "lastModified": 1692799911, - "narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -55,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1677383253, - "narHash": "sha256-UfpzWfSxkfXHnb4boXZNaKsAcUrZT9Hw+tao1oZxd08=", + "lastModified": 1711681563, + "narHash": "sha256-rY/L4ZpFZRJDVoUsOqtpk3/8A8/l3RjYgMXmQc3uw3w=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9952d6bc395f5841262b006fbace8dd7e143b634", + "rev": "9b09bde6e3fc9493b6a8b2a5702ac87c66505c64", "type": "github" }, "original": { @@ -69,26 +34,10 @@ "type": "github" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1693563790, - "narHash": "sha256-qUx+8lQSCiPXbwWBwRHynHuhQT+6I7kEuDFFNQ6RSPU=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "fd8ad63083882605e8a7f659be6c9509e6e28d28", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, "root": { "inputs": { - "devshell": "devshell", - "flake-compat": "flake-compat", "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs" } }, "systems": { @@ -105,21 +54,6 @@ "repo": "default", "type": "github" } - }, - "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 31bc13f..23dc9bd 100644 --- a/flake.nix +++ b/flake.nix @@ -1,26 +1,22 @@ { - description = "virtual environments"; - - inputs.devshell.url = "github:numtide/devshell"; + description = "Hugo website"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; inputs.flake-utils.url = "github:numtide/flake-utils"; - inputs.flake-compat = { - url = "github:edolstra/flake-compat"; - flake = false; - }; - - outputs = { self, flake-utils, devshell, nixpkgs, ... }: - flake-utils.lib.eachDefaultSystem (system: { - devShells.default = - let - pkgs = import nixpkgs { - inherit system; - - overlays = [ devshell.overlays.default ]; - }; - in - pkgs.devshell.mkShell { - imports = [ (pkgs.devshell.importTOML ./devshell.toml) ]; + outputs = + { nixpkgs, flake-utils, ... }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + devShells.default = pkgs.mkShell { + packages = [ + pkgs.go + pkgs.hugo + ]; }; - }); + } + ); } diff --git a/shell.nix b/shell.nix deleted file mode 100644 index 597b64b..0000000 --- a/shell.nix +++ /dev/null @@ -1,23 +0,0 @@ -# Use `builtins.getFlake` if available -if builtins ? getFlake -then - let - scheme = - if builtins.pathExists ./.git - then "git+file" - else "path"; - in - (builtins.getFlake "${scheme}://${toString ./.}").devShells.${builtins.currentSystem}.default - -# Otherwise we'll use the flake-compat shim -else - (import - ( - let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in - fetchTarball { - url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; - sha256 = lock.nodes.flake-compat.locked.narHash; - } - ) - { src = ./.; } - ).shellNix