Initial commit
This commit is contained in:
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
||||
* text=auto
|
||||
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
.direnv/
|
||||
.envrc
|
||||
|
||||
5
README.md
Normal file
5
README.md
Normal file
@@ -0,0 +1,5 @@
|
||||
Nix image builder
|
||||
|
||||
---
|
||||
|
||||
Builds a docker image built off the ubuntu-latest gitea act runner that I can use for building with nix with stuff cached.
|
||||
39
flake.nix
Normal file
39
flake.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
description = "Gitea act runner with Nix installed";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
treefmt-nix.url = "github:numtide/treefmt-nix";
|
||||
};
|
||||
|
||||
outputs =
|
||||
{ nixpkgs, ... }@inputs:
|
||||
let
|
||||
supportedSystems = [ "x86_64-linux" ];
|
||||
pkgsFor =
|
||||
system:
|
||||
nixpkgs.legacyPackages.${system}.extend (
|
||||
nixpkgs.lib.composeManyExtensions ([ ])
|
||||
# nixpkgs.lib.composeManyExtensions ([ ] ++ builtins.attrValues self.overlays)
|
||||
);
|
||||
eachSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f (pkgsFor system));
|
||||
|
||||
treefmtEval = eachSystem (pkgs: inputs.treefmt-nix.lib.evalModule pkgs ./treefmt.nix);
|
||||
in
|
||||
{
|
||||
# nix fmt formatter
|
||||
formatter = eachSystem (pkgs: treefmtEval.${pkgs.system}.config.build.wrapper);
|
||||
|
||||
# default devshell
|
||||
|
||||
devShells = eachSystem (pkgs: {
|
||||
default = pkgs.mkShell {
|
||||
packages = [ pkgs.just ];
|
||||
|
||||
# Will be executed before entering the shell
|
||||
# or running a command
|
||||
shellHook = '''';
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
23
justfile
Normal file
23
justfile
Normal file
@@ -0,0 +1,23 @@
|
||||
# by default list all just commands
|
||||
default:
|
||||
just --list
|
||||
|
||||
# run all tests
|
||||
test:
|
||||
#!/usr/bin/env bash
|
||||
set -euxo pipefail
|
||||
|
||||
# would love test: fmt to make sure formatting happens but in WSL formatting is slow...
|
||||
# poor filesystem access performance
|
||||
|
||||
echo "testing..."
|
||||
nix flake check
|
||||
# uv run ruff check src tests
|
||||
|
||||
#
|
||||
|
||||
# format code
|
||||
fmt:
|
||||
#!/usr/bin/env bash
|
||||
set -euxo pipefail
|
||||
nix fmt
|
||||
21
treefmt.nix
Normal file
21
treefmt.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
# treefmt.nix
|
||||
{ ... }:
|
||||
{
|
||||
projectRootFile = "treefmt.nix";
|
||||
settings.global.excludes = [
|
||||
"*.toml"
|
||||
"*.txt"
|
||||
".gitattributes"
|
||||
"CLAUDE.md"
|
||||
".python-version"
|
||||
];
|
||||
|
||||
programs.deadnix.enable = true;
|
||||
programs.mdsh.enable = true;
|
||||
programs.nixfmt.enable = true;
|
||||
programs.shellcheck.enable = true;
|
||||
programs.shfmt.enable = true;
|
||||
programs.yamlfmt.enable = true;
|
||||
programs.just.enable = true;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user