Skip to content

Commit

Permalink
move to private repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Czichy committed Jul 4, 2024
0 parents commit a10c71d
Show file tree
Hide file tree
Showing 254 changed files with 26,498 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .cz.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[tool.commitizen]
name = "cz_conventional_commits"
tag_format = "v$version"
version_scheme = "semver"
version = "0.3.0"
update_changelog_on_bump = true
major_version_zero = true
13 changes: 13 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
if ! has nix_direnv_version || ! nix_direnv_version 3.0.4; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.4/direnvrc" "sha256-DzlYZ33mWF/Gs8DDeyjr8mnVmQGx7ASYqA5WlxwvBG4="
fi


watch_file flake.nix
watch_file flake.lock
watch_file parts/shells/dev.nix

if ! use flake .#dev --accept-flake-config --override-input devenv-root "file+file://"<(printf %s "$PWD")
then
echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2
fi
40 changes: 40 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# TODO: Place a short descriptive PR name here

## Overview

<!-- Provide a brief overview of what this PR aims to accomplish. For instance,
is it adding a new configuration, updating an existing one, fixing a bug, or
improving the documentation? -->

## Testing

<!-- Describe the testing process for the changes. Include steps to reproduce
any relevant scenarios and the expected outcomes. For example when creating a new
package, test that `nix build` produces the expected binaries/libraries and that
they work as well. Or when adding new NixOS/home-manager modules that you were
able to include them in a NixOS/home-configuration build and that they work.-->

## Dependencies (flake inputs)

<!-- List any new dependencies introduced by this PR, or if any existing
dependencies are updated or removed. -- >
## Screenshots
<!-- Provide screenshots demonstrating the changes, especially for UI-related
updates (if applicable). -->

## Checklist

<!-- Ensure you've gone through this checklist before submitting your PR. -->

- [ ] I have tested the relevant changes locally.
- [ ] I have checked that `nix flake check --impure` passes.
- [ ] I have ensured my commits follow the project's conventional commits guidelines.
- [ ] I have checked that the changes follow a linear history.
- [ ] (If applicable) I have commented any relevant parts of my code.
- [ ] (If applicable) I have added appropriate unit/feature tests.
- [ ] (If applicable) I have updated the documentation accordingly (in English).

## Additional Notes

<!-- Add any other notes, comments, or considerations regarding the PR here. -->
17 changes: 17 additions & 0 deletions .github/workflows/check-on-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "flake check"
on:
pull_request:
types: [opened, reopened, synchronize]
repository_dispatch:
types: [create-pull-request]
jobs:
check:
if: false # TODO insufficient CI disk space to run the job unfortunately
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix flake check --override-input devenv-root "file+file://"<(printf %s "$PWD") --show-trace --accept-flake-config
- name: Check Nix flake Nixpkgs inputs
uses: DeterminateSystems/flake-checker-action@main
21 changes: 21 additions & 0 deletions .github/workflows/flakehub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "FlakeHub"
on:
push:
branches:
- "main"
jobs:
flakehub-publish:
if: false # TODO flakehub push fails due to impurities, resolve this
runs-on: "ubuntu-latest"
permissions:
id-token: "write"
contents: "read"
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: DeterminateSystems/flakehub-push@main
with:
name: "czichy/tensorfiles"
rolling: true
visibility: "public"
46 changes: 46 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"] # disable for now

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build-and-deploy:
if: false # TODO docs derivation currently not maintained
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main

- name: Build docs using Nix
run: nix build .#docs

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: "result"

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
21 changes: 21 additions & 0 deletions .github/workflows/update-flake-lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: update-flake-lock
on:
workflow_dispatch: # allows manual triggering
schedule:
- cron: "0 0 * * 0" # runs weekly on Sunday at 00:00
jobs:
lockfile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@main
with:
pr-assignees: czichy
pr-title: "Automated action - Update flake.lock" # Title of PR to be created
pr-labels: | # Labels to be set on the PR
dependencies
automated
token: ${{ secrets.GH_TOKEN_FOR_UPDATES }}
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
*.sw?
.vim/backup/*
.vim/tmp/*
.vim/undos/
.vim/plugged/
result/
build/

result
.direnv/
.devenv/

.devcontainer.json
.pre-commit-config.yaml

# home-manager
czichy
czichy-*-link
!parts/**/czichy

# tmp
etc/dotfiles/config/wal/templates/Xresources
etc/dotfiles/config/wal/templates/dunstrc
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Changelog

## v0.3.0 (2023-11-11)

### Feat

- **modules,lib**: add direnv module,add additional lib helpers
- **devenv**: update devenv with devcontainers and other features

### Fix

- **modules.system.users**: fix allowed users setting

## v0.2.0 (2017-02-13)

## v0.1.0 (2017-02-13)
66 changes: 66 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
## This is also wrapped up into the command "world" which is available
## anywhere - even outside this repo. See: utils/world.nix

set shell := ["nu", "-c"]

alias help := default

default:
@just --list -f {{justfile()}} -d {{invocation_directory()}}
@if (echo {{invocation_directory()}} | str contains "world") { echo "\n lint\n check" }

# search for packages
search query:
@nix search nixpkgs {{query}} --json | from json | transpose | flatten | select column0 version description | rename --column { column0: attribute }

# open a shell with given packages available
shell +args:
@nix shell (echo '{{args}}' | each { |it| if ($it | str contains '#') { $it } else { $"nixpkgs#($it)" } } )

# open a shell with given packages available allowing unfree packages
shell-unfree +args:
@with-env [NIXPKGS_ALLOW_UNFREE 1] { nix shell --impure (echo '{{args}}' | each { |it| if ($it | str contains '#') { $it } else { $"nixpkgs#($it)" } } ) }

# garbage collect the system
gc:
@nix-collect-garbage -d

cachix +args:
with-env [CACHIX_SIGNING_KEY (rbw get cachix)] { cachix push insane {{args}} }

# upgrade the system using given flake ref
upgrade flake="github:johnae/world":
@rm -rf ~/.cache/nix/fetcher-cache-v1.sqlite*
@nixos-rebuild boot --flake '{{flake}}' --use-remote-sudo -L
@if (echo initrd kernel kernel-modules | all { |it| (readlink $"/run/booted-system/($it)") != (readlink $"/nix/var/nix/profiles/system/($it)") }) { echo "The system must be rebooted for the changes to take effect" } else { nixos-rebuild switch --flake '{{flake}}' --use-remote-sudo -L }

# build the system using given flake ref
build flake="github:johnae/world":
@nixos-rebuild build --flake '{{flake}}' --use-remote-sudo -L

[private]
echo +args:
@echo '{{args}}'

[private]
gh-release-update:
./misc/gh-release-update.nu

[private]
lint:
@echo '-------- [Linting] ---------'
@let out = (statix check . | complete); if ($out.exit_code > 0) { let span = (metadata $out).span; error make {msg: "Linting failed", label: {text: $out.stdout, span: $span}} } else { print "Lint ok\n\n"; print $out.stdout }

[private]
dead:
@echo '-------- [Check for dead code] ---------'
@let out = (deadnix -f . | complete); if ($out.exit_code > 0) { let span = (metadata $out).span; error make {msg: "Dead code check failed", label: {text: $out.stdout, span: $span}} } else { print "No dead code\n\n"; print $out.stdout }

[private]
dscheck:
@echo '-------- [Flake checker] ---------'
@let out = (nix run github:DeterminateSystems/flake-checker | complete); if ($out.exit_code > 0) { let span = (metadata $out).span; error make {msg: "Flake checker failed", label: {text: $out.stdout, span: $span}} } else { print "Flake is good\n\n"; print $out.stdout }

[private]
check:
@nix flake check --impure # impure because of devenv
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Tomáš Sandrini

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit a10c71d

Please sign in to comment.