Files
develnixos.new/flake.nix
2024-01-10 21:21:58 +00:00

63 lines
1.7 KiB
Nix

{
description = "";
inputs = {
nixpkgs.url = "nixpkgs/nixos-23.11";
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs = inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" "aarch64-linux" ];
perSystem = { config, pkgs, system, ... }:
let
version = "0.0.1";
name = "develnixos";
updateLockScript = pkgs.writeShellScriptBin "update_flake_lock.sh" ''
nix --experimental-features 'nix-command flakes' flake lock --update-input nixpkgs
nix --experimental-features 'nix-command flakes' build
'';
autoTag = pkgs.writeScript "auto_tag.sh" ''
git tag --force v${version}
git push origin v${version}
'';
space = rec {
config = import ./config { nixpkgs = pkgs; };
playground = import ./playground/example { config = space.config; };
};
foo = pkgs.runCommand "linter" ''
echo the_linter
'';
in {
packages.default = space.playground.package;
apps = {
default = space.playground.app;
updateFlakeLock = {
type = "app";
program = "${updateLockScript}/bin/update_flake_lock.sh";
};
autoTag = {
type = "app";
program = "${autoTag}";
};
};
devShells.default = pkgs.mkShell {
name = "dev-shell";
packages = [ pkgs.nixfmt ];
shellHook = ''
. ./alias.sh
'';
};
checks = {
package = space.playground.package;
};
};
};
}