Merge pull request #110 from DarkKirb/refactor-build

Refactor the build system
This commit is contained in:
Charlotte 🦝 Delenk 2022-12-30 17:17:11 +01:00 committed by GitHub
commit 89af767ec5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 1461 additions and 122 deletions

58
.github/workflows/build-one.yml vendored Normal file
View file

@ -0,0 +1,58 @@
name: Build a system
on:
workflow_call:
inputs:
job:
required: true
type: string
secrets:
NIX_CACHE_KEY:
required: true
AWS_CREDENTIALS:
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Cleanup Disk
uses: curoky/cleanup-disk-action@v2.0
with:
retain: ''
- name: Install Nix
uses: cachix/install-nix-action@v18
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nixcache:8KKuGz95Pk4UJ5W/Ni+pN+v+LDTkMMFV4yrGmAYgkDg= hydra.nixos.org-1:CNHJZBh9K4tP3EKF6FkkgeVYsS3ohTl+oS0Qa8bezVs=
experimental-features = nix-command flakes ca-derivations
post-build-hook = ${{ github.workspace }}/scripts/post-build-hook
substituters = https://cache.chir.rs/ https://cache.nixos.org/
extra-platforms = armv7l-linux aarch64-linux powerpc-linux powerpc64-linux powerpc64le-linux riscv32-linux riscv64-linux wasm32-wasi i686-linux
sandbox = false
- name: Download patched nix
run: nix build github:DarkKirb/nix-packages#nix-s3-dedup
- name: Set up secrets
run: |
echo "$NIX_CACHE_KEY" > ~/cache.key
sudo mkdir /root/.aws
echo "$AWS_CREDENTIALS" | sudo tee /root/.aws/credentials > /dev/null
env:
NIX_CACHE_KEY: ${{secrets.NIX_CACHE_KEY}}
AWS_CREDENTIALS: ${{secrets.AWS_CREDENTIALS}}
- name: Build ${{ inputs.job }}
run: |
DRV_PATH=$(nix-instantiate -E '(import ./.).${{ inputs.job }}')
OUT_PATH=$(nix show-derivation $DRV_PATH | jq -r ".\"$DRV_PATH\".outputs.out.path")
NARINFO=$(echo $OUT_PATH | sed 's|/| |g' | sed 's|-| |g' | awk '{print $3}')
if curl --output /dev/null --silent --fail "https://cache.chir.rs/$NARINFO.narinfo"; then
echo "${{ inputs.job }} already built. Skipping"
else
nix-store -r $DRV_PATH
fi
env:
NIXPKGS_ALLOW_UNFREE: 1

View file

@ -4,49 +4,111 @@ on:
branches:
- main
jobs:
build:
strategy:
matrix:
host:
- nas.x86_64-linux
- nixos-8gb-fsn1-1.x86_64-linux
- nutty-noon.x86_64-linux
- thinkrac.x86_64-linux
- instance-20221213-1915.aarch64-linux
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Cleanup Disk
uses: curoky/cleanup-disk-action@v2.0
with:
retain: ''
- name: Install Nix
uses: cachix/install-nix-action@v18
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nixcache:8KKuGz95Pk4UJ5W/Ni+pN+v+LDTkMMFV4yrGmAYgkDg= hydra.nixos.org-1:CNHJZBh9K4tP3EKF6FkkgeVYsS3ohTl+oS0Qa8bezVs=
experimental-features = nix-command flakes ca-derivations
post-build-hook = ${{ github.workspace }}/scripts/post-build-hook
substituters = https://cache.chir.rs/ https://cache.nixos.org/
extra-platforms = armv7l-linux aarch64-linux powerpc-linux powerpc64-linux powerpc64le-linux riscv32-linux riscv64-linux wasm32-wasi i686-linux
sandbox = false
- name: Download patched nix
run: nix build github:DarkKirb/nix-packages#nix-s3-dedup
- name: Set up secrets
run: |
echo "$NIX_CACHE_KEY" > ~/cache.key
sudo mkdir /root/.aws
echo "$AWS_CREDENTIALS" | sudo tee /root/.aws/credentials > /dev/null
env:
NIX_CACHE_KEY: ${{secrets.NIX_CACHE_KEY}}
AWS_CREDENTIALS: ${{secrets.AWS_CREDENTIALS}}
- name: Build ${{ matrix.host }}
run: |
nix build '.#hydraJobs.${{ matrix.host }}'
env:
NIXPKGS_ALLOW_UNFREE: 1
user-base-x86_64-linux:
uses: ./.github/workflows/build-one.yml
with:
job: homeConfigurations.base-x86_64-linux
secrets: inherit
user-base-aarch64-linux:
uses: ./.github/workflows/build-one.yml
with:
job: homeConfigurations.base-aarch64-linux
secrets: inherit
user-root-x86_64-linux:
needs: user-base-x86_64-linux
uses: ./.github/workflows/build-one.yml
with:
job: homeConfigurations.root-x86_64-linux
secrets: inherit
user-root-aarch64-linux:
needs: user-base-aarch64-linux
uses: ./.github/workflows/build-one.yml
with:
job: homeConfigurations.root-aarch64-linux
secrets: inherit
user-darkkirb-x86_64-linux:
needs: user-base-x86_64-linux
uses: ./.github/workflows/build-one.yml
with:
job: homeConfigurations.darkkirb-x86_64-linux
secrets: inherit
user-darkkirb-aarch64-linux:
needs: user-base-aarch64-linux
uses: ./.github/workflows/build-one.yml
with:
job: homeConfigurations.darkkirb-aarch64-linux
secrets: inherit
user-miifox-x86_64-linux:
needs: user-base-x86_64-linux
uses: ./.github/workflows/build-one.yml
with:
job: homeConfigurations.miifox-x86_64-linux
secrets: inherit
user-base-desktop-x86_64-linux:
needs: user-base-x86_64-linux
uses: ./.github/workflows/build-one.yml
with:
job: homeConfigurations.base-desktop-x86_64-linux
secrets: inherit
user-darkkirb-desktop-x86_64-linux:
needs: user-base-desktop-x86_64-linux
uses: ./.github/workflows/build-one.yml
with:
job: homeConfigurations.darkkirb-desktop-x86_64-linux
secrets: inherit
base-server-x86_64:
needs:
- user-root-x86_64-linux
- user-darkkirb-x86_64-linux
uses: ./.github/workflows/build-one.yml
with:
job: hydraJobs.server-x86_64.x86_64-linux
secrets: inherit
base-server-aarch64:
needs:
- user-root-aarch64-linux
- user-darkkirb-aarch64-linux
uses: ./.github/workflows/build-one.yml
with:
job: hydraJobs.server-aarch64.aarch64-linux
secrets: inherit
base-desktop-x86_64:
needs:
- user-root-x86_64-linux
- user-darkkirb-desktop-x86_64-linux
uses: ./.github/workflows/build-one.yml
with:
job: hydraJobs.desktop-x86_64.x86_64-linux
secrets: inherit
nas:
needs: base-server-x86_64
uses: ./.github/workflows/build-one.yml
with:
job: hydraJobs.nas.x86_64-linux
secrets: inherit
nixos-8gb-fsn1-1:
needs:
- base-server-x86_64
- user-miifox-x86_64-linux
uses: ./.github/workflows/build-one.yml
with:
job: hydraJobs.nixos-8gb-fsn1-1.x86_64-linux
secrets: inherit
nutty-noon:
needs: base-desktop-x86_64
uses: ./.github/workflows/build-one.yml
with:
job: hydraJobs.nutty-noon.x86_64-linux
secrets: inherit
thinkrac:
needs: base-desktop-x86_64
uses: ./.github/workflows/build-one.yml
with:
job: hydraJobs.thinkrac.x86_64-linux
secrets: inherit
instance-20221213-1915:
needs: base-server-aarch64
uses: ./.github/workflows/build-one.yml
with:
job: hydraJobs.instance-20221213-1915.aarch64-linux
secrets: inherit

View file

@ -0,0 +1,15 @@
{
imports = [
./desktop.nix
./systemd-boot.nix
];
fileSystems."/" = {
device = "tank/local/root";
fsType = "zfs";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/6557-C4A0";
fsType = "vfat";
};
}

View file

@ -0,0 +1,15 @@
{
imports = [
./server.nix
./systemd-boot.nix
];
fileSystems."/" = {
device = "tank/local/root";
fsType = "zfs";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/6557-C4A0";
fsType = "vfat";
};
}

View file

@ -1,6 +1,7 @@
{
config,
pkgs,
lib,
...
}: {
imports = [
@ -74,4 +75,9 @@
path = "/root/.aws/credentials";
};
networking.nameservers = ["fd0d:a262:1fa6:e621:b4e1:08ff:e658:6f49" "fd0d:a262:1fa6:e621:746d:4523:5c04:1453"];
# Archetype configuration
networking.hostName = lib.mkDefault "nixos";
networking.hostId = lib.mkDefault "00000000";
networking.wireguard.interfaces."wg0".ips = lib.mkDefault ["fd0d:a262:1fa6:e621::/64"];
}

View file

@ -1,4 +1,4 @@
{system, ...} @ args: {pkgs, ...}: {
args: {pkgs, ...}: {
imports = [
(import ./grapejuice.nix args)
];

View file

@ -1,4 +1,4 @@
{system, ...} @ args: {
args: {
lib,
config,
pkgs,

View file

@ -11,6 +11,7 @@
"fd0d:a262:1fa6:e621:6ec2:1e4e:ce7f:d2af/64"
];
boot.supportedFilesystems = ["zfs"];
networking.hostId = "8425e349";
# Oldest system I have is skylake-based
/*
nixpkgs.localSystem = {

View file

@ -3,7 +3,6 @@
lib,
...
}: {
home.packages = [pkgs.vscode];
home.activation.vscode-server = lib.hm.dag.entryAfter ["write-boundary"] ''
if test -f ~/.vscode-server; then
if test -f "~/.vscode/extensions"; then
@ -20,4 +19,332 @@
fi
fi
'';
programs.vscode = {
enable = true;
enableUpdateCheck = false;
userSettings = {
"workbench.iconTheme" = "material-icon-theme";
"cmake.configureOnOpen" = true;
"[c]" = {
"editor.defaultFormatter" = "xaver.clang-format";
};
"[cpp]" = {
"editor.defaultFormatter" = "xaver.clang-format";
};
"editor.suggestSelection" = "first";
"vsintellicode.modify.editor.suggestSelection" = "automaticallyOverrodeDefaultValue";
"[rust]" = {
"editor.defaultFormatter" = "statiolake.vscode-rustfmt";
};
"git.enableSmartCommit" = true;
"workbench.editorAssociations" = {
"*.ipynb" = "jupyter.notebook.ipynb";
};
"editor.inlineSuggest.enabled" = true;
"files.exclude" = {
"**/.classpath" = true;
"**/.project" = true;
"**/.settings" = true;
"**/.factorypath" = true;
};
"latex-workshop.view.pdf.viewer" = "tab";
"latex-workshop.latex.tools" = [
{
"name" = "latexmk";
"command" = "${pkgs.texlive.combined.scheme-medium}/bin/latexmk";
"args" = [
"-synctex=1"
"-interaction=nonstopmode"
"-file-line-error"
"-xelatex"
"-shell-escape"
"-outdir=%OUTDIR%"
"%DOC%"
];
"env" = {};
}
{
"name" = "lualatexmk";
"command" = "${pkgs.texlive.combined.scheme-medium}/bin/latexmk";
"args" = [
"-synctex=1"
"-interaction=nonstopmode"
"-file-line-error"
"-lualatex"
"-outdir=%OUTDIR%"
"%DOC%"
];
"env" = {};
}
{
"name" = "latexmk_rconly";
"command" = "${pkgs.texlive.combined.scheme-medium}/bin/latexmk";
"args" = ["%DOC%"];
"env" = {};
}
{
"name" = "pdflatex";
"command" = "${pkgs.texlive.combined.scheme-medium}/bin/pdflatex";
"args" = [
"-synctex=1"
"-interaction=nonstopmode"
"-file-line-error"
"%DOC%"
];
"env" = {};
}
{
"name" = "bibtex";
"command" = "${pkgs.texlive.combined.scheme-medium}/bin/bibtex";
"args" = ["%DOCFILE%"];
"env" = {};
}
];
"security.workspace.trust.untrustedFiles" = "open";
"latex-workshop.message.update.show" = false;
"editor.codeLensFontFamily" = "\"FiraCode Nerd Font Mono\", \"Noto Sans Mono CJK JP\", monospace";
"editor.fontFamily" = "\"FiraCode Nerd Font Mono\", \"Noto Sans Mono CJK JP\", monospace";
"rust-analyzer.checkOnSave.command" = "clippy";
"ledger.binary" = "${pkgs.hledger}/bin/hledger";
"workbench.colorTheme" = "Gruvbox Dark Hard";
"rust-analyzer.hoverActions.references" = true;
"rust-analyzer.lens.methodReferences" = true;
"rust-analyzer.workspace.symbol.search.scope" = "workspace_and_dependencies";
"rust-analyzer.workspace.symbol.search.kind" = "all_symbols";
"rust-analyzer.lens.references" = true;
"rust-analyzer.lens.enumVariantReferences" = true;
"editor.bracketPairColorization.enabled" = true;
"C_Cpp.experimentalFeatures" = "Enabled";
"C_Cpp.dimInactiveRegions" = false;
"git.confirmSync" = false;
"files.watcherExclude" = {
"**/.bloop" = true;
"**/.metals" = true;
"**/.ammonite" = true;
};
"editor.formatOnSave" = true;
"rust-analyzer.checkOnSave.extraArgs" = [
"--"
"-Wabsolute_paths_not_starting_with_crate"
"-Welided_lifetimes_in_paths"
"-Wexplicit_outlives_requirements"
"-Wkeyword_idents"
"-Wmacro_use_extern_crate"
"-Wmeta_variable_misuse"
"-Wmissing_abi"
"-Wmissing_copy_implementations"
"-Wmissing_debug_implementations"
"-Wmissing_docs"
"-Wnon_ascii_idents"
"-Wnoop_method_call"
"-Wpointer_structural_match"
"-Wsingle_use_lifetimes"
"-Wtrivial_casts"
"-Wtrivial_numeric_casts"
"-Wunreachable_pub"
"-Wunused_extern_crates"
"-Wunused_import_braces"
"-Wunused_lifetimes"
"-Wunused_qualifications"
"-Wvariant_size_differences"
"-Wclippy::pedantic"
"-Wclippy::nursery"
"-Wclippy::all"
];
"github.copilot.enable" = {
"*" = true;
"yaml" = true;
"plaintext" = true;
"markdown" = true;
};
"rust-analyzer.cargo.allFeatures" = true;
"rust-analyzer.cargo.unsetTest" = [];
"redhat.telemetry.enabled" = false;
"openapi.approvedHostnames" = ["raw.githubusercontent.com"];
"liveServer.settings.donotShowInfoMsg" = true;
"[typescript]" = {
"editor.defaultFormatter" = "vscode.typescript-language-features";
};
"[javascript]" = {
"editor.defaultFormatter" = "vscode.typescript-language-features";
};
"go.toolsManagement.autoUpdate" = true;
"nix.serverPath" = "${pkgs.rnix-lsp}/bin/rnix-lsp";
"python.analysis.typeCheckingMode" = "strict";
"tabnine.experimentalAutoImports" = true;
"editor.autoClosingBrackets" = "always";
"editor.autoClosingDelete" = "always";
"editor.autoClosingOvertype" = "always";
"editor.autoClosingQuotes" = "always";
"editor.definitionLinkOpensInPeek" = true;
"editor.experimental.pasteActions.enabled" = true;
"editor.foldingImportsByDefault" = true;
"editor.linkedEditing" = true;
"editor.renderWhitespace" = "boundary";
"editor.rulers" = [72 80 100 120];
"editor.smoothScrolling" = true;
"editor.stickyTabStops" = true;
"editor.stickyScroll.enabled" = true;
"editor.tabCompletion" = "on";
"editor.unicodeHighlight.ambiguousCharacters" = false;
"editor.wordWrapColumn" = 120;
"editor.cursorSmoothCaretAnimation" = true;
"editor.cursorSurroundingLines" = 5;
"editor.find.autoFindInSelection" = "multiline";
"editor.fontLigatures" = true;
"editor.formatOnPaste" = true;
"editor.formatOnType" = true;
"diffEditor.codeLens" = true;
"diffEditor.diffAlgorithm" = "experimental";
"editor.minimap.renderCharacters" = false;
"editor.suggest.preview" = true;
"editor.suggest.shareSuggestSelections" = true;
"files.enableTrash" = false;
"files.eol" = "\n";
"files.insertFinalNewline" = true;
"files.trimFinalNewlines" = true;
"files.trimTrailingWhitespace" = true;
"workbench.experimental.editSessions.partialMatches.enabled" = true;
"workbench.experimental.settingsProfiles.enabled" = true;
"workbench.list.smoothScrolling" = true;
"workbench.startupEditor" = "none";
"workbench.editor.closeOnFileDelete" = true;
"explorer.excludeGitIgnore" = true;
"explorer.fileNesting.enabled" = true;
"explorer.fileNesting.patterns" = {
"Cargo.toml" = "Cargo.*";
"flake.nix" = "flake.lock";
"*.ts" = "\${capture}.js, \${capture}.d.ts";
"*.js" = "\${capture}.js.map, \${capture}.min.js, \${capture}.d.ts";
"*.jsx" = "\${capture}.js";
"*.tsx" = "\${capture}.ts";
"tsconfig.json" = "tsconfig.*.json";
"package.json" = "package-lock.json, .npmrc, yarn.lock, .yarnrc";
};
"search.quickOpen.includeSymbols" = true;
"search.smartCase" = true;
"search.showLineNumbers" = true;
"search.seedOnFocus" = true;
"search.seedWithNearestWord" = true;
"search.useGlobalIgnoreFiles" = true;
"search.useParentIgnoreFiles" = true;
"debug.allowBreakpointsEverywhere" = true;
"debug.autoExpandLazyVariables" = true;
"testing.alwaysRevealTestOnStateChange" = true;
"scm.alwaysShowActions" = true;
"scm.alwaysShowRepositories" = true;
"telemetry.telemetryLevel" = "off";
"better-comments.highlightPlainText" = true;
"C_Cpp.inlayHints.autoDeclarationTypes.enabled" = true;
"C_Cpp.inlayHints.autoDeclarationTypes.showOnLeft" = true;
"C_Cpp.inlayHints.parameterNames.enabled" = true;
"C_Cpp.inlayHints.referenceOperator.enabled" = true;
"C_Cpp.inlayHints.referenceOperator.showSpace" = true;
"csharp.inlayHints.parameters.enabled" = true;
"csharp.inlayHints.parameters.forIndexerParameters" = true;
"csharp.inlayHints.parameters.forLiteralParameters" = true;
"csharp.inlayHints.parameters.forObjectCreationParameters" = true;
"csharp.inlayHints.parameters.forOtherParameters" = true;
"csharp.inlayHints.parameters.suppressForParametersThatDifferOnlyBySuffix" = true;
"csharp.inlayHints.parameters.suppressForParametersThatMatchArgumentName" = true;
"csharp.inlayHints.parameters.suppressForParametersThatMatchMethodIntent" = true;
"csharp.inlayHints.types.enabled" = true;
"csharp.inlayHints.types.forImplicitObjectCreation" = true;
"csharp.inlayHints.types.forImplicitVariableTypes" = true;
"csharp.inlayHints.types.forLambdaParameterTypes" = true;
"cSpell.language" = "en,en-GB";
"conventionalCommits.emojiFormat" = "emoji";
"conventionalCommits.showEditor" = true;
"git.allowForcePush" = true;
"git.autofetch" = "all";
"git.autofetchPeriod" = 60;
"github.gitProtocol" = "ssh";
"gitlens.showWelcomeOnInstall" = false;
"gitlens.defaultGravatarsStyle" = "monsterid";
"vsintellicode.features.python.deepLearning" = "enabled";
"merge-conflict.autoNavigateNextConflict.enabled" = true;
"projectManager.git.baseFolders" = ["/home/darkkirb/sources"];
"projectManager.hg.maxDepthRecursion" = 1;
"rust-analyzer.assist.emitMustUse" = true;
"rust-analyzer.diagnostics.experimental.enable" = true;
"rust-analyzer.lens.references.enumVariant.enable" = true;
"rust-analyzer.lens.references.method.enable" = true;
"rust-analyzer.lens.references.trait.enable" = true;
"rust-analyzer.lens.references.adt.enable" = true;
"editor.accessibilitySupport" = "off";
"[jsonc]" = {
"editor.defaultFormatter" = "esbenp.prettier-vscode";
};
"nix.formatterPath" = "${pkgs.alejandra}/bin/alejandra";
"nix.enableLanguageServer" = true;
};
extensions = with pkgs.vscode-extensions;
[
alefragnani.bookmarks
alefragnani.project-manager
alexdima.copy-relative-path
bbenoist.nix
bierner.markdown-checkbox
bierner.markdown-emoji
bierner.markdown-mermaid
bradlc.vscode-tailwindcss
bungcip.better-toml
christian-kohler.path-intellisense
codezombiech.gitignore
davidanson.vscode-markdownlint
dhall.dhall-lang
dhall.vscode-dhall-lsp-server
donjayamanne.githistory
dotjoshjohnson.xml
eamodio.gitlens
editorconfig.editorconfig
esbenp.prettier-vscode
firefox-devtools.vscode-firefox-debug
formulahendry.auto-rename-tag
github.vscode-pull-request-github
golang.go
haskell.haskell
jdinhlife.gruvbox
jnoortheen.nix-ide
justusadam.language-haskell
mkhl.direnv
ms-azuretools.vscode-docker
ms-dotnettools.csharp
ms-python.python
ms-python.vscode-pylance
ms-toolsai.jupyter
ms-toolsai.jupyter-keymap
ms-toolsai.jupyter-renderers
ms-vscode-remote.remote-ssh
ms-vscode.cmake-tools
ms-vscode.cpptools
ms-vscode.makefile-tools
ms-vsliveshare.vsliveshare
oderwat.indent-rainbow
pkief.material-icon-theme
pkief.material-product-icons
redhat.java
redhat.vscode-xml
redhat.vscode-yaml
ritwickdey.liveserver
rust-lang.rust-analyzer
ryu1kn.partial-diff
scala-lang.scala
scalameta.metals
serayuzgur.crates
streetsidesoftware.code-spell-checker
tabnine.tabnine-vscode
tamasfe.even-better-toml
twxs.cmake
tyriar.sort-lines
vadimcn.vscode-lldb
vscjava.vscode-java-debug
vscjava.vscode-java-dependency
vscjava.vscode-java-test
vscjava.vscode-maven
xaver.clang-format
yzhang.markdown-all-in-one
]
++ pkgs.vscode-utils.extensionsFromVscodeMarketplace (import ./extensions.nix).extensions;
};
}

View file

@ -0,0 +1,538 @@
{
extensions = [
{
name = "vscode-openapi";
publisher = "42Crunch";
version = "4.15.10";
sha256 = "1r54hgjd9shw4qi6nvsnrlmvrjvpl2y8q1rqxciqcwzbahjp0ym9";
}
{
name = "better-comments";
publisher = "aaron-bond";
version = "3.0.2";
sha256 = "15w1ixvp6vn9ng6mmcmv9ch0ngx8m85i1yabxdfn6zx3ypq802c5";
}
{
name = "gemini";
publisher = "aaronduino";
version = "1.0.1";
sha256 = "0cjfh7v12h4ynaxdvxbqiqccr2xzwa4srfz3zn8dsxfqifb6zby2";
}
{
name = "namespace";
publisher = "adrianwilczynski";
version = "1.1.2";
sha256 = "11wdk9mg8q9qj2q1q44z2agwlnv3p7vg9g35jbkp5fakv37bxbfl";
}
{
name = "shaderlabvscodefree";
publisher = "amlovey";
version = "1.3.3";
sha256 = "00c1nr3n9280bf2kzd5zcamsnmy25p76fjn45qy4rzmw38mvh2y0";
}
{
name = "meson";
publisher = "asabil";
version = "1.3.0";
sha256 = "1q35rzn7l7n2rzm3yvgdhs0yxgz9aqlrgr0clswwps3i85s7gjj0";
}
{
name = "github-markdown-preview";
publisher = "bierner";
version = "0.3.0";
sha256 = "124vsg5jxa90j3mssxi18nb3wn6fji6b0mnnkasa89rgx3jfb5pf";
}
{
name = "markdown-footnotes";
publisher = "bierner";
version = "0.1.1";
sha256 = "1pp64x8cn4vmpscmzv2dg6bakjhnwd36rms2wl6bs5laq29k5wl7";
}
{
name = "markdown-preview-github-styles";
publisher = "bierner";
version = "1.0.1";
sha256 = "1bjx46v17d18c9bplz70dx6fpsc6pr371ihpawhlr1y61b59n5aj";
}
{
name = "markdown-yaml-preamble";
publisher = "bierner";
version = "0.1.0";
sha256 = "1xlb6dvrsy2sp92lax1nq01xcrax1nm256ns9b4vvkq7p4njpqp5";
}
{
name = "pioasm";
publisher = "chris-hock";
version = "1.0.0";
sha256 = "09p7cbk7hnhl9q4viscfy45fq1gv16xf0dm97s8hfpcz2w6fmw1q";
}
{
name = "vscode-modelines";
publisher = "chrislajoie";
version = "2.0.5";
sha256 = "0lp32y43gl18bvnviqa5nxh3niz66l01aj1kiz65zcc0gm3vs8nd";
}
{
name = "doxdocgen";
publisher = "cschlosser";
version = "1.4.0";
sha256 = "1d95znf2vsdzv9jqiigh9zm62dp4m9jz3qcfaxn0n0pvalbiyw92";
}
{
name = "git-extension-pack";
publisher = "donjayamanne";
version = "0.1.3";
sha256 = "0j4mq15msbr191az0fyv0q4dbcrsacv4ydim2920p4cml9cqgnw3";
}
{
name = "unity-dev-pack";
publisher = "fabriciohod";
version = "2.5.0";
sha256 = "0k92xkdha29kszv7dwbqk7iw8bx81mhllbjs5wzwql1ij1b96mkn";
}
{
name = "git-project-manager";
publisher = "felipecaputo";
version = "1.8.2";
sha256 = "02d0hdqyd9pnad986ymjdgdma3g97mzrx6pa9fi8cn0pzkaxp6qz";
}
{
name = "vscode-solution-explorer";
publisher = "fernandoescolar";
version = "0.7.4";
sha256 = "1lb1jsday61p4ha7x1fsks51am5n1ycd467bl9nbjlp0khic42mr";
}
{
name = "android-system-tools";
publisher = "flimberger";
version = "0.0.2";
sha256 = "0f1qbcxkcdrk8j639ps4wv21y6i24g0inm7hzac5zz69syzcr07l";
}
{
name = "auto-using";
publisher = "Fudge";
version = "0.7.15";
sha256 = "1vjf55vk2bc921hvpifd4c2aplp7wmqsp5aiq00q3jxpxqwsarim";
}
{
name = "kotlin";
publisher = "fwcd";
version = "0.2.26";
sha256 = "1br0vr4v1xcl4c7bcqwzfqd4xr6q2ajwkipqrwm928mj96dkafkn";
}
{
name = "vscode-javac";
publisher = "georgewfraser";
version = "0.2.45";
sha256 = "0yca4jjl05qw08lnfvfg3r1sazpd2byfwmngak8824l58lf22h1m";
}
{
name = "vscode-test-explorer";
publisher = "hbenl";
version = "2.21.1";
sha256 = "022lnkq278ic0h9ggpqcwb3x3ivpcqjimhgirixznq0zvwyrwz3w";
}
{
name = "discord-vscode";
publisher = "icrawl";
version = "5.8.0";
sha256 = "0r9n2g5rif4y2619wccjqh3pn9rljb3yhblz09pdksmfi2ifakr1";
}
{
name = "llvm-tablegen";
publisher = "jakob-erzar";
version = "0.0.2";
sha256 = "12fdq1wv3459hz3w300x2w1dq5wphcsmh3dgf233qabr76vr1kav";
}
{
name = "vscode-edit-csv";
publisher = "janisdd";
version = "0.7.2";
sha256 = "1jakwqbb62xvydqfvdqc77dxq77j23nwi1rr6wpw9kdrkwx0q5qh";
}
{
name = "hoogle-vscode";
publisher = "jcanero";
version = "0.0.7";
sha256 = "0ndapfrv3j82792hws7b3zki76m2s1bfh9dss1xjgcal1aqajka1";
}
{
name = "better-cpp-syntax";
publisher = "jeff-hykin";
version = "1.17.2";
sha256 = "1ic55cva028368j0sdcqdzjq2ikbz754m7bxibxf7djvs6xqlx57";
}
{
name = "vscode-csharp-snippets";
publisher = "jorgeserrano";
version = "1.1.0";
sha256 = "1wsrbana07bcy6jslk8mpxzx53b9mnf4f8g9srwfkcbqhw2p322x";
}
{
name = "65816-assembly";
publisher = "joshneta";
version = "0.0.5";
sha256 = "052kd73vif62q3f3vc574975axxdyasx21xjcfjmpmsplnyrafci";
}
{
name = "rust-doc-viewer";
publisher = "JScearcy";
version = "3.0.4";
sha256 = "0yrf0ak3fylcg7pgxp18d7p0ln0mm1bkcc341y7fiaj7v3gdvgyz";
}
{
name = "package-plus-plus";
publisher = "juninhosilva";
version = "0.0.1";
sha256 = "13f69h7iak5py3nxbc3m6bk1hx6aad7gg0ra3ncy085qjnafbbq0";
}
{
name = "docomment";
publisher = "k--kato";
version = "0.1.31";
sha256 = "0hgykx8q4w6hif7i0pf54hkkzmiylrbmcz231biipgsv3hclnk9r";
}
{
name = "tera";
publisher = "karunamurti";
version = "0.0.9";
sha256 = "1pykbdfvbhdj1kj7l3s8ri88v24m96x4c848qacz1zizg1jsbgbv";
}
{
name = "unity-code-snippets";
publisher = "kleber-swf";
version = "1.3.0";
sha256 = "1nllkgk8vc1ckdzyc48bzcbsn8435am1y6kq0bs6pl7ihpl9lb4s";
}
{
name = "ledger";
publisher = "mariosangiorgio";
version = "1.0.9";
sha256 = "1lyhldyl4f1c2hxqwn6arma8p1snm2cbrdr1vybxllrh570lcgz9";
}
{
name = "vscode-elixir";
publisher = "mjmcloug";
version = "1.1.0";
sha256 = "0kj7wlhapkkikn1md8cknrffrimk0g0dbbhavasys6k3k7pk2khh";
}
{
name = "isort";
publisher = "ms-python";
version = "2022.9.13271012";
sha256 = "1iq893jx75lqx9fc3066x4qkyb3shaiqz8d3qryn8qgsf9rxwkpk";
}
{
name = "vscode-jupyter-cell-tags";
publisher = "ms-toolsai";
version = "0.1.6";
sha256 = "1sb3za0ka8bl1kydlniwlaixldlgqxvfbx7pcyrg1a4sg6zwsvk1";
}
{
name = "vscode-jupyter-slideshow";
publisher = "ms-toolsai";
version = "0.1.5";
sha256 = "1p6r5vkzvwvxif3wxqi9599vplabzig27fzzz0bx9z0awfglzyi7";
}
{
name = "remote-containers";
publisher = "ms-vscode-remote";
version = "0.268.0";
sha256 = "0sp47jpdv09bmglm1yxd1l1q6fzdsdz3bl1flxwdd9x84b4h66cz";
}
{
name = "remote-ssh-edit";
publisher = "ms-vscode-remote";
version = "0.84.0";
sha256 = "0rw2klz1f4sy1xzwg4bilcm2sjk0lxdfh9ly3f4kbl8a5xccfy6z";
}
{
name = "remote-wsl";
publisher = "ms-vscode-remote";
version = "0.72.0";
sha256 = "1c398n04g6qrlvdmnbh50nrs912668fvwm5lrq55xssfba2h8ny1";
}
{
name = "cpptools-extension-pack";
publisher = "ms-vscode";
version = "1.3.0";
sha256 = "11fk26siccnfxhbb92z6r20mfbl9b3hhp5zsvpn2jmh24vn96x5c";
}
{
name = "cpptools-themes";
publisher = "ms-vscode";
version = "2.0.0";
sha256 = "05r7hfphhlns2i7zdplzrad2224vdkgzb0dbxg40nwiyq193jq31";
}
{
name = "remote-explorer";
publisher = "ms-vscode";
version = "0.1.2022121209";
sha256 = "13fhlzn0jfc6cbabhsprf39qlfcwsiqsa0svvr390gpigzdk38h7";
}
{
name = "test-adapter-converter";
publisher = "ms-vscode";
version = "0.1.6";
sha256 = "0pj4ln8g8dzri766h9grdvhknz2mdzwv0lmzkpy7l9w9xx8jsbsh";
}
{
name = "vscode-typescript-tslint-plugin";
publisher = "ms-vscode";
version = "1.3.4";
sha256 = "0zbg99x71scpgdyicp7fryxmg51fj2fy0dmfm04zq26s0g0n6gn1";
}
{
name = "vsliveshare-audio";
publisher = "ms-vsliveshare";
version = "0.1.91";
sha256 = "0p00bgn2wmzy9c615h3l3is6yf5cka84il5331z0rkfv2lzh6r7n";
}
{
name = "vsliveshare-pack";
publisher = "ms-vsliveshare";
version = "0.4.0";
sha256 = "09h2yxpmbvxa3mz5wdnpb35h437f0z6j0n3blsb0d93jlwx5ydy5";
}
{
name = "veriloghdl";
publisher = "mshr-h";
version = "1.5.13";
sha256 = "083xd3l8v352hk8cv807dl8rw4shzi6d5d8dyl402l325mgydgy6";
}
{
name = "sqltools";
publisher = "mtxr";
version = "0.26.0";
sha256 = "1ap6v4xg659dcvjmwzds92k9f801labvcrh2z33rklk980yz9hs4";
}
{
name = "gradle-language";
publisher = "naco-siren";
version = "0.2.3";
sha256 = "15lzxvym0mkljjn57av1p4z6hqqwbsbn5idw2fn7nccgrl93aywf";
}
{
name = "clang-tidy";
publisher = "notskm";
version = "0.5.1";
sha256 = "0z44hbrbzlhxbzf1j55xpl5fb7gic9avvcz4dvljrwz4qqdjzq4x";
}
{
name = "ide-purescript";
publisher = "nwolverson";
version = "0.26.1";
sha256 = "1ig8z5k6gkdvxqfc0plf3dwvhz3qawydjmrln5bgsacr6jhfxi3i";
}
{
name = "language-purescript";
publisher = "nwolverson";
version = "0.2.8";
sha256 = "1nhzvjwxld53mlaflf8idyjj18r1dzdys9ygy86095g7gc4b1qys";
}
{
name = "cargo";
publisher = "panicbit";
version = "0.2.3";
sha256 = "0idcbri4kpva0yxni0ql6l14knc3h6izxza5d49jidrh9xj0njh7";
}
{
name = "explorer-exclude";
publisher = "PeterSchmalfeldt";
version = "1.3.2";
sha256 = "1khvs655dl0gn69azx1hzv9czli1kc7w18dfwirqkdibf1zxvg07";
}
{
name = "unity-toolbox";
publisher = "pixl";
version = "3.0.0";
sha256 = "089glajdvwaskfb9vpm8farl9hn2z4v3xkir7cms3160vq1p2naq";
}
{
name = "polacode";
publisher = "pnp";
version = "0.3.4";
sha256 = "0l9cm4jrjjrgrsqc0n0awi0xbgyk4sp08pddw5bnfnrsxwhs0kmv";
}
{
name = "vscode-unitymeta";
publisher = "PTD";
version = "0.0.7";
sha256 = "1bs82ml8wdg7qab8rqkahap34v4i10jj306rajccfq26ybf4wnw7";
}
{
name = "r";
publisher = "REditorSupport";
version = "2.7.0";
sha256 = "09bq6cq1qszl38pairr3f9xrw1igkimsdagbsc4v54r0qpmmfniq";
}
{
name = "c-sharp-utilities";
publisher = "revrenlove";
version = "1.5.1";
sha256 = "1afvjw0bmh2xlgqgjrjwqjg765r4n4qkmjy2lqc39vp6m16xqv83";
}
{
name = "vscode-gradle-extension-pack";
publisher = "richardwillis";
version = "0.0.4";
sha256 = "138395ahrdzpwh59k09c5a8g3g3dl0b55i6c21bxfxfdar9n4rz7";
}
{
name = "llvm";
publisher = "RReverser";
version = "0.1.1";
sha256 = "0r58hfzxvgmr1xsirkyq2ffdmk3nmwj406d08aiqipr3i7kkrxih";
}
{
name = "signageos-vscode-sops";
publisher = "signageos";
version = "0.7.0";
sha256 = "0zx0zvdi20j58kpcd4wj9c24kbara1kl2blqnvxlzyrm41va87l5";
}
{
name = "shader";
publisher = "slevesque";
version = "1.1.5";
sha256 = "14yraymi96f6lpcrwk93llbiraq8gqzk7jzyw7xmndhcwhazpz9x";
}
{
name = "datapack-language-server";
publisher = "SPGoding";
version = "3.4.0";
sha256 = "04fdkvlhavh2kk64ih2v60dk354zf5qw76s7nwq4vr55626b2n51";
}
{
name = "vscode-rustfmt";
publisher = "statiolake";
version = "0.1.2";
sha256 = "0kprx45j63w1wr776q0cl2q3l7ra5ln8nwy9nnxhzfhillhqpipi";
}
{
name = "ninja";
publisher = "surajbarkale";
version = "0.0.1";
sha256 = "0qaym9p079m6m40s7py3vm3fx8bhi1pna7d84qrmj9s4mx95862d";
}
{
name = "vscode-rust-test-adapter";
publisher = "Swellaby";
version = "0.11.0";
sha256 = "111vhl71zzh4il1kh21l49alwlllzcvmdbsxyvk9bq3r24hxq1r2";
}
{
name = "vscode-asl";
publisher = "Thog";
version = "1.0.0";
sha256 = "0w2mzbp3ny4z9jxp0p9f9nricdw6j605ibzl47wwykbs4533imyl";
}
{
name = "unity-tools";
publisher = "Tobiah";
version = "1.2.12";
sha256 = "1ydxhiir4gadvz0mn783lq0vvsyh8fq8i7i4nfdw2m3dn945pija";
}
{
name = "vscode-status-bar-format-toggle";
publisher = "tombonnike";
version = "3.1.1";
sha256 = "092nlx7kssd67ls00g03z46ss9ib65na4ky0d7x71v29nwfsd74r";
}
{
name = "unity-debug";
publisher = "Unity";
version = "3.0.2";
sha256 = "1fbms5p3kd1j95rq7m5pfm0vqyqh7ak6hc4x95h1ibab3n4ddl18";
}
{
name = "intellicode-api-usage-examples";
publisher = "VisualStudioExptTeam";
version = "0.2.6";
sha256 = "0ngp7iy17v5w1qfy38k4rpraia454nllaajmrhlganyg0kk1lydx";
}
{
name = "vscodeintellicode";
publisher = "VisualStudioExptTeam";
version = "1.2.29";
sha256 = "099vyn3c5x5vrcmvxa35452ic221iw1595grxq5khfl2p5vvwpss";
}
{
name = "vscode-conventional-commits";
publisher = "vivaxy";
version = "1.24.4";
sha256 = "1sblr2v5ccmxc5hmy5pq46k3wxkg7k9nvfhdjjhgs6gf1wkyjbnb";
}
{
name = "vscode-gradle";
publisher = "vscjava";
version = "3.12.2022120100";
sha256 = "14qv4n8csq8ig4h9zmy52fkfxwzml8fjs9lgzg5q7p7bxj9ca9hy";
}
{
name = "vscode-java-pack";
publisher = "vscjava";
version = "0.25.2022112900";
sha256 = "0rgassar7f3xbdq23i5vr69pqi72fmcc61y93wgk5pnxrms1k3qd";
}
{
name = "games-dev-extension-pack";
publisher = "walkme";
version = "1.0.0";
sha256 = "02811c0swh8h266lc617lcbvld75bi8xxsjan5q16080b17rs3z4";
}
{
name = "quokka-vscode";
publisher = "WallabyJs";
version = "1.0.518";
sha256 = "09qbmbwlf18mq3ikfy9s820860mh5hq7y6aplxk77hrz8h8i0j13";
}
{
name = "vscode-todo-highlight";
publisher = "wayou";
version = "1.0.5";
sha256 = "1sg4zbr1jgj9adsj3rik5flcn6cbr4k2pzxi446rfzbzvcqns189";
}
{
name = "change-case";
publisher = "wmaurer";
version = "1.0.0";
sha256 = "0dxsdahyivx1ghxs6l9b93filfm8vl5q2sa4g21fiklgdnaf7pxl";
}
{
name = "rust-extension-pack";
publisher = "wolfulus";
version = "0.1.1";
sha256 = "1w721nilbp97slb9547y7iqknja4hgq2221zh8fp1w7pnywjv5ga";
}
{
name = "unity-snippets";
publisher = "YclepticStudios";
version = "0.1.2";
sha256 = "0spfr1nkw9ghhi2kgpr9cfhalnbq6h8v4syh1197cbzxbr5dl2fh";
}
{
name = "rust-extension-pack";
publisher = "Zerotaskx";
version = "1.1.0";
sha256 = "15g7bgb56p06xlzz908y11az274892nq8b1sdmx1b2062ybd9w47";
}
{
name = "linkerscript";
publisher = "ZixuanWang";
version = "1.0.2";
sha256 = "0rr5mz8g8myskgixiw76rwda8g955a1al8kk4s30b0byfaszia17";
}
{
name = "vscode-open-in-github";
publisher = "ziyasal";
version = "1.3.6";
sha256 = "156gaj7gcm0588hmwkigkmidf0jxnrq2kvaigf3kszisz05854dq";
}
{
name = "vscode-proto3";
publisher = "zxh404";
version = "0.5.5";
sha256 = "08gjq2ww7pjr3ck9pyp5kdr0q6hxxjy3gg87aklplbc9bkfb0vqj";
}
];
}

View file

@ -1,75 +1,9 @@
{
self,
system,
nixpkgs,
nixpkgs-noto-variable,
nix-packages,
hydra,
...
}:
with nixpkgs.legacyPackages.${system}; let
noto-variable = import nixpkgs-noto-variable {inherit system;};
in {
}: {
nixpkgs.overlays = [
(self: prev:
{
hydra-unstable = hydra.packages.${system}.hydra.overrideAttrs (_: {
checkPhase = "true";
installCheckPhase = "true";
});
mosh = prev.mosh.overrideAttrs (old: {
patches = [
./mosh/ssh_path.patch
./mosh/mosh-client_path.patch
./mosh/utempter_path.patch
./mosh/bash_completion_datadir.patch
];
postPatch = ''
substituteInPlace scripts/mosh.pl \
--subst-var-by ssh "${openssh}/bin/ssh" \
--subst-var-by mosh-client "$out/bin/mosh-client"
'';
version = "2022-02-04";
src = prev.fetchFromGitHub {
owner = "mobile-shell";
repo = "mosh";
rev = "dbe419d0e069df3fedc212d456449f64d0280c76";
sha256 = "09mvk9zxclkf4wrkkfzg0p2hx1f74gpymr0a0l3pckmk6za2n3d1";
};
});
inherit (noto-variable) noto-fonts-cjk;
nix = nix-packages.packages.${system}.nix-s3-dedup.overrideAttrs (old: rec {
postPatchPhase = ''
sed 's/getBoolAttr."allowSubstitutes", true./true/' src/libstore/parsed-derivations.cc
'';
checkPhase = "true";
installCheckPhase = "true";
});
rnix-lsp = with prev;
rustPlatform.buildRustPackage rec {
pname = "rnix-lsp";
version = "0.3.0-alejandra";
src = fetchFromGitHub {
owner = "nix-community";
repo = "rnix-lsp";
# https://github.com/nix-community/rnix-lsp/pull/89
rev = "9189b50b34285b2a9de36a439f6c990fd283c9c7";
sha256 = "sha256-ZnUtvwkcz7QlAiqQxhI4qVUhtVR+thLhG3wQlle7oZg=";
};
cargoSha256 = "sha256-VhE+DspQ0IZKf7rNkERA/gD7iMzjW4TnRSnYy1gdV0s=";
cargoBuildFlags = ["--no-default-features" "--features" "alejandra"];
checkPhase = "true";
meta = with lib; {
description = "A work-in-progress language server for Nix, with syntax checking and basic completion";
license = licenses.mit;
maintainers = with maintainers; [ma27];
};
};
element-web = prev.callPackage ../../packages/element-web.nix {};
}
// nix-packages.packages.${system})
self.overlays.${system}
];
}

188
default.nix Normal file
View file

@ -0,0 +1,188 @@
# Compatibility function to allow flakes to be used by
# non-flake-enabled Nix versions. Given a source tree containing a
# 'flake.nix' and 'flake.lock' file, it fetches the flake inputs and
# calls the flake's 'outputs' function. It then returns an attrset
# containing 'defaultNix' (to be used in 'default.nix'), 'shellNix'
# (to be used in 'shell.nix').
let
src = ./.;
system = builtins.currentSystem or "unknown-system";
lockFilePath = src + "/flake.lock";
lockFile = builtins.fromJSON (builtins.readFile lockFilePath);
fetchTree =
info:
if info.type == "github" then
{ outPath =
fetchTarball
({ url = "https://api.${info.host or "github.com"}/repos/${info.owner}/${info.repo}/tarball/${info.rev}"; }
// (if info ? narHash then { sha256 = info.narHash; } else {})
);
rev = info.rev;
shortRev = builtins.substring 0 7 info.rev;
lastModified = info.lastModified;
lastModifiedDate = formatSecondsSinceEpoch info.lastModified;
narHash = info.narHash;
}
else if info.type == "git" then
{ outPath =
builtins.fetchGit
({ url = info.url; }
// (if info ? rev then { inherit (info) rev; } else {})
// (if info ? ref then { inherit (info) ref; } else {})
// (if info ? submodules then { inherit (info) submodules; } else {})
);
lastModified = info.lastModified;
lastModifiedDate = formatSecondsSinceEpoch info.lastModified;
narHash = info.narHash;
} // (if info ? rev then {
rev = info.rev;
shortRev = builtins.substring 0 7 info.rev;
} else {
})
else if info.type == "path" then
{ outPath = builtins.path { path = info.path; };
narHash = info.narHash;
}
else if info.type == "tarball" then
{ outPath =
fetchTarball
({ inherit (info) url; }
// (if info ? narHash then { sha256 = info.narHash; } else {})
);
}
else if info.type == "gitlab" then
{ inherit (info) rev narHash lastModified;
outPath =
fetchTarball
({ url = "https://${info.host or "gitlab.com"}/api/v4/projects/${info.owner}%2F${info.repo}/repository/archive.tar.gz?sha=${info.rev}"; }
// (if info ? narHash then { sha256 = info.narHash; } else {})
);
shortRev = builtins.substring 0 7 info.rev;
}
else
# FIXME: add Mercurial, tarball inputs.
throw "flake input has unsupported input type '${info.type}'";
callFlake4 = flakeSrc: locks:
let
flake = import (flakeSrc + "/flake.nix");
inputs = builtins.mapAttrs (n: v:
if v.flake or true
then callFlake4 (fetchTree (v.locked // v.info)) v.inputs
else fetchTree (v.locked // v.info)) locks;
outputs = flakeSrc // (flake.outputs (inputs // {self = outputs;}));
in
assert flake.edition == 201909;
outputs;
callLocklessFlake = flakeSrc:
let
flake = import (flakeSrc + "/flake.nix");
outputs = flakeSrc // (flake.outputs ({ self = outputs; }));
in outputs;
rootSrc = let
# Try to clean the source tree by using fetchGit, if this source
# tree is a valid git repository.
tryFetchGit = src:
if isGit && !isShallow
then
let res = builtins.fetchGit src;
in if res.rev == "0000000000000000000000000000000000000000" then removeAttrs res ["rev" "shortRev"] else res
else { outPath = src; };
# NB git worktrees have a file for .git, so we don't check the type of .git
isGit = builtins.pathExists (src + "/.git");
isShallow = builtins.pathExists (src + "/.git/shallow");
in
{ lastModified = 0; lastModifiedDate = formatSecondsSinceEpoch 0; }
// (if src ? outPath then src else tryFetchGit src);
# Format number of seconds in the Unix epoch as %Y%m%d%H%M%S.
formatSecondsSinceEpoch = t:
let
rem = x: y: x - x / y * y;
days = t / 86400;
secondsInDay = rem t 86400;
hours = secondsInDay / 3600;
minutes = (rem secondsInDay 3600) / 60;
seconds = rem t 60;
# Courtesy of https://stackoverflow.com/a/32158604.
z = days + 719468;
era = (if z >= 0 then z else z - 146096) / 146097;
doe = z - era * 146097;
yoe = (doe - doe / 1460 + doe / 36524 - doe / 146096) / 365;
y = yoe + era * 400;
doy = doe - (365 * yoe + yoe / 4 - yoe / 100);
mp = (5 * doy + 2) / 153;
d = doy - (153 * mp + 2) / 5 + 1;
m = mp + (if mp < 10 then 3 else -9);
y' = y + (if m <= 2 then 1 else 0);
pad = s: if builtins.stringLength s < 2 then "0" + s else s;
in "${toString y'}${pad (toString m)}${pad (toString d)}${pad (toString hours)}${pad (toString minutes)}${pad (toString seconds)}";
allNodes =
builtins.mapAttrs
(key: node:
let
sourceInfo =
if key == lockFile.root
then rootSrc
else fetchTree (node.info or {} // removeAttrs node.locked ["dir"]);
subdir = if key == lockFile.root then "" else node.locked.dir or "";
flake = import (sourceInfo + (if subdir != "" then "/" else "") + subdir + "/flake.nix");
inputs = builtins.mapAttrs
(inputName: inputSpec: allNodes.${resolveInput inputSpec})
(node.inputs or {});
# Resolve a input spec into a node name. An input spec is
# either a node name, or a 'follows' path from the root
# node.
resolveInput = inputSpec:
if builtins.isList inputSpec
then getInputByPath lockFile.root inputSpec
else inputSpec;
# Follow an input path (e.g. ["dwarffs" "nixpkgs"]) from the
# root node, returning the final node.
getInputByPath = nodeName: path:
if path == []
then nodeName
else
getInputByPath
# Since this could be a 'follows' input, call resolveInput.
(resolveInput lockFile.nodes.${nodeName}.inputs.${builtins.head path})
(builtins.tail path);
outputs = flake.outputs (inputs // { self = result; });
result = outputs // sourceInfo // { inherit inputs; inherit outputs; inherit sourceInfo; };
in
if node.flake or true then
assert builtins.isFunction flake.outputs;
result
else
sourceInfo
)
lockFile.nodes;
result =
if !(builtins.pathExists lockFilePath)
then callLocklessFlake rootSrc
else if lockFile.version == 4
then callFlake4 rootSrc (lockFile.inputs)
else if lockFile.version >= 5 && lockFile.version <= 7
then allNodes.${lockFile.root}
else throw "lock file '${lockFilePath}' has unsupported version ${toString lockFile.version}";
in result.outputs

131
flake.nix
View file

@ -94,12 +94,28 @@ rec {
name = "instance-20221213-1915"; # Oracle server
system = "aarch64-linux";
}
{
name = "server-x86_64"; # archetype
system = "x86_64-linux";
configName = "archetype-server";
}
{
name = "server-aarch64"; # archetype
system = "aarch64-linux";
configName = "archetype-server";
}
{
name = "desktop-x86_64"; # archetype
system = "x86_64-linux";
configName = "archetype-desktop";
}
];
in rec {
nixosConfigurations = builtins.listToAttrs (map
({
name,
system,
configName ? name,
}: {
inherit name;
value =
@ -112,7 +128,7 @@ rec {
inherit system;
};
modules = [
(./config + "/${name}.nix")
(./config + "/${configName}.nix")
./config/default.nix
sops-nix.nixosModules.sops
home-manager.nixosModules.home-manager
@ -128,8 +144,15 @@ rec {
};
})
systems);
overlays = {
x86_64-linux = import ./overlays args "x86_64-linux";
aarch64-linux = import ./overlays args "aarch64-linux";
};
devShell.x86_64-linux = let
pkgs = import nixpkgs {system = "x86_64-linux";};
pkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [self.overlays.x86_64-linux];
};
in
pkgs.mkShell {
nativeBuildInputs = with pkgs; [
@ -147,11 +170,114 @@ rec {
];
};
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
homeConfigurations = builtins.listToAttrs (nixpkgs.lib.foldr (a: b: a ++ b) [] (map (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [
self.overlays.${system}
nur.overlay
args.prismmc.overlay
];
config.allowUnfree = true;
};
in [
{
name = "base-${system}";
value = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
(import ./config/home-manager/base.nix false)
{
home.username = "base";
home.homeDirectory = "/home/base";
}
];
extraSpecialArgs = args // {inherit system;};
};
}
{
name = "base-desktop-${system}";
value = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
(import ./config/home-manager/base.nix true)
{
home.username = "base";
home.homeDirectory = "/home/base";
}
];
extraSpecialArgs = args // {inherit system;};
};
}
{
name = "root-${system}";
value = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
./config/home-manager/root.nix
{
home.username = "root";
home.homeDirectory = "/root";
}
];
extraSpecialArgs = args // {inherit system;};
};
}
{
name = "darkkirb-${system}";
value = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
(import ./config/home-manager/darkkirb.nix {
desktop = false;
args = {};
})
{
home.username = "darkkirb";
home.homeDirectory = "/home/darkkirb";
}
];
extraSpecialArgs = args // {inherit system;};
};
}
{
name = "darkkirb-desktop-${system}";
value = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
(import ./config/home-manager/darkkirb.nix {
desktop = true;
args = {};
})
{
home.username = "darkkirb";
home.homeDirectory = "/home/darkkirb";
}
];
extraSpecialArgs = args // {inherit system;};
};
}
{
name = "miifox-${system}";
value = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
./config/home-manager/miifox.nix
{
home.username = "miifox";
home.homeDirectory = "/home/miifox";
}
];
extraSpecialArgs = args // {inherit system;};
};
}
]) ["x86_64-linux" "aarch64-linux"]));
hydraJobs =
(builtins.listToAttrs (map
({
name,
system,
...
}: {
inherit name;
value = {
@ -161,6 +287,7 @@ rec {
systems))
// {
inherit devShell;
homeConfigurations = nixpkgs.lib.mapAttrs (_: v: v.activationPackage) self.homeConfigurations;
# Uncomment the line to build an installer image
# This is EXTREMELY LARGE and will make builds take forever
# installer.x86_64-linux = nixosConfigurations.installer.config.system.build.isoImage;

65
overlays/default.nix Normal file
View file

@ -0,0 +1,65 @@
inputs: system: self: prev: let
inherit (inputs) nixpkgs nixpkgs-noto-variable nix-packages hydra;
noto-variable = import nixpkgs-noto-variable {inherit system;};
in
with nixpkgs.legacyPackages.${system};
{
hydra-unstable = hydra.packages.${system}.hydra.overrideAttrs (_: {
checkPhase = "true";
installCheckPhase = "true";
});
mosh = prev.mosh.overrideAttrs (old: {
patches = [
./config/workarounds/mosh/ssh_path.patch
./config/workarounds/mosh/mosh-client_path.patch
./config/workarounds/mosh/utempter_path.patch
./config/workarounds/mosh/bash_completion_datadir.patch
];
postPatch = ''
substituteInPlace scripts/mosh.pl \
--subst-var-by ssh "${openssh}/bin/ssh" \
--subst-var-by mosh-client "$out/bin/mosh-client"
'';
version = "2022-02-04";
src = prev.fetchFromGitHub {
owner = "mobile-shell";
repo = "mosh";
rev = "dbe419d0e069df3fedc212d456449f64d0280c76";
sha256 = "09mvk9zxclkf4wrkkfzg0p2hx1f74gpymr0a0l3pckmk6za2n3d1";
};
});
inherit (noto-variable) noto-fonts-cjk;
nix = nix-packages.packages.${system}.nix-s3-dedup.overrideAttrs (old: rec {
postPatchPhase = ''
sed 's/getBoolAttr."allowSubstitutes", true./true/' src/libstore/parsed-derivations.cc
'';
checkPhase = "true";
installCheckPhase = "true";
});
rnix-lsp = with prev;
rustPlatform.buildRustPackage rec {
pname = "rnix-lsp";
version = "0.3.0-alejandra";
src = fetchFromGitHub {
owner = "nix-community";
repo = "rnix-lsp";
# https://github.com/nix-community/rnix-lsp/pull/89
rev = "9189b50b34285b2a9de36a439f6c990fd283c9c7";
sha256 = "sha256-ZnUtvwkcz7QlAiqQxhI4qVUhtVR+thLhG3wQlle7oZg=";
};
cargoSha256 = "sha256-VhE+DspQ0IZKf7rNkERA/gD7iMzjW4TnRSnYy1gdV0s=";
cargoBuildFlags = ["--no-default-features" "--features" "alejandra"];
checkPhase = "true";
meta = with lib; {
description = "A work-in-progress language server for Nix, with syntax checking and basic completion";
license = licenses.mit;
maintainers = with maintainers; [ma27];
};
};
element-web = prev.callPackage ../packages/element-web.nix {};
}
// nix-packages.packages.${system}

View file

@ -2,6 +2,9 @@ network:
wireguard:
privkey: ENC[AES256_GCM,data:OlJjO2rg3Em9XrCwG9F2rMIHWpTgtSGjZ2hKeLgg8Su7+4PNIJPEvnc69no=,iv:WgKxnMmkebp4cFj+m5GjBuBIIZgXuW8xZzv3WvqYgFE=,tag:nwNQn0CmbRtrXdpcMZ2GVg==,type:str]
security:
acme:
dns: ENC[AES256_GCM,data:3o7posdGe1kSZ7c/EhuFcz1xTTK92WcPBFyYElNVRc6MqvZT2bR0HBbjqbtvptWJFvyIqO35Ho4Kfmjn/nxsKukaZvLGgp5+U+++1LkMqOUWsQYJont+Kv/3YWXruPgYTf3+rwfBLwNwhz16ra64uq8SiOwDyZvd9rJGRbCQffBrVHSWP2coMdbP/aXytOwlDOFNQ0pKba4dklY27o4HVBtDPAdKyWObdQslmqGH9acsgrKWlbWSfi1zQr0IU9eKBMFgrAVZgyNK+GRLXDvje6+6K7kQ,iv:vNe7e8kY7GSfc3gioI37N+UNe+eSNasys4Q0BrSnLUs=,tag:TAaXUiGsCqKfe2eNt77uNg==,type:str]
cloudflare: ENC[AES256_GCM,data:/e4V47kr+hfoeh7veQ5vj6mkb+3nVuDZx5j+CnAE/G7yTPWYgLrACGDwl36xJynumMMcDkvwlFYcTxxbiD2s83m6IxzukUB+61z8WC79SQwDGxxTL1gBfAdyXavD2hXh2c3zuFQOm1yjUQjvbHgdn+zPWfwCbUjipQX/dYAt4fvRwfXHhW32FupDgobgQq5SIZ1mMxZrIZjuZzDczDlaumUMADHsH8nasJP6gn/8RQ5Y1n16VJzJRjU=,iv:KCEhh7V5ydFEp1E/GbxrmvLBDibHIJKrJWDbCvJD17k=,tag:N0tEXUrjbrTq2ooubq9iCg==,type:str]
restic:
password: ENC[AES256_GCM,data:Ff4m8C2YizgEh3wNIfO/DgxG1jE=,iv:eDAUMKF974iq7bHnep97XGtj8wcJSa7HRXtUR2t8v8A=,tag:+OZQ8zUxzQHStGGajItDQg==,type:str]
services:
@ -19,8 +22,8 @@ sops:
azure_kv: []
hc_vault: []
age: []
lastmodified: "2022-11-10T11:03:30Z"
mac: ENC[AES256_GCM,data:YIZZdtYd39jpH4z2wXyi1JrDinTvgXdPU+vHgPjuAZcJGS7n88Cjy+pvM69uGMk0AgBqTOi2Sy2dpzdnbdAPUKt5h89c6VvS9vaq/CMObT/Pr+RuyMrmociM8s3D4vVnHgEdEtIMyYM13qAzXKfUI+LQPY+/jkt1zn3A3jqPRdU=,iv:sYs35pRDqowDfZHFidSoNYwwSposNYlsoqQ38K0LTi8=,tag:Up62CeEOLfUui3G1G1un/g==,type:str]
lastmodified: "2022-12-18T14:15:12Z"
mac: ENC[AES256_GCM,data:cNVOSmZkYXlIcpWg/b/iLoAmLmFKrl+YVgy54RwjwWqE7LsTH9GOYO7+NTQQIMJdU9RJ7kIrGYCs8DJj1tguvAqxeU9gPKr9fDz+AKyspAsT5Foft76amWPs1slPv6miHLI7oXrXoDqlF5tTsRlN1yT5FnLEjMZHCu1vdpRGWZs=,iv:ee8dCWv91Zzj13XY5+N89C9sSTCAxNpQxy1JpH2irr4=,tag:BT3PfVDpeAd+qv4XV433qA==,type:str]
pgp:
- created_at: "2022-03-22T08:12:00Z"
enc: |