Compare commits

..

2 commits

Author SHA1 Message Date
350245c097 use deployed environment for launching nixops4 from the panel
this still needs more work to clean up fully
2025-06-06 12:14:34 +02:00
631ce8a92d use Nixpkgs from npins in the flake 2025-06-06 12:13:51 +02:00
2 changed files with 53 additions and 59 deletions

110
flake.nix
View file

@ -10,70 +10,64 @@
inputs@{ flake-parts, ... }: inputs@{ flake-parts, ... }:
let let
sources = import ./npins; sources = import ./npins;
inherit (import "${sources.flake-inputs}/lib.nix") import-flake; inherit (import "${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 flake-parts.lib.mkFlake { inputs = inputs // { inherit nixpkgs; }; } {
{ systems = [
inputs = inputs // { "x86_64-linux"
inherit nixpkgs; "aarch64-linux"
}; "x86_64-darwin"
} "aarch64-darwin"
{ ];
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
imports = [ imports = [
(import "${git-hooks}/flake-module.nix") (import "${git-hooks}/flake-module.nix")
inputs.nixops4.modules.flake.default inputs.nixops4.modules.flake.default
./deployment/flake-part.nix ./deployment/flake-part.nix
./infra/flake-part.nix ./infra/flake-part.nix
]; ];
perSystem = perSystem =
{ {
pkgs, pkgs,
lib, lib,
inputs', inputs',
... ...
}: }:
{ {
formatter = pkgs.nixfmt-rfc-style; formatter = pkgs.nixfmt-rfc-style;
pre-commit.settings.hooks = pre-commit.settings.hooks =
let let
## Add a directory here if pre-commit hooks shouldn't apply to it. ## Add a directory here if pre-commit hooks shouldn't apply to it.
optout = [ "npins" ]; optout = [ "npins" ];
excludes = map (dir: "^${dir}/") optout; excludes = map (dir: "^${dir}/") optout;
addExcludes = lib.mapAttrs (_: c: c // { inherit excludes; }); addExcludes = lib.mapAttrs (_: c: c // { inherit excludes; });
in in
addExcludes { addExcludes {
nixfmt-rfc-style.enable = true; nixfmt-rfc-style.enable = true;
deadnix.enable = true; deadnix.enable = true;
trim-trailing-whitespace.enable = true; trim-trailing-whitespace.enable = true;
shellcheck.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" ];
})
];
}; };
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.makeBinPath [ lib.mkBinPath [
nix nix
git git
] ]