Compare commits

..

3 commits

Author SHA1 Message Date
1fcba0942d reformat with updated nixfmt 2025-06-10 13:17:19 +02:00
87a20886cd use deployed environment for launching nixops4 from the panel
this still needs more work to clean up fully
2025-06-10 13:16:42 +02:00
191d2c4d43 use Nixpkgs from npins in the flake 2025-06-10 13:16:42 +02:00
2 changed files with 64 additions and 58 deletions

120
flake.nix
View file

@ -10,64 +10,70 @@
inputs@{ flake-parts, ... }: inputs@{ flake-parts, ... }:
let let
sources = import ./npins; sources = import ./npins;
inherit (import "${flake-inputs}/lib.nix") import-flake; inherit (import "${sources.flake-inputs}/lib.nix") import-flake;
inherit (sources) git-hooks agenix; inherit (sources) git-hooks agenix;
nixpkgs = import-flake sources.nixpkgs; nixpkgs = import-flake sources.nixpkgs;
in in
flake-parts.lib.mkFlake { inputs = inputs // { inherit nixpkgs; }; } { flake-parts.lib.mkFlake
systems = [ {
"x86_64-linux" inputs = inputs // {
"aarch64-linux" inherit nixpkgs;
"x86_64-darwin"
"aarch64-darwin"
];
imports = [
(import "${git-hooks}/flake-module.nix")
inputs.nixops4.modules.flake.default
./deployment/flake-part.nix
./infra/flake-part.nix
];
perSystem =
{
pkgs,
lib,
inputs',
...
}:
{
formatter = pkgs.nixfmt-rfc-style;
pre-commit.settings.hooks =
let
## Add a directory here if pre-commit hooks shouldn't apply to it.
optout = [ "npins" ];
excludes = map (dir: "^${dir}/") optout;
addExcludes = lib.mapAttrs (_: c: c // { inherit excludes; });
in
addExcludes {
nixfmt-rfc-style.enable = true;
deadnix.enable = true;
trim-trailing-whitespace.enable = true;
shellcheck.enable = true;
};
devShells.default = pkgs.mkShell {
packages = [
pkgs.npins
pkgs.nil
(pkgs.callPackage "${agenix}/pkgs/agenix.nix" { })
pkgs.openssh
pkgs.httpie
pkgs.jq
# exposing this env var as a hack to pass info in from form
(inputs'.nixops4.packages.default.overrideAttrs {
impureEnvVars = [ "DEPLOYMENT" ];
})
];
};
}; };
}; }
{
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
imports = [
(import "${git-hooks}/flake-module.nix")
inputs.nixops4.modules.flake.default
./deployment/flake-part.nix
./infra/flake-part.nix
];
perSystem =
{
pkgs,
lib,
inputs',
...
}:
{
formatter = pkgs.nixfmt-rfc-style;
pre-commit.settings.hooks =
let
## Add a directory here if pre-commit hooks shouldn't apply to it.
optout = [ "npins" ];
excludes = map (dir: "^${dir}/") optout;
addExcludes = lib.mapAttrs (_: c: c // { inherit excludes; });
in
addExcludes {
nixfmt-rfc-style.enable = true;
deadnix.enable = true;
trim-trailing-whitespace.enable = true;
shellcheck.enable = true;
};
devShells.default = pkgs.mkShell {
packages = [
pkgs.npins
pkgs.nil
(pkgs.callPackage "${agenix}/pkgs/agenix.nix" { })
pkgs.openssh
pkgs.httpie
pkgs.jq
# exposing this env var as a hack to pass info in from form
(inputs'.nixops4.packages.default.overrideAttrs {
impureEnvVars = [ "DEPLOYMENT" ];
})
];
};
};
};
} }

View file

@ -185,7 +185,7 @@ in
] ]
++ ( ++ (
with pkgs; with pkgs;
lib.mkBinPath [ lib.makeBinPath [
nix nix
git git
] ]