Skip to content

Commit

Permalink
Add NixOS Support with integrated IDE
Browse files Browse the repository at this point in the history
Used this on [NiXium](https://github.com/NiXium-org/NiXium) to build the EC update, expected to work without issues.

Fixes: hamishcoleman#258
  • Loading branch information
Kreyren committed Aug 8, 2024
1 parent 1047dab commit f17263e
Show file tree
Hide file tree
Showing 15 changed files with 494 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# EditorConfig configuration for this repository -- https://EditorConfig.org

# Top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file, utf-8 charset
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8

# Ignore diffs/patches
[*.{diff,patch}]
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset

# Prefer space-indent for..
[*.{json,lock,md,pl,pm,py,rb,xml}]
indent_style = space

# Prefer tab-indent for..
[*.{nix,sh,bash}]
indent_style = tab

[*.{json,lock,md,nix,rb,sh}]
indent_size = 2

[*.lock]
indent_size = unset

[*.md]
trim_trailing_whitespace = true

# binaries
[*.nib]
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
charset = unset

[eggs.nix]
trim_trailing_whitespace = unset

# You can add file-specific configuration using:
#
# [path/to/file]
# end_of_line = unset
# indent_style = unset
# insert_final_newline = unset
# trim_trailing_whitespace = unset
# other config..
6 changes: 6 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh
# shellcheck shell=sh # POSIX

# This file is used to provide directory-oriented environment variables and integrations

use flake
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.nix @kreyren
/tasks/ @kreyren
.direnv @kreyren
default.code-workspace @kreyren
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ nuvoton-tools/

# Temp are (should be) just junk
*.tmp
.direnv/
128 changes: 128 additions & 0 deletions default.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
{
"folders": [
{ "path": "." },
],

"settings": {
// Enable liguratures
"editor.fontLigatures": true,
"editor.fontFamily": "'Fira Code'",
"terminal.integrated.fontFamily": "'Fira Code'",

"editor.renderWhitespace": "all",
"terminal.integrated.scrollback": 20000,
"nix.enableLanguageServer": true,
"nix.serverPath": "nil",
"nix.serverSettings": {
// settings for 'nil' Language Server
"nil": {
"formatting": {
"command": ["nixpkgs-fmt"]
}
}
},
"bracket-pair-colorizer-2.excludedLanguages": [
"nix" // Does weird and confusing coloring, seems not compatible
],
"editor.wordWrap": "on", // Enforce word-wrapped coding style
"terminal.integrated.defaultProfile.linux": "bash", // Use bash by default
"terminal.integrated.env.linux": {
"EDITOR": "nano", // To open git things in codium
},

// Git
"git.autofetch": true,

// Code-eol
"code-eol.highlightExtraWhitespace": true,
"code-eol.newlineCharacter": "↵",
"code-eol.crlfCharacter": "↓",

// Task tree
"todo-tree.general.tags": [
"FIXME",
"TODO",
"DOCS",
"HACK",
"REVIEW",
"DNM", // Do Not Merge
"DNC", // Do Not Contribute
"DNR" // Do Not Release
],
// NOTE: Icons has to be valid octicon (https://primer.style/foundations/icons/)
"todo-tree.highlights.customHighlight": {
// FIXME(Krey): Test
"FIXME": {
"foreground": "#ff8000",
"icon": "tag",
"fontWeight": "bold"
},
// TODO(Krey): Test
"TODO": {
"foreground": "#00ffea",
"icon": "tasklist",
"fontWeight": "bold"
},
// DOCS(Krey): Test
"DOCS": {
"foreground": "#ffffff",
"background": "#2f00ff",
"icon": "repo",
"fontWeight": "bold"
},
// HACK(Krey): Test
"HACK": {
"foreground": "#ffffff",
"background": "#ff4d00",
"icon": "repo",
"fontWeight": "bold"
},
// REVIEW(Krey): Test
"REVIEW": {
"foreground": "#ffffff",
"background": "#b300ff",
"icon": "code-review",
"fontWeight": "bold"
},
// DNM(Krey): Test
"DNM": {
"background": "#ff0000",
"foreground": "#ffffff",
"icon": "shield-x",
"fontWeight": "bold"
},
// DNR(Krey): Test
"DNR": {
"background": "#ff0000",
"foreground": "#ffffff",
"icon": "shield-x",
"fontWeight": "bold"
},
// DNC(Krey): Test
"DNC": {
"background": "#fffb00",
"foreground": "#000000",
"icon": "shield-x",
"fontWeight": "bold"
}
},
"todo-tree.regex.regex": "($TAGS)((\\-.*|)\\(.*\\)):", // ($TAGS)((\\-.*|)\\(.*\\)):
},

"extensions": {
"recommendations": [
"jnoortheen.nix-ide",
"oderwat.indent-rainbow",
"arrterian.nix-env-selector",
"medo64.render-crlf",
"aaron-bond.better-comments",
"mkhl.direnv",
"coenraads.bracket-pair-colorizer-2",
"editorconfig.editorconfig",
"pkief.material-icon-theme",
"markwylde.vscode-filesize",
"plorefice.devicetree",
"timonwong.shellcheck"
]
}
}
158 changes: 158 additions & 0 deletions flake.lock

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

Loading

0 comments on commit f17263e

Please sign in to comment.