Skip to content

Commit

Permalink
Replaced devenv with nix devshell, added snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitawootten committed Sep 3, 2023
1 parent 8333906 commit 1cf046d
Show file tree
Hide file tree
Showing 12 changed files with 101 additions and 194 deletions.
4 changes: 1 addition & 3 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
source_url "https://raw.githubusercontent.com/cachix/devenv/d1f7b48e35e6dee421cfd0f51481d17f77586997/direnvrc" "sha256-YBzqskFZxmNb3kYVoKD9ZixoPXJh1C9ZvTLGFRkauZ0="

use devenv
use flake
23 changes: 7 additions & 16 deletions .github/workflows/gh-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,13 @@ jobs:
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod

- uses: cachix/install-nix-action@v20
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- uses: cachix/cachix-action@v12
with:
name: devenv

- name: Install devenv.sh
run: nix profile install github:cachix/devenv/latest
shell: sh
- run: devenv ci

- run: devenv shell make build-prod

- uses: actions/checkout@v3
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v4
- name: Setup cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build Site
run: nix develop --command make build-prod
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
# only deploy if on main branch
Expand Down
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,3 @@ public
/resources/_gen/

/layouts/partials/openring.html

# Devenv
.devenv*
devenv.local.nix
.direnv/
36 changes: 36 additions & 0 deletions .vscode/congo.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
// Place your nikitawootten.github.io workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
// "Print to console": {
// "scope": "javascript,typescript",
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
"Alert": {
"scope": "markdown",
"prefix": "_alert",
"body": [
"{{< alert ${1:\"${2|circle-info|}\" }>}}",
"$3",
"{{< /alert >}}"
]
},
"Lead": {
"scope": "markdown",
"prefix": "_lead",
"body": [
"{{< lead >}}",
"$1",
"{{< /lead >}}"
]
}
}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
This repository is meant to house my personal site, but if you see anything that sticks out (embarrassing typos, suggestions, etc) feel free to submit a PR or Issue :)
This repository is meant to house my personal site, but if you see anything that sticks out (embarrassing typos, suggestions, etc) feel free to submit a PR or Issue :)
3 changes: 3 additions & 0 deletions content/posts/makefile-tips/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ draft: false
tags: [makefile, nix, tips]
---

{{< lead >}}
I have a secret: I adore Makefiles.
{{< /lead >}}

I'll admit, the syntax is a bit arcane, and if you don't know what you're doing you can create some really insidious bugs, but once things are set up you can really improve the developer experience on your projects likely without requiring developers to install any [additional tools](https://github.com/casey/just).
In this post I'd like to share some tips I've gathered for making your Makefiles more effective.

Expand Down
156 changes: 0 additions & 156 deletions devenv.lock

This file was deleted.

9 changes: 0 additions & 9 deletions devenv.nix

This file was deleted.

3 changes: 0 additions & 3 deletions devenv.yaml

This file was deleted.

27 changes: 27 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
description = "nikita.computer dev environment";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};

outputs = { self, nixpkgs }: let
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
# forEachSystem [ "x86_64-linux" ] (_: { example = true; }) -> { x86_64-linux.example = true }
forEachSystem = nixpkgs.lib.genAttrs systems;
in {
devShells = forEachSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
default = pkgs.mkShell {
buildInputs = with pkgs; [
hugo
openring
go
];
};
});
};
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/nikitawootten/nikitawootten.github.io
module github.com/nikitawootten/nikita.computer

go 1.19

Expand Down

0 comments on commit 1cf046d

Please sign in to comment.